Skip to main content

Coatings

Struct Coatings 

Source
pub struct Coatings {
    pub file: CoatingFile,
    pub measured: HashMap<String, Measured>,
    pub models: HashMap<String, CoatModel>,
    pub user: HashMap<String, Arc<dyn CoatingModel>>,
    pub phase: PhaseConvention,
    pub table_normal: TableNormal,
    pub auto: Vec<(String, PathBuf)>,
    pub auto_measured: Vec<String>,
    pub registered: Vec<(String, String)>,
    pub auto_stacks: Vec<String>,
    pub notes: Vec<String>,
}
Expand description

系の膜: 膜ファイルと実測表

Fields§

§file: CoatingFile§measured: HashMap<String, Measured>

境界の鍵 → 実測表

§models: HashMap<String, CoatModel>

膜の名前 → 特性行列モデル

§user: HashMap<String, Arc<dyn CoatingModel>>

膜の名前 → 係数を計算で返す利用者の膜(登録した一覧・膜のファイル形式から)

§phase: PhaseConvention

透過の位相の約束

§table_normal: TableNormal

TABLE 膜の垂直入射の扱い

§auto: Vec<(String, PathBuf)>

膜ファイルのフォルダから膜の名前で自動で読んだモデル・実測表(系の膜の名前 → ファイル)。 Coatings::for_system が埋める

§auto_measured: Vec<String>

自動で読んだ実測表(.lbct)の境界の鍵(明示したモデルのある膜から外すため)

§registered: Vec<(String, String)>

登録した膜の一覧から入れた膜(系の膜の名前, 一覧の名前)。Coatings::for_system が埋める

§auto_stacks: Vec<String>

自動で膜ファイルに入れた層の並び・表の膜の名前(近似の膜 .lbcs・登録した一覧・登録した形式。明示して読んだ モデル・実測表のある膜から外すため)

§notes: Vec<String>

注意(同じ名前の膜が 2 か所にあり、先のものを使ったときなど)

Implementations§

Source§

impl Coatings

Source

pub fn prepare( &self, sys: &System, key: &str, wl: f64, n1: f64, n2: f64, ) -> Result<Iface>

境界 key の波長 wl [µm] での係数を用意する(n1・n2 は前後の屈折率、鏡では n2 は使わない)

屈折面での反射(鍵 膜|入射側|反対側|R、ゴーストの経路)は鏡と同じ約束(p = s × k を反射の後で反転)の r を返す。 n2 は反対側の媒質の屈折率。膜の向き(基板の側)は透過と同じく、反対側が空気でなければ反対側が基板、空気なら 入射側が基板。位相は基板の面を面の頂点に置いた値(膜の側から入るときは鏡と同じく exp(2 i k n1 cosθ1 Σ d_j) を掛け、基板の側から入るときは掛けない)。暗号化された膜は特性行列モデルの M から r を求める(透過の実測表 だけでは求められない)

Source§

impl Coatings

Source

pub fn for_system(sys: &System) -> Result<Coatings>

系の膜ファイル(zmx の COFN)。なければ空(膜なし・理想膜・実測表だけ)

Source

pub fn apply_registered(&mut self, sys: &System) -> usize

系 sys が使う膜を、今の拡張の表(crate::ext::current)の登録した膜の一覧から入れる(優先の順は crate::usercoating)。入れたものは Coatings::registered に記録し、数を返す。膜ファイルに同じ名前の膜が あれば膜ファイルから外して一覧の方を使い、系に書いた表と同じ名前なら表の方を使う(どちらも注意を足す)

Source

pub fn load_dir_for(&mut self, sys: &System, dir: &Path) -> Result<usize>

フォルダ dir から、系 sys が使う膜のうち膜ファイルで決まらないもの(暗号化された膜など)の モデル・実測表を膜の名前で探して読む。ファイル名は <膜の名前>.lbcb・.lbcm・.lbct、 層のわかる近似の膜なら .lbcs(膜ファイルの形式で COAT とその材料の MATE) (大文字小文字は区別しない。同じ膜で複数あれば lbcb・lbcm・lbct・lbcs の順に 1 つ)。 使う膜だけ読む。読んだものは Coatings::auto に記録し、読んだ数を返す。 後から Coatings::load_file で読んだもの(明示の指定)が勝つ

Source

pub fn add_measured(&mut self, key: &str, m: Measured) -> Result<()>

Source

pub fn kind(&self, key: &str) -> CoatKind

境界 key の膜の扱い(Coatings::prepare もこの判定で係数の作り方を選ぶ)

Source

pub fn load_models(&mut self, path: &Path) -> Result<usize>

膜のモデルのファイル(parse_models の形式)を読み、モデルの数を返す

Source

pub fn load_file(&mut self, path: &Path) -> Result<usize>

実測表(LBCT)か膜のモデル(LBCM)のファイルを、1 行目で見分けて読む。拡張子を足した膜のファイル形式 (crate::ext::Ext::add_coating_source)が読むなら、それで読んだ膜をすべて入れる(読んだ膜の数を返す)

Source

pub fn load_measured(&mut self, path: &Path) -> Result<usize>

実測表のファイル(parse_measured の形式)を読み、表の数を返す

Trait Implementations§

Source§

impl Clone for Coatings

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 Coatings

Source§

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

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

impl Default for Coatings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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