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

Variable not found #324

Open
ashjbarnes opened this issue Jun 7, 2023 · 5 comments
Open

Variable not found #324

ashjbarnes opened this issue Jun 7, 2023 · 5 comments

Comments

@ashjbarnes
Copy link

Trying to access fields 'u' and 'v' from 01deg_jra55v13_ryf9091. cc.explore.DatabaseExplorer finds says that they exist, gives me the query to try and then running the query says the variable wasn't found

cc.querying.getvar(expt='01deg_jra55v13_ryf9091', variable='v', 
                          session=session, frequency='1 daily',
                          attrs={'cell_methods': 'time: mean'})

image

@angus-g
Copy link
Collaborator

angus-g commented Jun 7, 2023

The query you posted and the one you ran are different: where you got the error you have a date constraint. Are you sure that's valid for the data, and not falling outside the interval where that variable exists?

@ashjbarnes
Copy link
Author

Yeah I ran both with and without date constraint. Without the date constraint (i.e, asking for all the dates) gave the same error

@angus-g
Copy link
Collaborator

angus-g commented Jun 7, 2023

I'm not able to reproduce this; asking for the full segment gets me

ValueError: Resulting object does not have monotonic global indexes along dimension time

As noted by Ellie on the Hive. Has the cookbook worked for you for other variables? Are all your storage flags, etc. set up correctly?

@ashjbarnes
Copy link
Author

ashjbarnes commented Jun 7, 2023

I'm able to access the data in the notebook via xr.open_dataset just fine, and when querying the variables cookbook gives them to me (u and v are listed below)

image

Trying to get average_DT gives the same error.

I'm pretty new to using the cookbook. I've just been following the tutorial notebook

image

I also tried fiddling with the start and end times with no luck

@angus-g
Copy link
Collaborator

angus-g commented Jun 7, 2023

As mentioned from the linked post:

In the RYF run, the model description says daily data is only available for 1 Jan 1950 to 31 Dec 1969 and 1 Jan 2086 to 31 Dec 2100

For me, I can get some of the data from the valid period:

>>> cc.querying.getvar('01deg_jra55v13_ryf9091', 'v', s, frequency='1 daily', attrs={'cell_methods': 'time: mean'}, start_time='2086', end_time='2087')
<xarray.DataArray 'v' (time: 365, st_ocean: 75, yu_ocean: 2700, xu_ocean: 3600)>
dask.array<concatenate, shape=(365, 75, 2700, 3600), dtype=float32, chunksize=(1, 7, 300, 400), chunktype=numpy.ndarray>
...

In the get_variables output, average_DT doesn't have any cell_methods, so your query for that is too specific. In general, you probably don't even need to filter by attributes unless you're running into an ambiguous query. Also, the following line should've thrown an error since it's an incorrect call to getvar():

data = cc.querying.getvar(session, experiment='01deg_jra55v13', frequency='1 daily')

I think it might be clearer if you produce and upload a notebook that demonstrates exactly what you're trying, in order from top to bottom, to narrow down any possible mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants