-
Notifications
You must be signed in to change notification settings - Fork 4
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
IndexError
for .dods for certain datasets
#59
Comments
Hi @sjordan29 , I actually just ran into that same Any chance you could open the original Zarr source locally, and slice it down to a minimum dataset that causes that error and share a NetCDF of that? That way I can throw it into the test suite and compare what Xarray opens directly vs what it can load over OpenDAP. |
Thanks so much! I added a slice of the data and the notebook showing the error I'm getting on our fork here: https://github.com/LimnoTech/xpublish-opendap/tree/index-error/notebooks/dev_sandbox |
@abkfenris, thanks for looking into this issue. BTW, USGS just made their xpublish-builder repo public, which shows how we pull everything together to create the OpenDAP endpoints exposed at https://labs-beta.waterdata.usgs.gov/api/xpublish/catalogs. Our hope that this builder repo might be useful for you or others working on https://ioos.github.io/ioos-code-sprint/2024/topics/06-xpublish.html |
Great, thank you both! I'll try to take a look later or tomorrow. |
Hmm, it looks like we're (at least) generating different THREDDS DDS
xpublish DDS
|
Make sure that dataarrays are encoded as well to hopefully solve IndexError issues when datetimes are not coordinates. Works on #59
Ok, got a bit farther into the weeds here. When Hyrax or THREDDS encounters a dataarray that has a non coordinate dimension, instead of returning a DAP Grid with the dimensions mapped, they instead return a DAP Array with multiple dimensions. Currently the underlying OpenDAP library that we are using is hard coded to only respond with single dimension arrays that aren't Grids. In #60 I've gone and added some extra encoding checks and a custom OpenDAP Array that encodes dimensions similarly to Hyrax and THREDDS. This seems to take care of I've included your PRISM dataset as test data and am running automated tests against it, to make sure we don't have a regression. Strangely with Py.test locally and in the Github Actions matrix it passes, but when tested locally with a nox matrix it fails due to It would be great if you all could try testing that PR and let me know if that does the trick. Some related issues I found along the way:
|
@abkfenris, thanks so much for digging into this! I will test #60 with PRISM in our Catalog-To-Xpublish implementation and let you know how it goes. |
Opening With
|
Can you try building a new environment? I found that I was sporadically getting those |
Hi @abkfenris, just got to building a new environment -- apologies for the delay. Still getting the error. A couple notes:
|
Hi @abkfenris, I've been maintaining Catalog-To-Xpublish, and we're having some issues with the
opendap
response for one of the USGS datasets we're working with. Most datasets available do work, so this seems to be anomaly to work out with this dataset.The Problem Dataset
We're having issues with
PRISM_v2
; you can view the xarray structure here: https://labs-beta.waterdata.usgs.gov/api/xpublish/PRISM_v2/datasets/zarr-s3-osn/The Problem
When try to open with xarray like so:
I get the following error:
IndexError: The indexing operation you are attempting to perform is not valid on netCDF4.Variable object. Try loading your data into memory first by calling .load().
Thoughts
Seems like this might have something to do with the
tbnd
dimension (which is not a coordinate) and/or its associated variable,time_bnds
. Note that we don't see this issue when I just requestppt
variable, which has dimensions of lat/lon/time.As I understand it,
xpublish-opendap
reformats xarray datasets usingdap_xarray
to a compatible format to leverageopendap-protocol
. I'm wondering if there's something going on with some of these translations between data structures that might be causing this problem. Do you have any ideas of what might be going on here? Happy to help rig up a solve, but your understanding of these libraries would be super helpful to help me nail down the problem.The text was updated successfully, but these errors were encountered: