pub struct SensorNoise {
pub shot: bool,
pub read: f64,
pub full_well: f64,
pub bits: u32,
}Expand description
検出器の雑音と AD 変換(検出器の露光で共通)。値は電子数 [e⁻]
Fields§
§shot: boolショット雑音(Poisson)を足す
read: f64読み出し雑音 [e⁻ rms]
full_well: f64飽和 [e⁻](0 なら飽和しない)。AD 変換の全幅
bits: u32AD 変換のビット数(0 なら丸めない)
Implementations§
Source§impl SensorNoise
impl SensorNoise
Sourcepub fn expose(&self, mu: f64, rng: &mut Rng) -> f64
pub fn expose(&self, mu: f64, rng: &mut Rng) -> f64
1 画素の露光。mu は平均の電子数(背景を含む)。ショット雑音は Poisson(Rng::poisson)、読み出し雑音は
正規分布(どちらも Ziggurat 法の正規乱数、Rng::normal_fast)。bits > 0 なら刻み q = full_well / 2^bits で round(e/q)(四捨五入)を 0〜2^bits − 1 に切って q 倍、
bits = 0 で full_well > 0 なら 0〜full_well に切る。値でない mu はそのまま返す(乱数は使わない)
Source§impl SensorNoise
impl SensorNoise
Sourcepub fn expose_mean_merged(
&self,
mu: f64,
n: usize,
rng: &mut Rng,
) -> Option<f64>
pub fn expose_mean_merged( &self, mu: f64, n: usize, rng: &mut Rng, ) -> Option<f64>
同じ平均 mu の画素を n 枚露光した平均を、まとめて 1 回で引く(Self::expose を n 回して平均する代わり)。
ショット雑音の和は Poisson(n·mu)、読み出し雑音の和は分散 n·read² の正規分布で、どちらも厳密。AD の丸めだけは
1 枚ごとの誤差を一様分布(分散 q²/12)とみて和を正規分布で近似する。近似が成り立たない画素(1 枚の雑音の標準偏差が
刻み q より小さい、平均 ± 5σ が 0〜飽和の外に出る)は None(1 枚ずつ露光する)。丸めがあってショット雑音ありで
読み出し雑音が 0.5 e⁻ 未満のときも None: 電子数が整数に近いまま刻み q で丸めると、整数と刻みのうなりで丸めの誤差が
平均 0 にならない(読み出し雑音 0・平均 30 e⁻ で平均が 20 枚平均の σ の 14 % ずれる)。値でない mu はそのまま返す
Trait Implementations§
Source§impl Clone for SensorNoise
impl Clone for SensorNoise
impl Copy for SensorNoise
Source§impl Debug for SensorNoise
impl Debug for SensorNoise
Source§impl Default for SensorNoise
impl Default for SensorNoise
Source§impl PartialEq for SensorNoise
impl PartialEq for SensorNoise
impl StructuralPartialEq for SensorNoise
Auto Trait Implementations§
impl Freeze for SensorNoise
impl RefUnwindSafe for SensorNoise
impl Send for SensorNoise
impl Sync for SensorNoise
impl Unpin for SensorNoise
impl UnsafeUnpin for SensorNoise
impl UnwindSafe for SensorNoise
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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