Skip to main content

DualPol

Struct DualPol 

Source
pub struct DualPol {
    pub x: Vec<C64>,
    pub y: Vec<C64>,
}
Expand description

A field in two polarisations, x and y, of equal length.

Fields§

§x: Vec<C64>

Polarisation x.

§y: Vec<C64>

Polarisation y.

Implementations§

Source§

impl DualPol

Source

pub fn new(x: Vec<C64>, y: Vec<C64>) -> Result<DualPol>

Two polarisations of equal length.

§Errors

Error::Shape if the lengths differ.

Source

pub fn len(&self) -> usize

Number of samples per polarisation.

Source

pub fn is_empty(&self) -> bool

Whether the field is empty.

Source

pub fn power(&self) -> f64

Mean total power mean(|x|² + |y|²).

Source

pub fn scale(&mut self, s: f64)

Multiply both polarisations by s.

Source

pub fn to_signal(&self, sample_rate: Hertz) -> Result<Signal>

The two polarisations as a two-stream Signal.

§Errors

Never for a valid DualPol.

Source

pub fn from_signal(s: &Signal) -> Result<DualPol>

The field of a two-stream Signal: x its first stream, y its second (the inverse of DualPol::to_signal).

§Errors

Error::Shape unless the signal has exactly two streams.

Trait Implementations§

Source§

impl Clone for DualPol

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DualPol

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DualPol

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DualPol

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.