Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions recipes/cmip6-wrf-wus/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
title: CMIP6 GCMs downscaled using WRF
description: >-
Downscaling of CMIP6 GCMs conducted at UCLA for the western US over 45km and
9km grid-spacing, and over California and Wyoming for 3km grid-spacing in some
cases.
recipes:
dict_object: 'recipe:recipes'
provenance:
providers:
- name: UCLA Center for Climate Science
description: 'University of California, Los Angeles Center for Climate Science'
roles:
- producer
- processor
- licensor
url: 'https://dept.atmos.ucla.edu/alexhall/downscaling-cmip6'
- name: AWS
description: AWS Sustainability Data Initiative
roles:
- host
url: 'https://registry.opendata.aws/wrf-cmip6/'
license: CC BY-SA 4.0
maintainers:
- name: Naomi Goldenson
orcid: 0000-0003-0656-4168
github: thenaomig
bakery:
id: pangeo-ldeo-nsf-earthcube
34 changes: 34 additions & 0 deletions recipes/cmip6-wrf-wus/recipe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import functools

import pandas as pd

from pangeo_forge_recipes.patterns import ConcatDim, FilePattern
from pangeo_forge_recipes.recipes import HDFReferenceRecipe

recipe_dict = {
'cesm2_r11i1p1f1_ssp370': {
'url_format': (
'https://wrf-cmip6-noversioning.s3.amazonaws.com/downscaled_products/gcm/'
'cesm2_r11i1p1f1_ssp370/hourly/{Time:%Y}/d02/auxhist_d01_{Time:%Y-%m-%d_%X}'
),
'times': pd.date_range('2014-09-01', '2100-08-31 23:00', freq='H'),
}
}


def make_url(Time, URL_FORMAT=None):
return URL_FORMAT.format(Time=Time)


recipes = {}
for key, value in recipe_dict.items():
times = value['times']
time_concat_dim = ConcatDim('Time', times)
make_url_partial = functools.partial(make_url, URL_FORMAT=value['url_format'])
pattern = FilePattern(make_url_partial, time_concat_dim)
recipes[key] = HDFReferenceRecipe(
pattern,
concat_dims=['Time'],
coo_map={'Time': [str(time) for time in times]},
preprocess=None,
)