-
Notifications
You must be signed in to change notification settings - Fork 296
Description
🐛 Bug Report
When loading a polar stereographic netCDF file, Iris correctly interprets the "standard_parallel" attribute of the polar stereographic grid mapping variable, storing this in the "true_scale_lat" attribute of the PolarStereographic coordinate system (line 456 of iris/fileformats/_nc_load_rules/helpers.py).
But when saving such a cube to netCDF, Iris writes this value to an attribute of the grid mapping variable called "true_scale_lat", not "standard_parallel", as required by the CF convention (https://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#polar-stereographic).
This looks to be a defect in line 2150 of iris/fileformats/netcdf/saver.py, which reads:
cf_var_grid.true_scale_lat = cs.true_scale_lat
Where I would have expected:
cf_var_grid.standard_parallel = cs.true_scale_lat
The consequence is that the netCDF written by Iris is not CF-compliant, and cannot even be read back correctly by Iris due to the lack of the required "standard_parallel" or "scale_factor_at_projection_origin" grid mapping attributes, meaning that the cube ends up lacking horizontal coordinates or a coordinate system.
Happy to provide example data file and code to reproduce the bug, or any other information that might be useful.
Environment
- Iris Version: 3.3 or later (i.e. one with polar stereographic support)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status