Detectors#
Classes for modeling the signal detection process in flow cytometry.
- class Detector(phi_angle, numerical_aperture, cache_numerical_aperture=<Quantity(0, 'dimensionless')>, gamma_angle=<Quantity(0, 'degree')>, sampling=<Quantity(100, 'dimensionless')>, responsivity=<Quantity(1, 'ampere / watt')>, dark_current=<Quantity(0.0, 'ampere')>, name=None)[source]#
Bases:
object
Represents a photodetector for flow cytometry simulations.
This class simulates a photodetector that captures light scattering signals in a flow cytometry setup. It models the detector’s response by incorporating various noise sources (shot noise, thermal noise, and dark current noise) into the signal processing workflow, thereby providing a realistic representation of detector performance.
- Parameters:
name (str, optional) – A unique identifier for the detector. If not provided, a unique ID is generated.
phi_angle (Quantity) – The primary azimuthal angle of incidence for the detector (in degrees).
numerical_aperture (Quantity) – The numerical aperture of the detector (dimensionless).
cache_numerical_aperture (Quantity, optional) – The numerical aperture of the caching element placed in front of the detector (dimensionless). Default is 0 AU.
responsivity (Quantity, optional) – The responsivity of the detector (in amperes per watt). Default is 1 A/W. Typical ranges include 0.4-0.7 A/W for silicon-based detectors and 0.8-0.9 A/W for InGaAs-based detectors.
dark_current (Quantity, optional) – The dark current of the detector (in amperes). Default is 0 A. Typical values are in the range of 1-100 nA.
gamma_angle (Quantity, optional) – The complementary (longitudinal) angle of incidence, if applicable (in degrees). Default is 0°.
sampling (Quantity, optional) – The number of spatial sampling points defining the detector’s resolution. Default is 100 AU.
- apply_dark_current_noise(signal_generator, bandwidth)[source]#
Compute and return the dark current noise.
- Parameters:
signal_generator (SignalGenerator) – The signal generator instance used to apply noise to the signal.
bandwidth (Quantity) – The bandwidth of the signal (in Hz).
as (Dark current noise is computed)
math:: (..) – sigma_{text{dark}} = sqrt{2 q I_d B}
where –
\(q\) is the elementary charge (1.602176634 x 10⁻¹⁹ C),
\(I_d\) is the dark current,
\(B\) is the bandwidth.
- Returns:
Dictionary containing noise parameters for ‘thermal’ and ‘dark_current’.
- Return type:
dict
- apply_shot_noise(signal_generator, wavelength, bandwidth)[source]#
Computes the shot noise photocurrent arising from photon statistics.
- Shot noise is due to the discrete nature of photon arrivals. The process includes:
Calculating the energy per photon.
Estimating the mean number of photons arriving per sampling interval.
Simulating photon counts via Poisson statistics (or a normal approximation for high counts).
Converting photon counts to photocurrent using the detector responsivity.
- Physics:
The number of photons arriving at the detector ( N_{text{ph}} ) is given by: [ N_{text{ph}} = frac{P_{text{opt}}}{E_{text{photon}}} ]
- where:
( P_{text{opt}} ) is the optical power (W),
( E_{text{photon}} = frac{h cdot c}{lambda} ) is the energy of a photon (J),
( h ) is Planck’s constant ((6.626 times 10^{-34}, text{J} cdot text{s})),
( c ) is the speed of light ((3 times 10^8 , text{m/s})),
( lambda ) is the wavelength of the incident light.
The photocurrent is computed as: [ I_{text{photon}} = R_{text{det}} cdot N_{text{photon}} ]
- where:
( R_{text{det}} ) is the detector responsivity (A/W).
The voltage shot noise is then given by: [ V_{text{shot}} = I_{text{photon}} cdot R_{text{load}} ]
- where:
( R_{text{load}} ) is the load resistance of the detector (Ohms).
- Parameters:
signal_generator (SignalGenerator) – The signal generator instance used to apply noise to the signal.
signal (pd.Series) – The raw signal data series (used to infer the number of samples).
optical_power (Quantity) – The incident optical power on the detector (in watts).
wavelength (Quantity) – The wavelength of the incident light (in meters).
bandwidth (Quantity)
- Returns:
The shot noise-added current distribution (in current).
- Return type:
Quantity
- cache_numerical_aperture: Quantity = <Quantity(0, 'dimensionless')>#
- responsivity: Quantity | None = <Quantity(1, 'ampere / watt')>#