pub struct SatelliteImage {
pub bands: Vec<Vec<f64>>,
pub band_names: Vec<String>,
}Expand description
Multi-spectral satellite image with named bands.
Fields§
§bands: Vec<Vec<f64>>Flattened (row-major) pixel values per band.
band_names: Vec<String>Human-readable names for each band (e.g. "red", "nir").
Implementations§
Source§impl SatelliteImage
impl SatelliteImage
Sourcepub fn new(bands: Vec<Vec<f64>>, band_names: Vec<String>) -> Self
pub fn new(bands: Vec<Vec<f64>>, band_names: Vec<String>) -> Self
Construct a SatelliteImage from per-band pixel data and band names.
Sourcepub fn band_index(&self, name: &str) -> Option<usize>
pub fn band_index(&self, name: &str) -> Option<usize>
Return the index of the band with the given name, if present.
Sourcepub fn ndvi(&self) -> Vec<f64>
pub fn ndvi(&self) -> Vec<f64>
Compute the Normalized Difference Vegetation Index (NDVI).
Requires bands named "nir" and "red". Returns a vector of per-pixel
NDVI values in [-1, 1].
Trait Implementations§
Source§impl Clone for SatelliteImage
impl Clone for SatelliteImage
Source§fn clone(&self) -> SatelliteImage
fn clone(&self) -> SatelliteImage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SatelliteImage
impl RefUnwindSafe for SatelliteImage
impl Send for SatelliteImage
impl Sync for SatelliteImage
impl Unpin for SatelliteImage
impl UnsafeUnpin for SatelliteImage
impl UnwindSafe for SatelliteImage
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.