pub struct GridInfo {
pub width: usize,
pub height: usize,
pub first_longitude: f64,
pub first_latitude: f64,
pub longitude_step: f64,
pub latitude_step: f64,
pub column_roll: usize,
pub crop: Option<CropWindow>,
pub downsample: Option<BlockReduction>,
pub projection: Option<ProjectedGrid>,
pub gaussian: Option<GaussianRows>,
}encoder only.Fields§
§width: usize§height: usize§first_longitude: f64§first_latitude: f64§longitude_step: f64§latitude_step: f64§column_roll: usizeColumns every extracted plane is rolled right by, so grids GDAL leaves starting at Greenwich (the sflux Gaussian grid) come out in the same -180-first layout as every other source. 0 for grids GDAL already rotates.
crop: Option<CropWindow>Regional window applied after the roll (showcase cases). When set, every field above describes the cropped planes, and the window carries the source dimensions the extraction actually reads. Never serialized: the cropped origin and extent already say where the data is.
downsample: Option<BlockReduction>Set for a source published coarser than it arrives (MRMS): the extracted planes are the source grid, and every field above describes the thinned grid their block maxima land on, before any crop. Never serialized either.
projection: Option<ProjectedGrid>Set on a grid on a map projection (GridInfo::projected), which has
none of the regular fields: this says where its cells are, and a window’s
or a tier’s is that window’s or tier’s own.
gaussian: Option<GaussianRows>Set on a regular Gaussian grid, beside the regular fields every other number here still comes from.
Implementations§
Source§impl GridInfo
impl GridInfo
pub fn new( width: usize, height: usize, first_longitude: f64, first_latitude: f64, longitude_step: f64, latitude_step: f64, ) -> Self
Sourcepub fn projected(projection: ProjectedGrid, crop: Option<CropWindow>) -> Self
pub fn projected(projection: ProjectedGrid, crop: Option<CropWindow>) -> Self
The grid a projected file’s planes are published on. Its regular fields are NaN, so arithmetic on them cannot pass for a place.
pub fn wraps(&self) -> bool
Sourcepub fn source_shape(&self) -> (usize, usize)
pub fn source_shape(&self) -> (usize, usize)
(height, width) of the plane the extraction reads.
Sourcepub fn decimated(&self) -> Self
pub fn decimated(&self) -> Self
The grid produced by keeping every second row and column. For the 721-row production grid the last kept row still lands exactly on the south pole, and 720 columns at a doubled step still cover 360 degrees. A projected grid’s first cell stays where it is at twice the spacing, and a Gaussian grid’s rows are every second one of those it had.
Sourcepub fn downsampled(&self, factor: usize, path: &Path) -> Result<Self>
pub fn downsampled(&self, factor: usize, path: &Path) -> Result<Self>
The grid a source’s block reduction publishes — the port of
downsample_grid in xuebuild/grid.py: one cell per
factor x factor block, centered on the block (half a source step
in per extra cell, rounded to ten decimals the way a crop’s origin
is), at factor times the step. The source must divide into whole
blocks, and a global or rolled grid is not thinned.
pub fn metadata(&self) -> Map<String, Value>
Trait Implementations§
Auto Trait Implementations§
impl Forget for GridInfo
impl Freeze for GridInfo
impl Move for GridInfo
impl RefUnwindSafe for GridInfo
impl Send for GridInfo
impl Sync for GridInfo
impl Unpin for GridInfo
impl UnsafeUnpin for GridInfo
impl UnwindSafe for GridInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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