pub struct CameraModel {
pub photons_per_pixel: f64,
pub gain_counts_per_electron: f64,
pub offset_counts: f64,
pub read_noise_electrons: f64,
pub dark_current_electrons: f64,
pub shot_noise: bool,
pub pixel_sensitivity: Option<Vec<f64>>,
pub bit_depth: Option<u8>,
pub saturation_counts: Option<f64>,
pub quantize: bool,
pub bad_pixels: Vec<usize>,
pub bad_pixel_value_counts: Option<f64>,
}Expand description
Concrete detector pipeline from optical intensity to digital counts.
Fields§
§photons_per_pixel: f64Expected photoelectrons per pixel at unit optical intensity.
gain_counts_per_electron: f64§offset_counts: f64§read_noise_electrons: f64§dark_current_electrons: f64§shot_noise: boolWhether to Poisson-sample photoelectrons and dark current.
pixel_sensitivity: Option<Vec<f64>>Multiplicative detector sensitivity for each pixel.
bit_depth: Option<u8>§saturation_counts: Option<f64>§quantize: bool§bad_pixels: Vec<usize>§bad_pixel_value_counts: Option<f64>Implementations§
Source§impl CameraModel
impl CameraModel
pub fn new() -> Self
pub fn photons_per_pixel(self, value: f64) -> Self
pub fn gain(self, counts_per_electron: f64) -> Self
pub fn offset_counts(self, value: f64) -> Self
pub fn read_noise_electrons(self, value: f64) -> Self
pub fn dark_current_electrons(self, value: f64) -> Self
pub fn shot_noise(self, enabled: bool) -> Self
pub fn pixel_sensitivity(self, values: Vec<f64>) -> Self
pub fn bit_depth(self, bits: u8) -> Self
pub fn saturation(self, counts: f64) -> Self
pub fn quantize(self, enabled: bool) -> Self
pub fn bad_pixels(self, indices: Vec<usize>, value_counts: f64) -> Self
pub fn validate(&self) -> Result<()>
pub fn validate_for_frame(&self, frame_len: usize) -> Result<()>
Sourcepub fn measure_frame<R: Rng + ?Sized>(
&self,
intensity: &mut [f64],
rng: &mut R,
) -> Result<()>
pub fn measure_frame<R: Rng + ?Sized>( &self, intensity: &mut [f64], rng: &mut R, ) -> Result<()>
Converts one optical-intensity frame into detector counts in place.
Sourcepub fn compile_reconstruction_model(
&self,
model: ImagePlaneModel,
) -> Result<ImagePlaneModel>
pub fn compile_reconstruction_model( &self, model: ImagePlaneModel, ) -> Result<ImagePlaneModel>
Compiles known uniform linear response into a reconstruction model.
Pixel sensitivity, stochastic noise, clipping, quantization, and bad pixels remain detector effects and are not compiled into the model.
Trait Implementations§
Source§impl Clone for CameraModel
impl Clone for CameraModel
Source§fn clone(&self) -> CameraModel
fn clone(&self) -> CameraModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraModel
impl Debug for CameraModel
Source§impl Default for CameraModel
impl Default for CameraModel
Source§impl<'de> Deserialize<'de> for CameraModel
impl<'de> Deserialize<'de> for CameraModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CameraModel
impl RefUnwindSafe for CameraModel
impl Send for CameraModel
impl Sync for CameraModel
impl Unpin for CameraModel
impl UnsafeUnpin for CameraModel
impl UnwindSafe for CameraModel
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
Mutably borrows from an owned value. Read more