-
Notifications
You must be signed in to change notification settings - Fork 107
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
improve netcdf multi-group reading and handle metadata QC issue #516
Conversation
👈 Launch a binder notebook on this branch for commit 864ebb2 I will automatically update this comment whenever this PR is modified 👈 Launch a binder notebook on this branch for commit 6c22caa 👈 Launch a binder notebook on this branch for commit 714642f 👈 Launch a binder notebook on this branch for commit 3fcddad 👈 Launch a binder notebook on this branch for commit ec3680b 👈 Launch a binder notebook on this branch for commit 8ec1f55 👈 Launch a binder notebook on this branch for commit c9d64fb 👈 Launch a binder notebook on this branch for commit 3e17251 👈 Launch a binder notebook on this branch for commit 4efbaeb 👈 Launch a binder notebook on this branch for commit 7e1f506 👈 Launch a binder notebook on this branch for commit 23ff7ad 👈 Launch a binder notebook on this branch for commit 87ee63a 👈 Launch a binder notebook on this branch for commit b777a7f 👈 Launch a binder notebook on this branch for commit 1111e80 👈 Launch a binder notebook on this branch for commit ce54757 👈 Launch a binder notebook on this branch for commit d23d1a0 |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@rwegener2 @betolink @andypbarrett @scottyhq @wsauthoff @tsutterley @jpswinski |
hey @JessicaS11, is |
That's what came back when I ordered and downloaded from NSIDC:
That's also what I thought... my naive (and "potentially an issue" assumption) was that even if the file were being subset spatially, it shouldn't be affecting the structure and thus how xarray reads in a specific group. |
just to confirm, @JessicaS11 the local granule was downloaded using icepyx? if it was downloaded using the on-prem subsetting service maybe there is a bug in EGI (or an undocumented behavior) that removed the time dimension even if we are not subsetting the granule. |
Yes - with subsetting applied. (So subsetting on rasters is available now, @tsutterley!) Submitting to EGI without subsetting params returned ftp downloadUrls (which icepyx isn't set up to handle, since it looks for the order ID). To initiate the unprocessed granule download (via a url request in the browser), I had to set
@mikala-nsidc, @betolink suggested you might know what's going on (or someone who does) such that somehow EGI is restructuring the data when it's subsetted to turn the time dimension into bands (as interpreted by xarray). |
@JessicaS11 @betolink @tsutterley The way that the on prem subsetter handles ATL15 parameters that are 3 dimensional arrays is by "flattening" those bands. This means, for instance, that if you select a spatial subset of an ATL15 file, the time dimension in dh/dt will be separated into 18 bands. Attaching a screenshot to illustrate. |
Thanks, @mikala-nsidc! It's good to know that's intended behavior. Is there a verifiable mapping of bands to timestamps? I don't see anything in the metadata for a given band to indicate which timestamp it corresponds to. |
@wsauthoff @mikala-nsidc Are either of you available to review this PR? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #516 +/- ##
===============================================
- Coverage 66.59% 66.27% -0.32%
===============================================
Files 36 36
Lines 3059 3072 +13
Branches 534 537 +3
===============================================
- Hits 2037 2036 -1
- Misses 934 948 +14
Partials 88 88 ☔ View full report in Codecov by Sentry. |
icepyx/core/read.py
Outdated
# see: https://forum.earthdata.nasa.gov/viewtopic.php?t=5154 | ||
# (v006, v003, v003, respectively) | ||
# Note that this results in a login being required even for a local file | ||
# because otherwise Variables tries to get the version from the file (ln99). |
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.
line 99 doesn't seem to do this, unless this is a reference to a different notebook or py script?
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.
Lines 99-103 of the Variables module are:
# Check for valid version string
# If version is not specified by the user assume the most recent version
self._version = val.prod_version(
is2ref.latest_version(self._product), version
)
I'll update the comment to make it clearer that it's a different file.
Per this discussion, ATL11 v006, ATL14 v003, and ATL15 v003 have metadata issues that cause icepyx to fail when it tries to get the version number from the granule file. This PR issues a temporary fix that instead gets the most recent version number from CMR to use instead.
It also adds handling reading in multiple groups of a netcdf.