pub enum Conversion {
Show 15 variants
Identity {
accepted_units: Option<Vec<String>>,
},
Celsius,
SoilTemperature,
PrecipitationRate,
PrecipitationAccumulation,
PascalToHectopascal,
MetreToKilometre,
MassRatioToGPerKg,
ProportionToPercent,
CloudCover,
DegreesTrue,
GeopotentialToMetres,
MassDensityToMicrograms,
PerSecondTo1e5,
CodeTable {
table: String,
},
}encoder only.Expand description
The unit rule of one variable: the arithmetic that takes a record’s
values to the variable’s unit, and the spellings a record may carry.
The semantics are in units.rs.
Variants§
Identity
Identity; acceptedUnits lists the spellings, no list accepts any.
Celsius
SoilTemperature
PrecipitationRate
PrecipitationAccumulation
PascalToHectopascal
MetreToKilometre
MassRatioToGPerKg
ProportionToPercent
CloudCover
DegreesTrue
GeopotentialToMetres
MassDensityToMicrograms
PerSecondTo1e5
CodeTable
Implementations§
Source§impl Conversion
impl Conversion
Sourcepub fn accepted_units(&self) -> Option<Vec<&str>>
pub fn accepted_units(&self) -> Option<Vec<&str>>
The compacted spellings the rule accepts a record under, or None
for a none rule that accepts any. A code-table rule also accepts
any spelling that contains its table or 0=no. Mirrors
rules.accepted_units.
Sourcepub fn accepts(&self, unit: &str) -> bool
pub fn accepts(&self, unit: &str) -> bool
Whether a record under unit is one this rule reads. Mirrors
rules.accepts.
Sourcepub fn expression(&self, unit: &str) -> Result<String>
pub fn expression(&self, unit: &str) -> Result<String>
The raster expression one record takes under unit: the rule’s
arithmetic alone, no clamp, in GDAL’s A spelling. The two
inspection paths (gdal.py, inspect.rs) compare it for identity;
nothing writes it. An error for a spelling the rule does not accept.
Mirrors rules.expression.
Sourcepub fn convert(&self, unit: &str, values: &mut [f64]) -> Result<()>
pub fn convert(&self, unit: &str, values: &mut [f64]) -> Result<()>
One plane’s values taken to the published unit, by the rule’s
arithmetic under unit, in place: one operation per value, in f64,
the operation rules.convert runs. A temperature’s unit is read
through temperature_unit, after the soil read-through for a soil
temperature; a direction is reduced modulo 360 so a record’s 360
lands on the codebook’s 0 (every value is non-negative there, so
this is numpy’s mod). A spelling the rule does not scale under
takes the identity, which is how a series already in the published
unit is left alone.
Trait Implementations§
Source§impl Clone for Conversion
impl Clone for Conversion
Source§impl Debug for Conversion
impl Debug for Conversion
Source§impl<'de> Deserialize<'de> for Conversion
impl<'de> Deserialize<'de> for Conversion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Conversion
impl PartialEq for Conversion
impl StructuralPartialEq for Conversion
Auto Trait Implementations§
impl Forget for Conversion
impl Freeze for Conversion
impl Move for Conversion
impl RefUnwindSafe for Conversion
impl Send for Conversionwhere
RawVecInner: Send,
impl Sync for Conversionwhere
RawVecInner: Sync,
impl Unpin for Conversion
impl UnsafeUnpin for Conversionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for Conversionwhere
RawVecInner: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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