Skip to content

Allow exemptions to coordinate axis guessing on save #5003

@bayliffe

Description

@bayliffe

Within the iris NetCDF saver there is a call to guess_coord_axis. This simple utility relies on coordinate names, units, or other attributes to ascribe an axis identifier to each dimension coordinate where possible. One of these guesses checks whether the units of the coordinate are convertible to hectopascals, and if so presumes the dimension is a pressure coordinate corresponding to vertical levels; an axis identifier of Z is added.

Working with probabilistic data in which a dimension coordinate may describe different pressure thresholds, i.e. probability of pressure at mean sea level exceeding 1000hPa, 1010hPa, 1020hPa etc. this results in the threshold coordinate being identified as a vertical spatial dimension with an axis identifier of Z. This is undesirable and causes issues downstream of where the data is created (e.g. in Visual Weather). As this is added on save it is not possible to remove the attribute without using an alternative tool to Iris.

This issue requests that there be a means within Iris of preventing the axis identifiers being added to specific named (or var named) coordinates on save.

Example cube

Below is shown a simple print out of a probabilistic PMSL forecast with a threshold coordinate named air_pressure_at_sea_level that has units of Pa, which is not a height coordinate, but which is assigned a Z axis identifier.

probability_of_air_pressure_at_sea_level_above_threshold / (1) (air_pressure_at_sea_level: 85; projection_y_coordinate: 970; projection_x_coordinate: 1042)
     Dimension coordinates:
          air_pressure_at_sea_level                                                      x                            -                             -
          projection_y_coordinate                                                        -                            x                             -
          projection_x_coordinate                                                        -                            -                             x
     Scalar coordinates:
          ...

ncdump header information corresponding to this coordinate:

float threshold(threshold) ;
	threshold:axis = "Z" ;
	threshold:units = "Pa" ;
	threshold:standard_name = "air_pressure_at_sea_level" ;

Metadata

Metadata

Type

No type

Projects

Status

💰 Finished

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions