pub struct LinearCodebook {
pub minimum: f64,
pub maximum: f64,
pub step: f64,
pub nodata_code: u16,
pub name: String,
}Available on crate feature
encoder only.Expand description
Linear codebook, uint8 unless its nodata code needs sixteen bits. Not temperature-specific: it quantizes any linear field; the wind components reuse it with a symmetric m/s range.
Fields§
§minimum: f64§maximum: f64minimum + maximum_code × step, the top of the clamp.
step: f64§nodata_code: u16§name: StringThe variable’s id, for the error a non-finite plane raises.
Implementations§
Source§impl LinearCodebook
impl LinearCodebook
pub fn maximum_code(&self) -> u16
pub fn quantize(&self, values: &[f64], codes: &mut [u8]) -> Result<()>
Sourcepub fn quantize_wide(&self, values: &[f64], codes: &mut [u16]) -> Result<()>
pub fn quantize_wide(&self, values: &[f64], codes: &mut [u16]) -> Result<()>
Sixteen-bit codes: the arithmetic of quantize,
rounding and clamp included, with the wider cast the reference’s
code_dtype picks for a nodata code above 255.
pub fn decode(&self, code: u8) -> f64
pub fn decode_wide(&self, code: u16) -> f64
Trait Implementations§
Source§impl Clone for LinearCodebook
impl Clone for LinearCodebook
Auto Trait Implementations§
impl Forget for LinearCodebook
impl Freeze for LinearCodebook
impl Move for LinearCodebook
impl RefUnwindSafe for LinearCodebook
impl Send for LinearCodebookwhere
RawVecInner: Send,
impl Sync for LinearCodebookwhere
RawVecInner: Sync,
impl Unpin for LinearCodebook
impl UnsafeUnpin for LinearCodebook
impl UnwindSafe for LinearCodebookwhere
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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