#[non_exhaustive]pub struct Field<'a> {
pub message: usize,
pub discipline: u8,
pub center: u16,
pub reference_time: ReferenceTime,
pub grid: Grid,
pub product: Product,
pub packing: Packing,
/* private fields */
}Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message: usizeThe message it is in, from 0.
discipline: u8The discipline (code table 0.0): 0 meteorological products.
center: u16The originating center (common code table C-11): 7 is NCEP.
reference_time: ReferenceTimeThe reference time.
grid: GridThe grid.
product: ProductWhat the field is.
packing: PackingHow it is packed.
Implementations§
Source§impl Field<'_>
impl Field<'_>
Sourcepub fn value(&self, index: u64) -> Result<Option<f64>, Grib2Error>
pub fn value(&self, index: u64) -> Result<Option<f64>, Grib2Error>
The value at grid point index (numbered as on Grid), or None where the field has
none there. A complex-packed field’s values can only be read in order, so this reads it
from its start up to the point, and a JPEG 2000 field’s image is decoded whole: for more
than a few points, use Field::values_at or Field::values, which read it once.
§Errors
Grib2Error::PointOutside when index is not below Field::points, and
Grib2Error::Malformed when a complex-packed field’s differences overflow or a JPEG
2000 codestream does not decode to the field’s values.
Sourcepub fn values_at(&self, indices: &[u64]) -> Result<Vec<Option<f64>>, Grib2Error>
pub fn values_at(&self, indices: &[u64]) -> Result<Vec<Option<f64>>, Grib2Error>
The values at several grid points, in the order asked, reading a complex-packed field once up to the last of them.
§Errors
As Field::value.
Sourcepub fn values(&self) -> Result<Vec<Option<f64>>, Grib2Error>
pub fn values(&self) -> Result<Vec<Option<f64>>, Grib2Error>
Every grid point’s value, in grid order; None where the field has none. It allocates 16
bytes a point, up to 256 MiB at MAX_POINTS, even for a field of 0 bits in a tiny file;
decoding a JPEG 2000 image takes more while it runs.
§Errors
Grib2Error::Malformed when a complex-packed field’s differences overflow or a JPEG
2000 codestream does not decode to the field’s values.