Charge Measurement models#

Charge measurement models are used to add to and manipulate data in Signal array inside the Detector object. The values in the Signal array represent the amount of signal in Volt. A charge measurement model, e.g. Simple charge measurement, is necessary to first convert from pixel data stored in Pixel class to signal stored in Signal. Multiple models are available to add detector effects after.

Create and Store a detector#

The models Save detector and Load detector can be used respectively to create and to store a Detector to/from a file.

These models can be used when you want to store or to inject a Detector into the current Pipeline.

Save detector#

This model saves the current Detector into a file. Accepted file formats are .h5, .hdf5, .hdf and .asdf.

- name: save_detector
  func: pyxel.models.save_detector
  enabled: true
  arguments:
    filename: my_detector.h5
pyxel.models.save_detector(detector, filename)[source]

Save the current detector into a file.

Load detector#

This model loads a Detector from a file and injects it in the current pipeline. Accepted file formats are .h5, .hdf5, .hdf and .asdf.

- name: load_detector
  func: pyxel.models.load_detector
  enabled: true
  arguments:
    filename: my_detector.h5
pyxel.models.load_detector(detector, filename)[source]

Load a new detector from a file.

Raises:

TypeError – If the loaded detector has not the same type of the current detector.

Simple charge measurement#

PixelSignal

Convert the pixels array to the signal array.

Example of the configuration file:

- name: simple_measurement
  func: pyxel.models.charge_measurement.simple_measurement
  enabled: true
  arguments:
    noise:
      - gain: 1.    # Optional
pyxel.models.charge_measurement.simple_measurement(detector, gain=None)[source]#

Convert the pixel array into signal array.

Notes

If no gain is provided, then its value will be the sensitivity of charge readout provided in the Detector object.

Parameters:
  • detector (Detector) – Pyxel Detector object.

  • gain (float, optional) – Gain to apply. By default, this is the sensitivity of charge readout. Unit: V/e-

DC offset#

SignalSignal

Add a DC offset to signal array of detector.

- name: dc_offset
  func: pyxel.models.charge_measurement.dc_offset
  enabled: true
  arguments:
    offset: 0.1
pyxel.models.charge_measurement.dc_offset(detector, offset)[source]#

Apply DC voltage to the detector.

Parameters:
  • detector (Detector) – Pyxel Detector object.

  • offset (float) – DC offset voltage. Unit: V

Output pixel reset voltage APD#

Note

This model is specific to the APD detector.

SignalSignal

Add output pixel reset voltage to the signal array of the APD detector.

- name: output_pixel_reset_voltage_apd
  func: pyxel.models.charge_measurement.output_pixel_reset_voltage_apd
  enabled: true
  arguments:
    roic_drop: 3.3

Note

You can find an example of this model used in this Jupyter Notebook Saphira from Pyxel Data.

pyxel.models.charge_measurement.output_pixel_reset_voltage_apd(detector, roic_drop)[source]#

Apply output pixel reset voltage to APD detector.

Parameters:
  • detector (APD) – Pyxel APD object.

  • roic_drop (float) – Readout circuit drop voltage. Unit: V

Notes

For more information, you can find an example here: Saphira.

kTC reset noise#

SignalSignal

Add kTC reset noise to the signal array of the detector object.

- name: ktc_noise
  func: pyxel.models.charge_measurement.ktc_noise
  enabled: true
  arguments:
    node_capacitance: 30.e-15

Note

When using with the APD detector, node capacitance is calculated from detector characteristics.

Note

You can find examples of this model in these Jupyter Notebooks from Pyxel Data:

pyxel.models.charge_measurement.ktc_noise(detector, node_capacitance=None, seed=None)[source]#

Apply KTC reset noise to detector signal array.

Parameters:
  • detector (Detector) – Pyxel detector object.

  • node_capacitance (float, optional) – Node capacitance. Unit: F

  • seed (int, optional) – Random seed.

Notes

For more information, you can find examples here:

Output node noise#

Note

This model is specific to the CCD detector.

SignalSignal

Add noise to signal array of detector output node using normal random distribution.

- name: output_noise
  func: pyxel.models.charge_measurement.output_node_noise
  enabled: true
  arguments:
    std_deviation: 1.0
pyxel.models.charge_measurement.output_node_noise(detector, std_deviation, seed=None)[source]#

Add noise to signal array of detector output node using normal random distribution.

Parameters:
  • detector (Detector) – Pyxel detector object.

  • std_deviation (float) – Standard deviation. Unit: V

  • seed (int, optional) – Random seed.

Raises:

ValueError – Raised if ‘std_deviation’ is negative

Output node noise CMOS#

Note

This model is specific to the CMOS detector.

SignalSignal

Output node noise model for CMOS detectors where readout is statistically independent for each pixel.

- name: output_noise
  func: pyxel.models.charge_measurement.output_node_noise
  enabled: true
  arguments:
    readout_noise: 1.0
    readout_noise_std: 2.0
pyxel.models.charge_measurement.output_node_noise_cmos(detector, readout_noise, readout_noise_std, seed=None)[source]#

Output node noise model for CMOS detectors where readout is statistically independent for each pixel.

Parameters:
  • detector (CMOS) – Pyxel CMOS object.

  • readout_noise (float) – Mean readout noise for the array in units of electrons. Unit: electron

  • readout_noise_std (float) – Readout noise standard deviation in units of electrons. Unit: electron

  • seed (int, optional) – Random seed.

Raises:
  • TypeError – Raised if the ‘detector’ is not a CMOS object.

  • ValueError – Raised if ‘readout_noise_std’ is negative.

Readout noise Saphira#

Note

This model is specific to the APD detector.

SignalSignal

Empirical noise for adding noise to the signal array of the APD detector using normal random distribution. Additional noise factor for roic_readout_noise is computed from detector characteristic avalanche gain in the model. Noise factor based on a figure from [23] for temperature of 90K.

- name: readout_noise_saphira
  func: pyxel.models.charge_measurement.readout_noise_saphira
  enabled: true
  arguments:
    roic_readout_noise: 0.15
    controller_noise: 0.1, optional

Note

You can find an example of this model used in this Jupyter Notebook Saphira from Pyxel Data.

pyxel.models.charge_measurement.readout_noise_saphira(detector, roic_readout_noise, controller_noise=0.0, seed=None)[source]#

Apply Saphira specific readout noise to the APD detector.

Parameters:
  • detector (APD) – Pyxel APD object.

  • roic_readout_noise (float) – Readout integrated circuit noise in volts RMS. Unit: V

  • controller_noise (float) – Controller noise in volts RMS. Unit: V

  • seed (int, optional)

Notes

For more information, you can find an example here: Saphira.

Non-linearity (polynomial)#

SignalSignal

With this model you can add non-linearity to Signal array to simulate the non-linearity of the output node circuit. The non-linearity is simulated by a polynomial function. The user specifies the polynomial coefficients with the argument coefficients: a list of \(n\) floats e.g. \([a,b,c] \rightarrow S = a + bx+ cx2\) (\(x\) is signal).

Example of the configuration file where a 10% non-linearity is introduced as a function of the signal square:

- name: linearity
  func: pyxel.models.charge_measurement.output_node_linearity_poly
  enabled: true
  arguments:
    coefficients: [0, 1, 0.9]  # e- [a,b,c] -> S = a + bx+ cx2 (x is signal)

Note

You can find examples of this model in these Jupyter Notebooks from Pyxel Data:

pyxel.models.charge_measurement.output_node_linearity_poly(detector, coefficients)[source]#

Add non-linearity to signal array to simulate the non-linearity of the output node circuit.

The non-linearity is simulated by a polynomial function. The user specifies the polynomial coefficients.

detector Signal unit: Volt

Parameters:
  • detector (Detector) – Pyxel Detector object.

  • coefficients (list of float) – Coefficient of the polynomial function.

Notes

For more information, you can find examples here:

Simple physical non-linearity#

Note

This model is specific to the CMOS detector.

SignalSignal

With this model you can add non-linearity to Signal array.

The model assumes a planar geometry of the diode and follows the description of the classical non-linearity model described in [24]. It does not take into account the additional fixed capacitance and the gain non-linearity and does not simulate saturation.

Example of the configuration file:

- name: simple_physical_non_linearity
  func: pyxel.models.charge_measurement.simple_physical_non_linearity
  enabled: true
  arguments:
    cutoff: 2.1
    n_acceptor: 1.e+18
    n_donor: 3.e+15
    diode_diameter: 10.
    v_bias: 0.1
pyxel.models.charge_measurement.simple_physical_non_linearity(detector, cutoff, n_acceptor, n_donor, diode_diameter, v_bias)[source]#

Apply simple physical non-linearity.

Parameters:
  • detector (Detector) – Pyxel detector object.

  • cutoff (float) – Cutoff wavelength. unit: um

  • n_donor (float) – Donor density. Unit: atoms/cm^3

  • n_acceptor (float) – Acceptor density. Unit: atoms/cm^3

  • diode_diameter (float) – Diode diameter. Unit: um

  • v_bias (float) – Initial bias voltage. Unit: V.

Physical non-linearity#

Note

This model is specific to the CMOS detector.

SignalSignal

With this model you can add non-linearity to Signal array.

In this simplified analytical detector non-linearity model [25] which assumes the detector is working far from saturation, the current flowing in the diode is restricted to a photonic current:

\(\frac{dV}{dt}=\frac{-I_{ph}}{C}\).

The integrating capacitance can be written as a sum of fixed capacitance \(C_f\) in the readout integrated circuit and diode capacitance:

\(C=C_f+\frac{C_0}{1-\frac{V}{V_{bi}}}\),

The diode capacitance at 0 bias \(C_0\) is [26]:

\(C_0=A\sqrt{\frac{e\epsilon\epsilon_0}{2V_{bi}}(\frac{1}{N_a}+\frac{1}{N_d})}\).

\(A\) is the area of the circular shaped diode, \(e\) electron charge, \(\epsilon\) dielectric constant of the material, and \(N_a\) and \(N_d\) are acceptor and donor concentrations. \(V_{bi}\) is the built-in diode potential and is a function of \(N_a\), \(N_d\), temperature and intrinsic carrier concentration. By inserting second equation into first equation and integrating, one can express voltage on the detector after exposure as a solution of a quadratic equation. Different to the non-linearity model presented in Plazas et al. (2017) [24], this model takes into account the additional fixed capacitance and the gain non-linearity. Still it is not a complete physical model and does not simulate the saturation of the detector. Additionally, it assumes a planar geometry of the diode instead of a cylindrical.

Example of the configuration file:

- name: physical_non_linearity
  func: pyxel.models.charge_measurement.physical_non_linearity
  enabled: true
  arguments:
    cutoff: 2.1
    n_acceptor: 1.e+18
    n_donor: 3.e+15
    diode_diameter: 10.
    v_bias: 0.1
    fixed_capacitance: 5.e-15

Note

You can find an example of this model used in this Jupyter Notebook Non-linearity from Pyxel Data.

pyxel.models.charge_measurement.physical_non_linearity(detector, cutoff, n_acceptor, n_donor, diode_diameter, v_bias, fixed_capacitance)[source]#

Apply physical non-linearity.

Parameters:
  • detector (Detector) – Pyxel detector object.

  • cutoff (float) – Cutoff wavelength. unit: um

  • n_donor (float) – Donor density. Unit: atoms/cm^3

  • n_acceptor (float) – Acceptor density. Unit: atoms/cm^3

  • diode_diameter (float) – Diode diameter. Unit: um

  • v_bias (float) – Initial bias voltage. Unit: V.

  • fixed_capacitance (float) – Additional fixed capacitance. Unit: F

Notes

For more information, you can find an example here: Non-linearity.

Physical non-linearity with saturation#

Note

This model is specific to the CMOS detector.

SignalSignal

With this model you can add non-linearity to Signal array.

This model follows the description in [25] and gives the diode bias as a function of the time by solving the following differential equation using the Euler method:

\(\frac{dV}{dt}=\frac{I(t)}{C(V)}\),

where \(V\) is the applied bias, \(C\) the node capacitance, and

\(I(t)=I_{sat}(exp(\frac{V}{nV_T})-1)-I_{ph}\).

\(I_{sat}\) is the saturation current of the diode, \(V_T\) is the thermal velocity, \(n\) is the ideality factor of the diode, and \(I_{ph}\) is the photonic current.

Considering a diode with a cylindrical geometry, one can write

\(C(V)=C_f+\frac{a_0}{W_{dep}(V)}+b_0+c_0W_{dep}(V)\).

For an abrupt junction and diode dimension parameters \(\Phi_{imp}\) and \(d_{imp}\), following equations hold:

\(W_{dep}(V)=W_0(1-\frac{V}{V_{bi}})^{-\frac{1}{2}}\)

\(a_0=(\frac{\Phi^2_{imp}}{4}+\Phi_{imp}d_{imp})\epsilon\pi\),

\(b_0=(\Phi_{imp}+d_{imp})2\epsilon\pi\),

\(c_0=3\epsilon\pi\).

User also specifies detector parameters v_reset and d_sub. This model assumes additional fixed capacitances, the gain non-linearity is taken into account, it simulates the detector saturation and assumes that the non-linearities observed mainly come from the PN junction diode.

Example of the configuration file:

- name: physical_non_linearity_with_saturation
  func: pyxel.models.charge_measurement.physical_non_linearity_with_saturation
  enabled: true
  arguments:
    cutoff: 2.1
    n_donor: 3.e+15
    n_acceptor: 1.e+18
    phi_implant: 6.e-6
    d_implant: 1.e-6
    saturation_current: 0.002
    ideality_factor: 1.34
    v_reset: 0.
    d_sub: 0.220
    fixed_capacitance: 5.e-15
    euler_points: 100

Note

You can find an example of this model used in this Jupyter Notebook Non-linearity from Pyxel Data.

pyxel.models.charge_measurement.physical_non_linearity_with_saturation(detector, cutoff, n_donor, n_acceptor, phi_implant, d_implant, saturation_current, ideality_factor, v_reset, d_sub, fixed_capacitance, euler_points)[source]#

Apply physical non-linearity with saturation.

Parameters:
  • detector (Detector) – Pyxel detector object.

  • cutoff (float) – Cutoff wavelength. unit: um

  • n_donor (float) – Donor density. Unit: atoms/cm^3

  • n_acceptor (float) – Acceptor density. Unit: atoms/cm^3

  • phi_implant (float) – Diameter of the implantation. Unit: um

  • d_implant (float) – Depth of the implamantation. Unit: um

  • saturation_current (float) – Saturation current: e-/s/pix.

  • ideality_factor (float) – Ideality factor.

  • v_reset (float) – VRESET. Unit: V.

  • d_sub (float) – DSUB. Unit: V.

  • fixed_capacitance (float) – Additional fixed capacitance. Unit: F.

  • euler_points (int) – Number of points in the euler method.

Notes

For more information, you can find an example here: Non-linearity.

HxRG noise generator#

PixelPixel

With this model you can add noise to Pixel array, before converting to Signal array in the charge measurement part of the pipeline.

It is a near-infrared CMOS noise generator (ngHxRG) developed for the James Webb Space Telescope (JWST) Near Infrared Spectrograph (NIRSpec) described in [23]. It simulates many important noise components including white read noise, residual bias drifts, pink 1/f noise, alternating column noise and picture frame noise.

The model reproduces most of the Fourier noise power spectrum seen in real data, and includes uncorrelated, correlated, stationary and non-stationary noise components. The model can simulate noise for HxRG detectors of Teledyne Imaging Sensors with and without the SIDECAR ASIC IR array controller.

nghxrg

ngHxRG Noise Generator#

Example of the configuration file:

- name: nghxrg
  func: pyxel.models.charge_measurement.nghxrg
  enabled: true
  arguments:
    noise:
      - ktc_bias_noise:
          ktc_noise: 1
          bias_offset: 2
          bias_amp: 2
      - white_read_noise:
          rd_noise: 1
          ref_pixel_noise_ratio: 2
      - corr_pink_noise:
          c_pink: 1.
      - uncorr_pink_noise:
          u_pink: 1.
      - acn_noise:
          acn: 1.
      - pca_zero_noise:
          pca0_amp: 1.
    window_position: [0, 0]   # Optional
    window_size: [100, 100]   # Optional
    n_output: 1
    n_row_overhead: 0
    n_frame_overhead: 0
    reverse_scan_direction: False
    reference_pixel_border_width: 4

Note

You can find an example of this model used in this Jupyter Notebook H2RG pipeline from Pyxel Data.

pyxel.models.charge_measurement.nghxrg(detector, noise, window_position=None, window_size=None, n_output=1, n_row_overhead=0, n_frame_overhead=0, reverse_scan_direction=False, reference_pixel_border_width=4, seed=None)[source]#

Generate fourier noise power spectrum on HXRG detector.

For more information see [23].

Parameters:
  • detector (Detector)

  • noise (list)

  • window_position (sequence, optional) – [x0 (columns), y0 (rows)].

  • window_size (sequence, optional) – [x (columns), y (rows)].

  • seed (int, optional)

  • n_output (int) – Number of detector outputs.

  • n_row_overhead (int) – New row overhead in pixel. This allows for a short wait at the end of a row before starting the next row.

  • n_frame_overhead (int) – New frame overhead in rows. This allows for a short wait at the end of a frame before starting the next frame.

  • reverse_scan_direction (bool) – Set this True to reverse the fast scanner readout directions. This capability was added to support Teledyne’s programmable fast scan readout directions. The default setting (False) corresponds to what HxRG detectors default to upon power up.

  • reference_pixel_border_width (int) – Width of reference pixel border around image area.

Notes

For more information, you can find an example here: H2RG pipeline.

  • kTC bias noise

  • White readout noise

  • Alternating column noise (ACN)

  • Uncorrelated pink noise

  • Correlated pink noise

  • PCA0 noise

DC crosstalk#

SignalSignal

Apply DC crosstalk signal to detector signal.

Example of the configuration file:

- name: dc_crosstalk
  func: pyxel.models.charge_measurement.dc_crosstalk
  enabled: true
  arguments:
    coupling_matrix: [[1, 0.5, 0, 0], [0.5, 1, 0, 0], [0, 0, 1, 0.5], [0, 0, 0.5, 1]]
    channel_matrix: [1,2,3,4]
    readout_directions: [1,2,1,2]
pyxel.models.charge_measurement.dc_crosstalk(detector, coupling_matrix, channel_matrix, readout_directions)[source]#

Apply DC crosstalk signal to detector signal.

Parameters:
Raises:

ValueError – If at least one parameter ‘coupling_matrix’, ‘channel_matrix’ or ‘readout_directions’ does not have the right shape.

AC crosstalk#

SignalSignal

Apply AC crosstalk signal to detector signal.

Example of the configuration file:

- name: ac_crosstalk
  func: pyxel.models.charge_measurement.ac_crosstalk
  enabled: true
  arguments:
    coupling_matrix: [[1, 0.5, 0, 0], [0.5, 1, 0, 0], [0, 0, 1, 0.5], [0, 0, 0.5, 1]]
    channel_matrix: [1,2,3,4]
    readout_directions: [1,2,1,2]

Note

You can find examples of this model in these Jupyter Notebooks from Pyxel Data:

pyxel.models.charge_measurement.ac_crosstalk(detector, coupling_matrix, channel_matrix, readout_directions)[source]#

Apply AC crosstalk signal to detector signal.

Parameters:
Raises:

ValueError – If at least one parameter ‘coupling_matrix’, ‘channel_matrix’ or ‘readout_directions’ does not have the right shape.

Notes

For more information, you can find examples here: