You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to write files which have "degrees" units, input4mips-validation doesn't work in all cases. Specifically, any units like "degrees_north", "degrees_n", "degrees_east" will end up as "degrees" in the written file. The underlying cause is iris' units' sanitisation (SciTools/iris#6216), which makes sense for iris but isn't what we want here. The reason we hit this is that we go via iris to write netCDF files.
The proposed solution
One of two options:
Option 1: an automatic workaround, which puts the units back to what they were before writing the netCDF file to disk. Iris seems to be ok with updating units directly (via e.g. cube.units = "string"), even if the units aren't officially supported by udunits (like "degrees_south").
Option 2: raise a warning if we notice that the units have changed. The warning could suggest to users to either a) change their units or b) use the pattern of getting the cubes, then updating the cubes themselves, then writing (which is what I did for the MAC files, see
The motivation
If you want to write files which have "degrees" units, input4mips-validation doesn't work in all cases. Specifically, any units like "degrees_north", "degrees_n", "degrees_east" will end up as "degrees" in the written file. The underlying cause is iris' units' sanitisation (SciTools/iris#6216), which makes sense for iris but isn't what we want here. The reason we hit this is that we go via iris to write netCDF files.
The proposed solution
One of two options:
Option 1: an automatic workaround, which puts the units back to what they were before writing the netCDF file to disk. Iris seems to be ok with updating units directly (via e.g.
cube.units = "string"
), even if the units aren't officially supported by udunits (like "degrees_south").Option 2: raise a warning if we notice that the units have changed. The warning could suggest to users to either a) change their units or b) use the pattern of getting the cubes, then updating the cubes themselves, then writing (which is what I did for the MAC files, see
input4mips_validation/scripts/add-input4mips-info-to-mac.py
Line 252 in 9f3462c
Alternatives
Additional context
Re-riting of MAC files: https://github.com/climate-resource/input4mips_validation/blob/9f3462c77ebce974e2df02fbe5e45cf4f064c07a/scripts/add-input4mips-info-to-mac.py
The text was updated successfully, but these errors were encountered: