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

iris standard names #30

Open
DamienIrving opened this issue May 9, 2016 · 0 comments
Open

iris standard names #30

DamienIrving opened this issue May 9, 2016 · 0 comments

Comments

@DamienIrving
Copy link
Owner

When reading/writing an iris cube, you must use a CF compliant standard name.

To get around this problem when writing cubes to file, you can add your preferred standard name to the list iris stores:

iris.std_names.STD_NAMES[standard_name] = {'canonical_units': units}

When reading cubes you can simply pass it the long_name instead (which it tries if the standard_name fails), which might involve a try / except block that catches the ConstraintMismatchError. Interestingly, when iris loads the file the resulting cube will not have a "standard_name = your_variable" attribute. The loaded cubes will instead have an attribute "invalid_standard_name = your_variable".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant