pub struct ComplexData { /* private fields */ }Implementations§
Source§impl ComplexData
impl ComplexData
pub fn new( x_data: Array1<f64>, y_data: Array2<Complex64>, ) -> Result<Self, DataError>
Sourcepub fn from_axis(
x_axis: XAxis,
y_data: Array2<Complex64>,
) -> Result<Self, DataError>
pub fn from_axis( x_axis: XAxis, y_data: Array2<Complex64>, ) -> Result<Self, DataError>
Create data from an existing axis. Only the length is checked, since
an XAxis is always valid.
pub fn zeros(num_channels: usize, num_data_points: usize) -> Self
pub fn from_x_data( x_data: Array1<f64>, num_channels: usize, ) -> Result<Self, DataError>
pub fn from_y_data(y_data: Array2<Complex64>) -> Self
pub fn comment(&self) -> Option<&str>
pub fn set_comment(&mut self, comment: Option<&str>)
pub fn channel_label(&self, channel: usize) -> Option<&str>
pub fn set_channel_label(&mut self, channel: usize, label: Option<&str>)
pub fn num_channels(&self) -> usize
pub fn num_data_points(&self) -> usize
Sourcepub fn x_axis(&self) -> &XAxis
pub fn x_axis(&self) -> &XAxis
The x axis. Prefer this over x_data for single
values (XAxis::get) or iteration, because it never allocates.
Sourcepub fn x_data(&self) -> CowArray<'_, f64, Ix1>
pub fn x_data(&self) -> CowArray<'_, f64, Ix1>
The x values as an array. Borrowed for an explicit axis, computed (one allocation) for a uniform one.
Sourcepub fn set_x_axis(&mut self, x_axis: XAxis) -> Result<(), DataError>
pub fn set_x_axis(&mut self, x_axis: XAxis) -> Result<(), DataError>
Replace the x axis. It must have one value per data point.
pub fn y_data(&self) -> ArrayView2<'_, Complex64>
pub fn y_data_mut(&mut self) -> ArrayViewMut2<'_, Complex64>
Sourcepub fn into_y_data(self) -> Array2<Complex64>
pub fn into_y_data(self) -> Array2<Complex64>
Consume the data and return the owned y values without copying.
pub fn channel(&self, ch: usize) -> ArrayView1<'_, Complex64>
pub fn channel_mut(&mut self, ch: usize) -> ArrayViewMut1<'_, Complex64>
pub fn channel_iter(&self) -> AxisIter<'_, Complex64, Ix1> ⓘ
pub fn channel_iter_mut(&mut self) -> AxisIterMut<'_, Complex64, Ix1> ⓘ
pub fn iter(&self) -> Iter<'_, Complex64, Ix2> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, Complex64, Ix2> ⓘ
Sourcepub fn nearest_x_index(&self, x: f64) -> usize
pub fn nearest_x_index(&self, x: f64) -> usize
Index of the x value closest to x. On a tie the lower index wins.
O(1) for a uniform axis, a binary search otherwise.
Source§impl ComplexData
impl ComplexData
pub fn to_magnitude(&self) -> RealData
pub fn to_magnitude_db(&self) -> RealData
pub fn to_phase(&self) -> RealData
pub fn to_phase_unwrapped(&self) -> RealData
pub fn to_phase_2pi(&self) -> RealData
pub fn to_phase_degrees(&self) -> RealData
pub fn to_phase_degrees_unwrapped(&self) -> RealData
Trait Implementations§
Source§impl AbsDiffEq for ComplexData
impl AbsDiffEq for ComplexData
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl Clone for ComplexData
impl Clone for ComplexData
Source§impl Debug for ComplexData
impl Debug for ComplexData
Source§impl<'de> Deserialize<'de> for ComplexData
impl<'de> Deserialize<'de> for ComplexData
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ComplexData
impl Display for ComplexData
Source§impl<'a> IntoIterator for &'a ComplexData
impl<'a> IntoIterator for &'a ComplexData
Source§impl<'a> IntoIterator for &'a mut ComplexData
impl<'a> IntoIterator for &'a mut ComplexData
Source§impl IntoIterator for ComplexData
impl IntoIterator for ComplexData
Source§impl PartialEq for ComplexData
impl PartialEq for ComplexData
Auto Trait Implementations§
impl Freeze for ComplexData
impl RefUnwindSafe for ComplexData
impl Send for ComplexData
impl Sync for ComplexData
impl Unpin for ComplexData
impl UnsafeUnpin for ComplexData
impl UnwindSafe for ComplexData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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