Skip to content

Decide what to do about standard name modifiers units #3408

@lbdreyer

Description

@lbdreyer

In #3393 we included support for standard name modifiers. However, that PR, for simplicity, did not include in any special handling of the units.

In the CF Conventions Appendix C it lists the accepted Standard Name modifiers including the associated units.

Standard name modifier unit
detection minimum u
number_of_observations 1
standard_error u
status_flag

u means that the unit it is equivalent to the unit of the unmodified standard_name (e.g. northward_wind has units of m s-1 so northward_wind standard_error would also have units of m s-1).

Note only status_flag and number_of_observations have specified units. Also note that both these are deprecated (See this trac ticket), although only the deprecation of status_flag appears in the actual documentation. I think number_of_observations has been missed off?

The question is how to handle the units?
Should we enforce the behaviour such that if someone renames the cube from
air_temperature -> air_temperature number_of_observations
that it would also change the units?

I'm concerned this may trip some people up:
Currently with standard_name, if some renames the cube, it doesn't have any impact on the units. Below we take a wind cube and rename the cube to air_temperature but the units stay as m s-1 rather than converting to the canonical units of air_temperature

>>> c
<iris 'Cube' of northward_wind / (m s-1) (-- : 1)>
>>> c.rename('air_temperature')
>>> c
<iris 'Cube' of air_temperature / (m s-1) (-- : 1)>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions