We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.cf.formula_terms
With ROMS, here's what the parametric coordinates look like
double s_rho(s_rho) ; s_rho:long_name = "S-coordinate at RHO-points" ; s_rho:valid_min = -1. ; s_rho:valid_max = 0. ; s_rho:positive = "up" ; s_rho:standard_name = "ocean_s_coordinate_g2" ; s_rho:formula_terms = "s: s_rho C: Cs_r eta: zeta depth: h depth_c: hc" ; s_rho:field = "s_rho, scalar" ; double s_w(s_w) ; s_w:long_name = "S-coordinate at W-points" ; s_w:valid_min = -1. ; s_w:valid_max = 0. ; s_w:positive = "up" ; s_w:standard_name = "ocean_s_coordinate_g2" ; s_w:formula_terms = "s: s_w C: Cs_w eta: zeta depth: h depth_c: hc" ; s_w:field = "s_w, scalar" ;
I think the only way this makes sense is if we have
ds.cf.formula_terms = { "s_rho": {"s": ds["s_rho"], etc}, "s_w": {"s": ds["s_w"], etc.} }
Note we cannot use standard_name as keys because the standard name is the same for both s_w and s_rho.
standard_name
s_w
s_rho
For DataArrays we can also have
ds.s_rho.cf.formula_terms = { "s": ds["s_rho"], etc... }
We just need refactor the terms dictionary from here:
terms
cf-xarray/cf_xarray/accessor.py
Lines 1687 to 1704 in fd7e486
Note the apparently more permissive implementation for a DataArray here: https://github.com/NOAA-GFDL/MDTF-diagnostics/blob/70622b2fb9395de3a8ac3bc92c55c955e3d489b2/src/xr_parser.py#L264-L275
xref NOAA-GFDL/MDTF-diagnostics#186
The text was updated successfully, but these errors were encountered:
Add .cf.formula_terms
ca0f2a0
Closes xarray-contrib#211
Successfully merging a pull request may close this issue.
With ROMS, here's what the parametric coordinates look like
I think the only way this makes sense is if we have
Note we cannot use
standard_name
as keys because the standard name is the same for boths_w
ands_rho
.For DataArrays we can also have
We just need refactor the
terms
dictionary from here:cf-xarray/cf_xarray/accessor.py
Lines 1687 to 1704 in fd7e486
Note the apparently more permissive implementation for a DataArray here:
https://github.com/NOAA-GFDL/MDTF-diagnostics/blob/70622b2fb9395de3a8ac3bc92c55c955e3d489b2/src/xr_parser.py#L264-L275
xref NOAA-GFDL/MDTF-diagnostics#186
The text was updated successfully, but these errors were encountered: