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:
-
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));
-
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.
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:
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));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.