Skip to content

Add parameter unit information #152

@JulesFleuren

Description

@JulesFleuren

Motivation

Currently, (as far as I could find) there is no way to get the unit of a parameter. Although they can be found in the GRIB2 documentation, it would be convenient to also be able to get them with a built-in method.

Proposed Solution

The unit is obtainable in string form, containing the SI symbol of the unit. Two proposed solutions:

  1. Make a method similar to the method for obtaining parameter names. For example, something like
    let unit = CodeTableUnits4_2::new(discipline, category).lookup(usize::from(parameter));

  2. Include the unit in the parameter name. For example, something like:
    "Temperature [K]" instead of "Temperature"

Additional Context

I used this: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-2.shtml as a reference for the units.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions