Skip to main content

Beam

Struct Beam 

Source
pub struct Beam {
    pub nx: usize,
    pub ny: usize,
    pub dx: f64,
    pub dy: f64,
    pub x0: f64,
    pub y0: f64,
    pub wl: f64,
    pub index: f64,
    pub pilot: Pilot,
    pub w: f64,
    pub dir: f64,
    pub u: Vec<C64>,
}
Expand description

平面の上の複素振幅の場

Fields§

§nx: usize§ny: usize§dx: f64§dy: f64§x0: f64

格子の中心(標本 i の x は x0 + (i − (nx − 1)/2)·dx)

§y0: f64§wl: f64

真空の波長 [mm]

§index: f64

媒質の屈折率

§pilot: Pilot§w: f64

パイロットの Gauss ビームの半径 [mm](出力のパイロットの曲率を決めるだけ)

§dir: f64

局所座標の z の向きに対する伝搬の向き(+1 / −1。鏡の後は −1)

§u: Vec<C64>

パイロットを除いた場(行優先: [iy·nx + ix])。伝搬の途中の作業用の形(間隔 dx・dy が伝搬で変わるので 座標は x0・dx から作る)。結果として渡すときは Beam::grid(座標の並びつきの lensbench_core::grid::Grid2)

Implementations§

Source§

impl Beam

Source

pub fn from_fn( n: (usize, usize), d: (f64, f64), c: (f64, f64), wl: f64, index: f64, pilot: Pilot, f: impl Fn(f64, f64) -> C64, ) -> Beam

関数 f(x, y)(パイロットを除いた場)から作る。w は Beam::rms_width で決める

Source

pub fn x(&self, i: usize) -> f64

Source

pub fn y(&self, j: usize) -> f64

Source

pub fn k(&self) -> f64

媒質の中の波数 [1/mm]

Source

pub fn pilot_phase(&self, x: f64, y: f64) -> f64

パイロットの位相 [rad]

Source

pub fn field(&self, i: usize, j: usize) -> C64

全体の場(パイロット込み、exp(−i·パイロットの位相) を掛ける)

Source

pub fn xs(&self) -> Vec<f64>

x の座標の並び(標本の中心)

Source

pub fn ys(&self) -> Vec<f64>

y の座標の並び(標本の中心)

Source

pub fn grid(&self) -> Grid2<C64>

パイロットを除いた場を座標の並びつきの格子で(Beam::u の写し)

Source

pub fn irradiance_grid(&self) -> Grid2

照度 |u|² を座標の並びつきの格子で

Source

pub fn irradiance(&self) -> Vec<f64>

照度 |u|²(行優先)

Source

pub fn power(&self) -> f64

全パワー Σ|u|² dx dy

Source

pub fn normalize(&mut self, p: f64)

パワーを p にする

Source

pub fn centroid(&self) -> (f64, f64)

照度の重心

Source

pub fn rms_width(&self) -> f64

重心からの半径の 2 次モーメントの √2 倍(一様な円形なら半径、Gauss なら 1/e² 半径)

Source

pub fn peak(&self) -> f64

照度の最大値

Source

pub fn phase_step(&self) -> f64

格子の隣り合う標本の、パイロットを除いた位相の差の最大 [rad](照度が最大の 1e-3 倍以上の所だけ)。 π に近いと標本化が足りない

Source

pub fn apply_aperture(&mut self, ap: Aperture, ss: usize)

開口を掛ける(開口の外は 0。縁の画素は ss × ss の副標本で面積の割合を掛ける)

Trait Implementations§

Source§

impl Clone for Beam

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 Beam

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Beam

§

impl RefUnwindSafe for Beam

§

impl Send for Beam

§

impl Sync for Beam

§

impl Unpin for Beam

§

impl UnsafeUnpin for Beam

§

impl UnwindSafe for Beam

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,