Skip to main content

GridInfo

Struct GridInfo 

Source
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>,
}
Available on crate feature encoder only.

Fields§

§width: usize§height: usize§first_longitude: f64§first_latitude: f64§longitude_step: f64§latitude_step: f64§column_roll: usize

Columns 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

Source

pub fn new( width: usize, height: usize, first_longitude: f64, first_latitude: f64, longitude_step: f64, latitude_step: f64, ) -> Self

Source

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.

Source

pub fn wraps(&self) -> bool

Source

pub fn source_shape(&self) -> (usize, usize)

(height, width) of the plane the extraction reads.

Source

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.

Source

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.

Source

pub fn metadata(&self) -> Map<String, Value>

Trait Implementations§

Source§

impl Clone for GridInfo

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GridInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.