Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NWM 1km LDAS rechunked dataset #233

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 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
22 changes: 22 additions & 0 deletions recipes/NWM-1km/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
title: 'NWM-2.1-grid1km-LDAS-rechunked'
description: LDAS variables at 3-hourly intervals from the US National Water Model Version 2.1 Retrospective (1980-). There are 21 LDAS variables including soil moisture, rain, snow, evapotranspiration. This dataset has been rechunked from the original chunk pattern to better facilitate time series access.
pangeo_forge_version: '0.9.2'
pangeo_notebook_version: '2022.07.17'
recipes:
- id: NWM-2.1-grid1km-LDAS-rechunked
object: 'recipe:recipe'
provenance:
providers:
- name: 'NOAA Office of Water Prediction'
description: 'US NOAA OWP'
roles:
- provider
- licensor
url: https://water.noaa.gov/about/nwm
license: 'CC0'
maintainers:
- name: 'Rich Signell'
orcid: '0000-0003-0682-9613'
github: rsignell
bakery:
id: 'pangeo-ldeo-nsf-earthcube'
29 changes: 29 additions & 0 deletions recipes/NWM-1km/recipe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pandas as pd

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

dates = pd.date_range('1979-02-01 03:00', '2020-12-31 21:00', freq='3H')

time_concat_dim = ConcatDim('time', dates, nitems_per_file=1)

URL_FORMAT = (
's3://noaa-nwm-retrospective-2-1-pds/model_output/'
'{time:%Y}/{time:%Y%m%d%H}00.LDASOUT_DOMAIN1.comp'
)


def make_url(time):
return URL_FORMAT.format(time=time)
rsignell-usgs marked this conversation as resolved.
Show resolved Hide resolved


pattern = FilePattern(make_url, time_concat_dim)

target_chunks = {'time': 72, 'x': 512, 'y': 512}


def preprocess(ds):
return ds.drop('reference_time')


recipe = XarrayZarrRecipe(pattern, target_chunks=target_chunks, process_chunk=preprocess)