pub struct Message<'a> { /* private fields */ }Expand description
A single logical GRIB field.
Implementations§
Source§impl<'a> Message<'a>
impl<'a> Message<'a>
pub fn edition(&self) -> u8
pub fn index(&self) -> usize
pub fn metadata(&self) -> &MessageMetadata
pub fn reference_time(&self) -> &ReferenceTime
pub fn parameter(&self) -> &Parameter
pub fn center_id(&self) -> u16
pub fn subcenter_id(&self) -> u16
pub fn identification(&self) -> Option<&Identification>
pub fn product_definition(&self) -> Option<&ProductDefinition>
pub fn grib1_product_definition(&self) -> Option<&ProductDefinition>
Sourcepub fn local_use_section(&self) -> Option<&'a [u8]>
pub fn local_use_section(&self) -> Option<&'a [u8]>
Returns the complete encoded GRIB2 Section 2, including its five-byte length and section-number header, when present for this field.
pub fn grid_definition(&self) -> &GridDefinition
pub fn parameter_name(&self) -> &str
pub fn parameter_description(&self) -> &str
pub fn forecast_time_unit(&self) -> Option<u8>
pub fn forecast_time_unit_kind(&self) -> Option<ForecastTimeUnit>
Sourcepub fn forecast_time(&self) -> Option<i64>
pub fn forecast_time(&self) -> Option<i64>
Forecast offset in the units returned by Message::forecast_time_unit.
GRIB2 offsets are signed; GRIB1 offsets are widened to the same type.
pub fn valid_time(&self) -> Option<ReferenceTime>
pub fn grid_shape(&self) -> (usize, usize)
pub fn latitudes(&self) -> Result<Option<Vec<f64>>>
pub fn longitudes(&self) -> Result<Option<Vec<f64>>>
Sourcepub fn rotated_latitudes(&self) -> Result<Option<Vec<f64>>>
pub fn rotated_latitudes(&self) -> Result<Option<Vec<f64>>>
Latitude axis in the rotated coordinate system for Template 3.1.
Sourcepub fn rotated_longitudes(&self) -> Result<Option<Vec<f64>>>
pub fn rotated_longitudes(&self) -> Result<Option<Vec<f64>>>
Longitude axis in the rotated coordinate system for Template 3.1.
pub fn projected_x_coordinates(&self) -> Result<Option<Vec<f64>>>
pub fn projected_y_coordinates(&self) -> Result<Option<Vec<f64>>>
Sourcepub fn decode_into<T: DecodeSample>(&self, out: &mut [T]) -> Result<()>
pub fn decode_into<T: DecodeSample>(&self, out: &mut [T]) -> Result<()>
Decodes into row-major reader order.
Alternating scan rows are normalized, but the GRIB i/j scan directions
are preserved. Use Message::decode_into_north_up when deterministic
+i columns and -j rows are required.
Bitmap omissions and embedded complex-packing missing codes are written
as NaN; substitute metadata is not applied automatically.
Sourcepub fn decode_into_north_up<T: DecodeSample>(&self, out: &mut [T]) -> Result<()>
pub fn decode_into_north_up<T: DecodeSample>(&self, out: &mut [T]) -> Result<()>
Decodes into deterministic row-major orientation: +i columns and -j rows (north-to-south for conventional geographic grids).
Bitmap omissions and embedded complex-packing missing codes are written
as NaN; substitute metadata is not applied automatically.
Sourcepub fn read_flat_data_as_f64(&self) -> Result<Vec<f64>>
pub fn read_flat_data_as_f64(&self) -> Result<Vec<f64>>
Returns a flat f64 field in row-major reader order.
Alternating rows are normalized, while encoded i/j directions are
preserved. Use Message::read_flat_data_north_up_as_f64 for +i
columns and -j rows.
Sourcepub fn read_flat_data_as_f32(&self) -> Result<Vec<f32>>
pub fn read_flat_data_as_f32(&self) -> Result<Vec<f32>>
Returns a flat f32 field in row-major reader order.
Alternating rows are normalized, while encoded i/j directions are
preserved. Use Message::read_flat_data_north_up_as_f32 for +i
columns and -j rows.
Sourcepub fn read_flat_data_north_up_as_f64(&self) -> Result<Vec<f64>>
pub fn read_flat_data_north_up_as_f64(&self) -> Result<Vec<f64>>
Returns a flat f64 field with +i columns and -j rows.
Sourcepub fn read_flat_data_north_up_as_f32(&self) -> Result<Vec<f32>>
pub fn read_flat_data_north_up_as_f32(&self) -> Result<Vec<f32>>
Returns a flat f32 field with +i columns and -j rows.
Sourcepub fn read_data_as_f64(&self) -> Result<ArrayD<f64>>
pub fn read_data_as_f64(&self) -> Result<ArrayD<f64>>
Returns an f64 ndarray in row-major reader order.
Alternating rows are normalized, while encoded i/j directions are
preserved. Use Message::read_data_north_up_as_f64 for deterministic
+i columns and -j rows.
Sourcepub fn read_data_as_f32(&self) -> Result<ArrayD<f32>>
pub fn read_data_as_f32(&self) -> Result<ArrayD<f32>>
Returns an f32 ndarray in row-major reader order.
Alternating rows are normalized, while encoded i/j directions are
preserved. Use Message::read_data_north_up_as_f32 for deterministic
+i columns and -j rows.
Sourcepub fn read_data_north_up_as_f64(&self) -> Result<ArrayD<f64>>
pub fn read_data_north_up_as_f64(&self) -> Result<ArrayD<f64>>
Returns an f64 ndarray with +i columns and -j rows.
Sourcepub fn read_data_north_up_as_f32(&self) -> Result<ArrayD<f32>>
pub fn read_data_north_up_as_f32(&self) -> Result<ArrayD<f32>>
Returns an f32 ndarray with +i columns and -j rows.
pub fn raw_bytes(&self) -> &[u8] ⓘ
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Message<'a>
impl<'a> Freeze for Message<'a>
impl<'a> RefUnwindSafe for Message<'a>
impl<'a> Send for Message<'a>
impl<'a> Sync for Message<'a>
impl<'a> Unpin for Message<'a>
impl<'a> UnsafeUnpin for Message<'a>
impl<'a> UnwindSafe for Message<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more