Skip to content
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

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

DocOtak
Copy link
Contributor

@DocOtak DocOtak commented Dec 2, 2020

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 the long_name attribute

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'
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@DocOtak
Copy link
Contributor Author

DocOtak commented Dec 9, 2020

@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.

@gmaze gmaze self-requested a review December 10, 2020 07:52
@gmaze gmaze linked an issue Dec 10, 2020 that may be closed by this pull request
Copy link
Member

@gmaze gmaze left a 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

@gmaze gmaze merged commit 464ab42 into euroargodev:master Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TEOS-10 Accessor Improvement Suggestions
3 participants