pub struct Parameter {
pub discipline: u8,
pub centre: u16,
pub master_ver: u8,
pub local_ver: u8,
pub category: u8,
pub num: u8,
}
Expand description
Parameter of the product.
In the context of GRIB products, parameters refer to weather elements such as air temperature, air pressure, and humidity, and other physical quantities.
With is_identical_to
, users can check if the parameter is identical to a
third-party code, such as NCEP
.
Fields§
§discipline: u8
Discipline of processed data in the GRIB message.
centre: u16
GRIB master tables version number.
master_ver: u8
Parameter category by product discipline.
local_ver: u8
GRIB local tables version number.
category: u8
Identification of originating/generating centre.
num: u8
Parameter number by product discipline and parameter category.
Implementations§
source§impl Parameter
impl Parameter
sourcepub fn description(&self) -> Option<String>
pub fn description(&self) -> Option<String>
Looks up the parameter’s WMO description.
§Examples
// Extracted from the first submessage of JMA MSM GRIB2 data.
let param = grib::Parameter {
discipline: 0,
centre: 34,
master_ver: 2,
local_ver: 1,
category: 3,
num: 5,
};
assert_eq!(param.description(), Some("Geopotential height".to_owned()))
sourcepub fn is_identical_to<'a, T>(&'a self, code: T) -> bool
pub fn is_identical_to<'a, T>(&'a self, code: T) -> bool
Checks if the parameter is identical to a third-party code
, such as
NCEP
.
§Examples
use grib::codetables::NCEP;
// Extracted from the first submessage of JMA MSM GRIB2 data.
let param = grib::Parameter {
discipline: 0,
centre: 34,
master_ver: 2,
local_ver: 1,
category: 3,
num: 5,
};
assert!(param.is_identical_to(NCEP::HGT));
Trait Implementations§
source§impl PartialEq for Parameter
impl PartialEq for Parameter
impl Eq for Parameter
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnwindSafe for Parameter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more