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
For a future project, I wanted to use surface velocities from the ECCO data portal (to avoid egress charges). They are available as part of the regional data released here. The data is "shrunk" so it probably makes sense to use existing llcreader code to unshrink it.
I downloaded a single time slice of SSU and SSV and so far my code looks like this:
from xmitgcm import llcreader
from fsspec.implementations.local import LocalFileSystem
fs = LocalFileSystem()
store = llcreader.BaseStore(fs, base_path='/swot/SUM01/spencer/LLCsurf')
model = llcreader.LLC4320Model(store)
ds_faces = model.get_dataset(varnames=['SSU'])
However, xmitgcm isn't aware that SSU is a possible variable name, so I get an error:
KeyError Traceback (most recent call last)
<ipython-input-7-86109449e317> in <module>
----> 1 ds_faces = model.get_dataset(varnames=['SSU'])
~/.conda/envs/pangeo1/lib/python3.9/site-packages/xmitgcm/llcreader/llcmodel.py in get_dataset(self, varnames, iter_start, iter_stop, iter_step, iters, k_levels, k_chunksize, type, read_grid, grid_vars_to_coords)
897
898 # get the data in facet form
--> 899 data_facets = {vname:
900 self._get_facet_data(vname, iters, k_levels, k_chunksize)
901 for vname in varnames}
~/.conda/envs/pangeo1/lib/python3.9/site-packages/xmitgcm/llcreader/llcmodel.py in <dictcomp>(.0)
898 # get the data in facet form
899 data_facets = {vname:
--> 900 self._get_facet_data(vname, iters, k_levels, k_chunksize)
901 for vname in varnames}
902
~/.conda/envs/pangeo1/lib/python3.9/site-packages/xmitgcm/llcreader/llcmodel.py in _get_facet_data(self, varname, iters, klevels, k_chunksize)
741 def _get_facet_data(self, varname, iters, klevels, k_chunksize):
742 # needs facets to be outer index of nested lists
--> 743 dims = _VAR_METADATA[varname]['dims']
744
745 if len(dims)==2:
KeyError: 'SSU'
Would I need to add SSU, SSV etc. to the package as variable names in order to open this data? Or is there something deeper I am missing here?
If it's truly a regional setup without the 13 faces, then other attributes like nface may have to change, and it could get hairy (I'm not totally sure ...)
For a future project, I wanted to use surface velocities from the ECCO data portal (to avoid egress charges). They are available as part of the regional data released here. The data is "shrunk" so it probably makes sense to use existing llcreader code to unshrink it.
I downloaded a single time slice of SSU and SSV and so far my code looks like this:
However, xmitgcm isn't aware that SSU is a possible variable name, so I get an error:
Would I need to add SSU, SSV etc. to the package as variable names in order to open this data? Or is there something deeper I am missing here?
(this issue is related to #253 I think)
cc @dhruvbalwada
The text was updated successfully, but these errors were encountered: