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.

phi_angle#

The detector’s primary azimuthal angle (in degrees).

Type:

Quantity

numerical_aperture#

The detector’s numerical aperture (dimensionless).

Type:

Quantity

cache_numerical_aperture#

The numerical aperture of the cache element (dimensionless).

Type:

Quantity

responsivity#

The responsivity of the detector (in amperes per watt).

Type:

Quantity

dark_current#

The dark current of the detector (in amperes).

Type:

Quantity

gamma_angle#

The complementary (longitudinal) angle (in degrees).

Type:

Quantity

sampling#

The number of spatial sampling points.

Type:

Quantity

name#

The identifier for the detector.

Type:

str

cache_numerical_aperture: Quantity = <Quantity(0, 'dimensionless')>#
property dataframe: DataFrame#

Retrieves the detector-specific slice of the cytometer’s dataframe.

Returns:

A dataframe corresponding to the detector’s recorded data.

Return type:

pd.DataFrame

get_dark_current_noise(sequence_length, bandwidth)[source]#

Compute and return the dark current noise.

Dark current noise is computed as:

\[\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

Parameters:
  • sequence_length (int)

  • bandwidth (Quantity)

get_noise_signal(sequence_length)[source]#

Generates the composite noise signal over a specified sequence length.

This method computes and aggregates different noise components (e.g., thermal and dark current noise) based on their parameters.

Parameters:

sequence_length (int) – The number of data points for which to generate the noise signal.

Returns:

The aggregated noise signal (in volts) as a Quantity array.

Return type:

Quantity

get_shot_noise(optical_power, 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:
  1. Calculating the energy per photon.

  2. Estimating the mean number of photons arriving per sampling interval.

  3. Simulating photon counts via Poisson statistics (or a normal approximation for high counts).

  4. 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 (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 voltage distribution (in volts).

Return type:

Quantity

responsivity: Quantity | None = <Quantity(1, 'ampere / watt')>#