-
Notifications
You must be signed in to change notification settings - Fork 62
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
AWS NOAA WHOI #221
AWS NOAA WHOI #221
Changes from 6 commits
a279651
eb843a9
c1af95c
9d21dcf
7f85f66
d87c7ea
166954e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
title: 'AWS NOAA WHOI SST' | ||
description: 'Analysis-ready datasets derived from AWS NOAA WHOI NetCDF' | ||
pangeo_forge_version: '0.9.2' | ||
pangeo_notebook_version: '2021.07.17' | ||
recipes: | ||
- id: aws-noaa-sea-surface-temp-whoi | ||
object: 'recipe:recipe' | ||
provenance: | ||
providers: | ||
- name: 'AWS NOAA Oceanic CDR' | ||
description: 'Registry of Open Data on AWS National Oceanographic & Atmospheric Administration National Centers for Environmental Information' | ||
roles: | ||
- producer | ||
- licensor | ||
url: s3://noaa-cdr-sea-surface-temp-whoi-pds/ | ||
license: 'Open Data' | ||
maintainers: | ||
- name: 'Kathryn Berger' | ||
orcid: '0000-0001-9731-6519' | ||
github: kathrynberger | ||
bakery: | ||
id: 'pangeo-ldeo-nsf-earthcube' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import s3fs | ||
|
||
from pangeo_forge_recipes.patterns import pattern_from_file_sequence | ||
from pangeo_forge_recipes.recipes.reference_hdf_zarr import HDFReferenceRecipe | ||
|
||
url_base = 's3://noaa-cdr-sea-surface-temp-whoi-pds/data/' | ||
|
||
years = range(1988, 2022) | ||
file_list = [] | ||
|
||
fs = s3fs.S3FileSystem(anon=True) | ||
|
||
for year in years: | ||
file_list += sorted( | ||
filter(lambda x: x.endswith('.nc'), fs.ls(url_base + str(year), detail=False)) | ||
) | ||
|
||
pattern = pattern_from_file_sequence(file_list, 'time', nitems_per_file=1) | ||
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. My guess is that the files in 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. I'm working on a separate recipe and found this is the issue. adding a map to add the missing from os.path import join
fs = s3fs.S3FileSystem(anon=True)
is_nc = lambda x: x.endswith('.nc')
add_s3 = lambda x: "s3://" + x
for year in years:
file_list += sorted(
filter(is_nc, map(add_s3, fs.ls(join(url_base, str(year)), detail=False)))
) 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. thanks @cisaacstern @rabernat and @rbavery for catching this, I see the error here and will revise with the suggestion above. 👍 |
||
|
||
recipe = HDFReferenceRecipe(pattern, netcdf_storage_options={'anon': True}) |
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.
we might want to handle years differently, given that when data is available in 2023, this won't find the 2023 data.
years could instead be defined like so?
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.
good suggestion @rbavery just tested this to verify, great way to consider ingesting future years. I'll add this to the revisions