pub struct Detector { /* private fields */ }Expand description
Spherical detector that collects escaping photons and bins them by direction.
Uses CIE photometric coordinates:
- C-angle: azimuth (0-360), C0 = +X, C90 = +Y
- Gamma: from nadir (0-180), gamma=0 = -Z (down), gamma=180 = +Z (up)
Implementations§
Source§impl Detector
impl Detector
Sourcepub fn new(c_resolution_deg: f64, g_resolution_deg: f64) -> Self
pub fn new(c_resolution_deg: f64, g_resolution_deg: f64) -> Self
Create a new detector with the given angular resolution.
Sourcepub fn record(&mut self, direction: &Vector3<f64>, energy: f64)
pub fn record(&mut self, direction: &Vector3<f64>, energy: f64)
Record an escaping photon by its world-space direction and energy.
Sourcepub fn to_candela(&self, source_flux_lm: f64) -> Vec<Vec<f64>>
pub fn to_candela(&self, source_flux_lm: f64) -> Vec<Vec<f64>>
Convert accumulated bins to candela values.
cd = (energy_in_bin / solid_angle_of_bin) * (source_flux / total_energy)
Sourcepub fn total_flux(&self, source_flux_lm: f64) -> f64
pub fn total_flux(&self, source_flux_lm: f64) -> f64
Total detected flux in lumens (for energy conservation validation).
Sourcepub fn total_energy(&self) -> f64
pub fn total_energy(&self) -> f64
Total accumulated energy.
Sourcepub fn c_resolution_deg(&self) -> f64
pub fn c_resolution_deg(&self) -> f64
C resolution in degrees.
Sourcepub fn g_resolution_deg(&self) -> f64
pub fn g_resolution_deg(&self) -> f64
Gamma resolution in degrees.
Sourcepub fn merge(&mut self, other: &Detector)
pub fn merge(&mut self, other: &Detector)
Merge another detector’s data into this one (for parallel accumulation).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Detector
impl RefUnwindSafe for Detector
impl Send for Detector
impl Sync for Detector
impl Unpin for Detector
impl UnsafeUnpin for Detector
impl UnwindSafe for Detector
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
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.