-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use CF Standard Names for standard_name attribute #74
Conversation
SA.attrs['unit'] = 'g/kg' | ||
that.append(SA) | ||
|
||
if 'CT' in vlist: | ||
CT = xr.DataArray(ct, coords=this['TEMP'].coords, name='CT') | ||
CT.attrs['standard_name'] = 'Conservative Temperature' | ||
CT.attrs['long_name'] = 'Conservative Temperature' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for preserving these as long names, it will reduce breakages in case people are relying on those names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As much as the various data standards "recommend against it" I think most people rely on the variable name itself (in this case it's CT
) rather than things in attributes. I'd like to get some doc string things added before this is merged mainly defining all the options for vlist
.
I'll also note the potentially breaking change in the docs themselves.
@gmaze I think this is ready for you to look at, if there are to be changes to how PV/IPV is calculated or variable names changing, it's perhaps best to deal with those in a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @DocOtak for this contribution to argopy !
To recap, this #74 addresses the following points:
- using proper CF standard name
- rename undocumented CF standard name into long name attributes
- improve docstrings
- document changes in the whats-new doc section
- update unit testing (not necessary here)
since tests are passing, I will merge this PR !
cheers
g
In the xarray accessor calculating teos10 params, this will set the
standard_name
attribute of the created variable to the correct name from the CF Standard Name table if one exists.Currently the "Squared buoyancy frequency" lacks a standard name.
The possible standard name for "Planetary Potential Vorticity" is potential_vorticity_of_ocean_layer, but this is way outside my knowledge.
This PR moves the existing
standard_name
to thelong_name
attribute