Skip to content

Fix to automatic deriving of units when saving in netcdf format#1943

Merged
marqh merged 1 commit intoSciTools:masterfrom
djkirkham:bugfix-EPM-1131-netcdf-unit-saving
Feb 19, 2016
Merged

Fix to automatic deriving of units when saving in netcdf format#1943
marqh merged 1 commit intoSciTools:masterfrom
djkirkham:bugfix-EPM-1131-netcdf-unit-saving

Conversation

@djkirkham
Copy link
Contributor

Make coords with standard name 'latitude' and 'longitude' which have no coordsystem to be saved with units 'degree_north' and 'degree_east' respectively in netcdf files. Remove other unsafe unit changes.

Change some unit test expected output to recognise these changes.

@marqh
Copy link
Member

marqh commented Feb 18, 2016

please add a what's new contribution for this change

# TODO: Use #61 to get the units.
if isinstance(coord.coord_system, iris.coord_systems.GeogCS):
if "latitude" in coord.standard_name:
if ((isinstance(coord.coord_system, iris.coord_systems.GeogCS) or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps an in-line comment here would help a little. I would suggest

Set the 'units' of 'latitude' and 'longitude' coordinates specified in 'degrees' to 'degrees_north' and 'degrees_east' respectively, as defined in the CF conventions for netCDF files: sections 4.1 and 4.2.

@marqh
Copy link
Member

marqh commented Feb 18, 2016

looking good @djkirkham I think this is ready to be adopted

please may you squish the commits?

… or 'degree_north' in netcdf files. Remove other unsafe unit changes
@djkirkham djkirkham force-pushed the bugfix-EPM-1131-netcdf-unit-saving branch from a8adac8 to 4460482 Compare February 18, 2016 17:05
@marqh
Copy link
Member

marqh commented Feb 19, 2016

excellent, thanks @djkirkham

marqh added a commit that referenced this pull request Feb 19, 2016
…aving

Fix to automatic deriving of units when saving in netcdf format
@marqh marqh merged commit dae72fd into SciTools:master Feb 19, 2016
@QuLogic QuLogic added this to the v1.10 milestone Feb 19, 2016
@djkirkham djkirkham deleted the bugfix-EPM-1131-netcdf-unit-saving branch October 26, 2017 13:01
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.

3 participants