[−][src]Struct netcdf::variable::Variable
This struct defines a netCDF variable.
Fields
name: String
The variable name
attributes: HashMap<String, Attribute>
dimensions: Vec<Dimension>
vartype: i32
the netcdf variable type identifier (from netcdf-sys)
id: i32
len: u64
total length; the product of all dim lengths
grp_id: i32
Methods
impl Variable
[src]
impl Variable
pub fn get_char(&self, cast: bool) -> Result<Vec<u8>, String>
[src]
pub fn get_char(&self, cast: bool) -> Result<Vec<u8>, String>
pub fn get_byte(&self, cast: bool) -> Result<Vec<i8>, String>
[src]
pub fn get_byte(&self, cast: bool) -> Result<Vec<i8>, String>
pub fn get_short(&self, cast: bool) -> Result<Vec<i16>, String>
[src]
pub fn get_short(&self, cast: bool) -> Result<Vec<i16>, String>
pub fn get_ushort(&self, cast: bool) -> Result<Vec<u16>, String>
[src]
pub fn get_ushort(&self, cast: bool) -> Result<Vec<u16>, String>
pub fn get_int(&self, cast: bool) -> Result<Vec<i32>, String>
[src]
pub fn get_int(&self, cast: bool) -> Result<Vec<i32>, String>
pub fn get_uint(&self, cast: bool) -> Result<Vec<u32>, String>
[src]
pub fn get_uint(&self, cast: bool) -> Result<Vec<u32>, String>
pub fn get_int64(&self, cast: bool) -> Result<Vec<i64>, String>
[src]
pub fn get_int64(&self, cast: bool) -> Result<Vec<i64>, String>
pub fn get_uint64(&self, cast: bool) -> Result<Vec<u64>, String>
[src]
pub fn get_uint64(&self, cast: bool) -> Result<Vec<u64>, String>
pub fn get_float(&self, cast: bool) -> Result<Vec<f32>, String>
[src]
pub fn get_float(&self, cast: bool) -> Result<Vec<f32>, String>
pub fn get_double(&self, cast: bool) -> Result<Vec<f64>, String>
[src]
pub fn get_double(&self, cast: bool) -> Result<Vec<f64>, String>
pub fn add_attribute<T: PutAttr>(
&mut self,
name: &str,
val: T
) -> Result<(), String>
[src]
pub fn add_attribute<T: PutAttr>(
&mut self,
name: &str,
val: T
) -> Result<(), String>
pub fn values<T: Numeric>(&self) -> Result<Vec<T>, String>
[src]
pub fn values<T: Numeric>(&self) -> Result<Vec<T>, String>
Fetchs variable values, and cast them if needed.
// let values: Vec<f64> = some_variable.values().unwrap();
pub fn read_values_into_buffer<T: Numeric>(
&self,
buffer: &mut Vec<T>
) -> Result<(), String>
[src]
pub fn read_values_into_buffer<T: Numeric>(
&self,
buffer: &mut Vec<T>
) -> Result<(), String>
Read a slice of a variable into a buffer, the buffer must have a capacity at least equal as the number of elements of the slice. The buffer length (not its capacity) will be updated.
pub fn value_at<T: Numeric>(&self, indices: &[usize]) -> Result<T, String>
[src]
pub fn value_at<T: Numeric>(&self, indices: &[usize]) -> Result<T, String>
Fetchs one specific value at specific indices indices must has the same length as self.dimensions.
pub fn read_slice_into_buffer<T: Numeric>(
&self,
indices: &[usize],
slice_len: &[usize],
buffer: &mut Vec<T>
) -> Result<(), String>
[src]
pub fn read_slice_into_buffer<T: Numeric>(
&self,
indices: &[usize],
slice_len: &[usize],
buffer: &mut Vec<T>
) -> Result<(), String>
Read a slice of a variable into a buffer:
- the 'buffer' must have a capacity at least equal as the product of all elements in 'slice'.
- 'indices' must has the same length as self.dimensions.
- all 'slice' elements must be > 0.
The buffer length (not its capacity) will be updated.
pub fn values_at<T: Numeric>(
&self,
indices: &[usize],
slice_len: &[usize]
) -> Result<Vec<T>, String>
[src]
pub fn values_at<T: Numeric>(
&self,
indices: &[usize],
slice_len: &[usize]
) -> Result<Vec<T>, String>
Fetchs a slice of values indices must has the same length as self.dimensions. All slice elements must be > 0.
pub fn as_array<T: Numeric>(&self) -> Result<ArrayD<T>, Box<Error>>
[src]
pub fn as_array<T: Numeric>(&self) -> Result<ArrayD<T>, Box<Error>>
Fetchs variable values as a ndarray.
// Each values will be implicitly casted to a f64 if needed // let values: ArrayD<f64> = some_variable.as_array().unwrap();
pub fn array_at<T: Numeric>(
&self,
indices: &[usize],
slice_len: &[usize]
) -> Result<ArrayD<T>, Box<Error>>
[src]
pub fn array_at<T: Numeric>(
&self,
indices: &[usize],
slice_len: &[usize]
) -> Result<ArrayD<T>, Box<Error>>
Fetchs variable slice as a ndarray.
pub fn put_value_at<T: Numeric>(
&mut self,
value: T,
indices: &[usize]
) -> Result<(), String>
[src]
pub fn put_value_at<T: Numeric>(
&mut self,
value: T,
indices: &[usize]
) -> Result<(), String>
Put a single value at indices
pub fn put_values_at<T: Numeric>(
&mut self,
values: &[T],
indices: &[usize],
slice_len: &[usize]
) -> Result<(), String>
[src]
pub fn put_values_at<T: Numeric>(
&mut self,
values: &[T],
indices: &[usize],
slice_len: &[usize]
) -> Result<(), String>
Put a slice of values at indices
pub fn set_fill_value<T: Numeric>(
&mut self,
fill_value: T
) -> Result<(), String>
[src]
pub fn set_fill_value<T: Numeric>(
&mut self,
fill_value: T
) -> Result<(), String>
Set a Fill Value
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more