>>> from cf_xarray.datasets import romsds
>>> romsds.cf.decode_vertical_coords(outnames={'s_rho': 'z_rho'}) # adds new z_rho variable
Traceback (most recent call last):
File "<python-input-0>", line 2, in <module>
romsds.cf.decode_vertical_coords(outnames={'s_rho': 'z_rho'}) # adds new z_rho variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/knutfd/micromamba/envs/opendrift/lib/python3.13/site-packages/cf_xarray/accessor.py", line 3110, in decode_vertical_coords
ds.coords[zname] = transform.from_terms(terms).decode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/knutfd/micromamba/envs/opendrift/lib/python3.13/site-packages/cf_xarray/parametric.py", line 636, in decode
return z.assign_attrs(standard_name=self.computed_standard_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/knutfd/micromamba/envs/opendrift/lib/python3.13/site-packages/cf_xarray/parametric.py", line 641, in computed_standard_name
return _derive_ocean_stdname(eta=self.eta.attrs, depth=self.depth.attrs)
File "/home/knutfd/micromamba/envs/opendrift/lib/python3.13/site-packages/cf_xarray/parametric.py", line 81, in _derive_ocean_stdname
raise ValueError(
f"The standard name for the {x!r} variable is not available."
) from None
ValueError: The standard name for the 'depth' variable is not available.
Hi,
I am not able to get
decode_vertical_coordsto work, and it also fails in the documentation:https://cf-xarray.readthedocs.io/en/stable/parametricz.html#decoding-parametric-coordinates
Is something missing in the dataset or in the code?