[−][src]Struct helixiser::wavefront::Wavefront
Fields
values: Array2<Complex64>
A wavefront is a 2D array of complex value where each point corresponds to a coordinate in 2D space. The array indices correspond to a point in space.
Implementations
impl Wavefront
[src]
pub fn new(values: Array2<Complex64>) -> Self
[src]
Instantiate a new Wavefront struct
pub fn rescale(&mut self, factor: f64)
[src]
rescale the (complex) values of the wavefront by a (real) scalar value.
Examples
use assert_approx_eq::assert_approx_eq; use helixiser::wavefront::Wavefront; use num::traits::Pow; use ndarray::arr2; use num::complex::Complex64; let mut my_wavefront = Wavefront::new( arr2(&[[Complex64::new(5., 1.), Complex64::new(0., 0.)], [Complex64::new(0., 0.), Complex64::new(4., 2.)]])); // Rescale the wavefront my_wavefront.rescale(10.5); assert_eq!(my_wavefront.values, arr2(&[[Complex64::new(52.5, 10.5), Complex64::new(0., 0.)], [Complex64::new(0., 0.), Complex64::new(42., 21.)]]))
pub fn intensities(&self) -> Array2<f64>
[src]
Convert the complex valued wavefront into (real valued) intensities.
Real values are obtained by squaring the norm of the complex values.
pub fn save_image(&self, path: &str)
[src]
Save wavefront intensities as image using the image crate
Panics
This function uses the image::save_buffer
function which can panic
Auto Trait Implementations
impl RefUnwindSafe for Wavefront
[src]
impl Send for Wavefront
[src]
impl Sync for Wavefront
[src]
impl Unpin for Wavefront
[src]
impl UnwindSafe for Wavefront
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
pub fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,