-
Notifications
You must be signed in to change notification settings - Fork 63
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
[WIP] Add daymet #213
Draft
yuvipanda
wants to merge
47
commits into
pangeo-forge:master
Choose a base branch
from
yuvipanda:daymet
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+123
−0
Draft
[WIP] Add daymet #213
Changes from 16 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
1d74af4
Test
yuvipanda 532209c
Remove enums
yuvipanda 2bc3674
Fucking scope shit
yuvipanda 1dbf425
Till last year
yuvipanda 42573b1
Make it a dict
yuvipanda a494b48
debug
yuvipanda d2d43d7
Use cmr
yuvipanda 3208078
Support earthdata login
yuvipanda d65ab19
Split things into one per region per variable
yuvipanda 961835b
Set nitems_per_input
yuvipanda 3c0a3e5
Fix name
yuvipanda 34f2cbc
Don't shard by region
yuvipanda 2c8e8c4
Try a different nitems_per_file
yuvipanda 0dc6e0a
pass in nitems elsewhere
yuvipanda be9590d
Try this
yuvipanda 5a50ed2
Try just 1 input per chunk
yuvipanda 5c6b152
Merge all vars into one store
yuvipanda f65b42e
Try going one level deeper
yuvipanda eb4c12d
Fuck serialization
yuvipanda 4537e10
Pass as args
yuvipanda 77ae336
Fix ordering
yuvipanda 9cc0228
Try amend
yuvipanda 3c9058c
XarrayZarr can't handle more than 1 MergeDim apparently
yuvipanda 0d7df7b
Revert "XarrayZarr can't handle more than 1 MergeDim apparently"
yuvipanda dcfff1e
Revert "Revert "XarrayZarr can't handle more than 1 MergeDim apparent…
yuvipanda e5243ad
Revert "Revert "Revert "XarrayZarr can't handle more than 1 MergeDim …
yuvipanda f353f41
Try
yuvipanda 0c9d57e
Try dict
yuvipanda 1096f8a
Recipe name
yuvipanda 717edef
Try partial
yuvipanda 758864b
Debug
yuvipanda 107b150
Try multiple concat dims
yuvipanda 83d2263
What if we return none
yuvipanda 1f8feb8
Fuck
yuvipanda 3fe8f19
Try just na
yuvipanda e6c215f
blah
yuvipanda 87ee3a5
fadf
yuvipanda e383f2a
try just one thing
yuvipanda 6e1a899
try target chunks
yuvipanda d0608b2
ldsf
yuvipanda 5d5e269
Simplify so recipe works for 1 region, 1 variable
yuvipanda 3caff10
Create a zarr output per variable for hi
yuvipanda 24eb1fb
Produce one recipe per region per variable
yuvipanda 89971c7
Adopt recipe to use beam-refactor
yuvipanda cff9b83
Explicitly install required packages
yuvipanda 9f70560
Generate all variables for na
yuvipanda de5b8ee
Use / as separator in subpath
yuvipanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
title: Daymet | ||
description: > | ||
Daily Surface Weather and Climatological Summaries (Daymet) provides | ||
long-term, continuous, gridded estimates of daily weather and climatology | ||
variables by interpolating and extrapolating ground-based observations through | ||
statistical modeling techniques. The Daymet data products provide driver data | ||
for biogeochemical terrestrial modeling and have myriad applications in many | ||
Earth science, natural resource, biodiversity, and agricultural research | ||
areas. Daymet weather variables include daily minimum and maximum temperature, | ||
precipitation, vapor pressure, shortwave radiation, snow water equivalent, and | ||
day length produced on a 1 km x 1 km gridded surface over continental North | ||
America and Hawaii from 1980 and over Puerto Rico from 1950 through the end of | ||
the most recent full calendar year. | ||
pangeo_forge_version: '0.9.0' | ||
pangeo_notebook_version: '2022.06.02' | ||
recipes: | ||
dict_object: recipe:recipes | ||
provenance: | ||
license: 'No constraints on data access or use.' | ||
maintainers: | ||
- name: 'Charles Stern' | ||
orcid: '0000-0002-4078-0852' | ||
github: cisaacstern | ||
bakery: | ||
id: 'pangeo-ldeo-nsf-earthcube' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from pangeo_forge_recipes.patterns import pattern_from_file_sequence | ||
from pangeo_forge_recipes.recipes import XarrayZarrRecipe | ||
from pangeo_forge_cmr import get_cmr_granule_links | ||
|
||
from pangeo_forge_recipes import patterns | ||
import aiohttp | ||
import netrc | ||
|
||
# We need to provide EarthData credentials to fetch the files. | ||
# The credentials of the currently logged in user are used, and passed on to the cloud | ||
# as well when the operation is scaled out. This shall be automated with a machine identity | ||
# in the future. | ||
# go here to set up .netrc file: https://disc.gsfc.nasa.gov/data-access | ||
username, _, password = netrc.netrc().authenticators('urs.earthdata.nasa.gov') | ||
client_kwargs = { | ||
'auth': aiohttp.BasicAuth(username, password), | ||
'trust_env': True, | ||
} | ||
|
||
# Get the GPM IMERG Late Precipitation Daily data | ||
shortname = 'Daymet_Daily_V4_1840' | ||
|
||
all_files = get_cmr_granule_links(shortname) | ||
|
||
var_files = {} | ||
|
||
for f in all_files: | ||
region, var, year = f.rsplit("/", 1)[1].rsplit(".", 1)[0].rsplit("_", 3)[1:] | ||
var_files.setdefault(var, []).append(f) | ||
|
||
|
||
print(var_files) | ||
|
||
recipes = {} | ||
|
||
|
||
for var in var_files: | ||
# Use '-' not '_' to be valid dataflow name | ||
recipes[var] = XarrayZarrRecipe( | ||
pattern_from_file_sequence( | ||
var_files[var], | ||
# FIXME: Leap years?! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They just drop December 31st on leap years :) |
||
concat_dim='time', | ||
nitems_per_file=365, | ||
fsspec_open_kwargs=dict( | ||
client_kwargs=client_kwargs | ||
), | ||
), | ||
inputs_per_chunk=1, | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the "1840" here specific to daily - North America? And other regions will have different numerical IDs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is daily, but all spatial areas are distributed under that DOI. The granule-level file name will distinguish the difference; na, pr, hi. We just updates and 1840 is now 2129.
https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=2129
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new short name: Daymet_Daily_V4R1_2129