iris_grib.grib_phenom_translation

In this module:

  • grib1_phenom_to_cf_info

  • grib2_phenom_to_cf_info

  • cf_phenom_to_grib2_info

  • GRIBCode

Provide grib 1 and 2 phenomenon translations to + from CF terms.

This is done by wrapping ‘_grib_cf_map.py’, which is in a format provided by the metadata translation project.

Currently supports only these ones:

  • grib1 –> cf

  • grib2 –> cf

  • cf –> grib2

iris_grib.grib_phenom_translation.grib1_phenom_to_cf_info(table2_version, centre_number, param_number)

Lookup grib-1 parameter –> cf_data or None.

Returned cf_data has attributes:

  • standard_name

  • long_name

  • units : a cf_units.Unit

  • set_height : a scalar ‘height’ value , or None

iris_grib.grib_phenom_translation.grib2_phenom_to_cf_info(param_discipline, param_category, param_number)

Lookup grib-2 parameter –> cf_data or None.

Returned cf_data has attributes:

  • standard_name

  • long_name

  • units : a cf_units.Unit

iris_grib.grib_phenom_translation.cf_phenom_to_grib2_info(standard_name, long_name=None)

Lookup CF names –> grib2_data or None.

Returned grib2_data has attributes:

  • discipline

  • category

  • number

  • unitsa cf_units.Unit

    The unit represents the defined reference units for the message data.

class iris_grib.grib_phenom_translation.GRIBCode(edition_or_string, discipline=None, category=None, number=None)

An object representing a specific Grib phenomenon identity.

Basically a namedtuple of (edition, discipline, category, number).

Also provides a string representation, and supports creation from: another similar object; a tuple of numbers; or any string with 4 separate decimal numbers in it.