You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to do this: col.search(model='CFSv2', variable='prate').to_xarray(decode_times=False)
But I got the error:
ValueError: some chunks keys are not dimensions on this object: {'time'}
When I tried looking at the docstring, I couldn't find anything that mentioned how to change the time coordinate.
Signature: cat.to_xarray(**kwargs)
Docstring:
Return dataset as an xarray dataset
Additional keyword arguments are passed through to methods in aggregate.py
I had to look at source.py to see the available kwargs:
if 'decode_times' not in _kwargs:
_kwargs.update(decode_times=True)
if 'compat' not in _kwargs:
_kwargs.update(compat='no_conflicts')
if 'time_coord_name' not in _kwargs:
_kwargs.update(time_coord_name='time')
if 'ensemble_dim_name' not in _kwargs:
_kwargs.update(ensemble_dim_name='member_id')
if 'chunks' not in _kwargs:
_kwargs.update(chunks={_kwargs['time_coord_name']: 'auto'})
if 'override_coords' not in _kwargs:
_kwargs.update(override_coords=False)
if 'join' not in _kwargs:
_kwargs.update(join='outer')
if 'preprocess' not in _kwargs:
_kwargs.update(preprocess=None)
if 'merge_exp' not in _kwargs:
_kwargs.update(merge_exp=True)
And finally, I got it to work: col.search(model='CFSv2', variable='prate').to_xarray(decode_times=False, time_coord_name='target')
So I guess it'd be easier for people if the to_xarray method showed something like (or more detailed):
Signature: cat.to_xarray(**kwargs)
Docstring:
Return dataset as an xarray dataset
Valid kwargs: decode_times, compat, ... etc
Additional keyword arguments are passed through to methods in aggregate.py
The text was updated successfully, but these errors were encountered:
Following the example in #137
I was trying to do this:
col.search(model='CFSv2', variable='prate').to_xarray(decode_times=False)
But I got the error:
When I tried looking at the docstring, I couldn't find anything that mentioned how to change the time coordinate.
I had to look at
source.py
to see the available kwargs:And finally, I got it to work:
col.search(model='CFSv2', variable='prate').to_xarray(decode_times=False, time_coord_name='target')
So I guess it'd be easier for people if the
to_xarray
method showed something like (or more detailed):The text was updated successfully, but these errors were encountered: