opticks.contrast_model.detector_mtf

Detector-level MTF models (diffusion, CTE, crosstalk, etc.).

Currently includes:

  • Diffusion MTF based on Crowell & Labuda (1969) with five simplified cases covering BSI and FSI detector geometries, plus preset parameter sets for common detector categories.

  • Crosstalk MTF for the center-pixel 8-neighbour model.

  • CTE (Charge Transfer Efficiency) MTF for CCD detectors.

Functions

detector_crosstalk_mtf(fx, fy, xs, xd, ...)

Compute center-pixel (8-neighbour) crosstalk MTF at arbitrary 2D frequencies.

detector_crosstalk_mtf_1d(input_line_freq, ...)

1D slice of the center-pixel crosstalk MTF (fy = 0).

detector_cte_mtf_1d(input_line_freq, ...[, ...])

1D CTE MTF for a CCD detector (Janesick 2001).

detector_diffusion_mtf(...)

Dispatcher for the detector diffusion MTF.

validate_crosstalk_params(xs, xd)

Validate crosstalk coefficients for the center-pixel model.

validate_cte_params(num_pixels, num_phases, ...)

Validate parameters for the CTE MTF model.

validate_diffusion_params(model, ...)

Validate that supplied/missing parameters match the selected diffusion model.

Classes

DetectorDiffusionModel(label, required_params)

Diffusion MTF model variant (geometry + boundary conditions).

DetectorDiffusionPreset(label, model, params)

Generic detector category presets for the diffusion MTF model.

class DetectorDiffusionModel(label, required_params)[source]

Diffusion MTF model variant (geometry + boundary conditions).

Each member carries its required_params - the set of physical parameter names the model needs. Any optional parameter not in this set is forbidden (triggers ValueError if supplied).

BSI_1 = ('bsi_1', {'depletion_depth', 'diffusion_length', 'field_free_depth'})
BSI_2 = ('bsi_2', {'depletion_depth', 'diffusion_length', 'field_free_depth'})
BSI_3 = ('bsi_3', {'diffusion_coeff', 'diffusion_length', 'field_free_depth', 'surface_recomb_velocity'})
FSI_1 = ('fsi_1', {'depletion_depth', 'diffusion_length', 'field_free_depth'})
FSI_2 = ('fsi_2', {'depletion_depth', 'diffusion_length'})
class DetectorDiffusionPreset(label, model, params)[source]

Generic detector category presets for the diffusion MTF model.

Each member carries its associated model and default params dict (Quantity values keyed by parameter name).

CONSUMER_CCD = ('consumer_ccd', DetectorDiffusionModel.FSI_2, {'depletion_depth': <Quantity 3. um>, 'diffusion_length': <Quantity 50. um>})
CONSUMER_CMOS = ('consumer_cmos', DetectorDiffusionModel.FSI_1, {'depletion_depth': <Quantity 2. um>, 'diffusion_length': <Quantity 15. um>, 'field_free_depth': <Quantity 3. um>})
MCT_LWIR = ('mct_lwir', DetectorDiffusionModel.BSI_3, {'diffusion_coeff': <Quantity 40. cm2 / s>, 'diffusion_length': <Quantity 35. um>, 'field_free_depth': <Quantity 10. um>, 'surface_recomb_velocity': <Quantity 1000. cm / s>})
MCT_MWIR = ('mct_mwir', DetectorDiffusionModel.BSI_3, {'diffusion_coeff': <Quantity 15. cm2 / s>, 'diffusion_length': <Quantity 25. um>, 'field_free_depth': <Quantity 7. um>, 'surface_recomb_velocity': <Quantity 500. cm / s>})
SCIENTIFIC_CCD = ('scientific_ccd', DetectorDiffusionModel.BSI_1, {'depletion_depth': <Quantity 15. um>, 'diffusion_length': <Quantity 200. um>, 'field_free_depth': <Quantity 17. um>})
SCIENTIFIC_CMOS = ('scientific_cmos', DetectorDiffusionModel.BSI_2, {'depletion_depth': <Quantity 1.5 um>, 'diffusion_length': <Quantity 20. um>, 'field_free_depth': <Quantity 5. um>})
detector_crosstalk_mtf(fx, fy, xs, xd, pixel_pitch)[source]

Compute center-pixel (8-neighbour) crosstalk MTF at arbitrary 2D frequencies.

The transfer function is real-valued for the symmetric center kernel:

H(fx, fy) = (1 - 4Xs - 4Xd)
           + 2Xs cos(2π fx P) + 2Xs cos(2π fy P)
           + 4Xd cos(2π fx P) cos(2π fy P)
Return type:

float | ndarray[tuple[Any, ...], dtype[double]]

Parameters:
  • fx (Quantity) – Spatial frequencies (e.g. in cy/mm).

  • fy (Quantity) – Spatial frequencies (e.g. in cy/mm).

  • xs (float) – Side-neighbour crosstalk coefficient (dimensionless fraction).

  • xd (float) – Diagonal-neighbour crosstalk coefficient (dimensionless fraction).

  • pixel_pitch (Quantity[``”length”``]) – Pixel pitch.

Returns:

float | NDArray[np.float64] – Crosstalk MTF value(s).

detector_crosstalk_mtf_1d(input_line_freq, xs, xd, pixel_pitch)[source]

1D slice of the center-pixel crosstalk MTF (fy = 0).

Equivalent to 1 - 2(Xs + 2Xd)(1 - cos(2π f P)). When xd = 0 this reduces to the classical nearest-neighbour formula 1 - 2Xs(1 - cos(2π f P)).

Return type:

float | ndarray[tuple[Any, ...], dtype[double]]

Parameters:
detector_cte_mtf_1d(input_line_freq, num_pixels, num_phases, cte, pixel_pitch, tdi_stages=0)[source]

1D CTE MTF for a CCD detector (Janesick 2001).

Models charge transfer inefficiency in the parallel or serial register. The MTF degrades with the number of charge transfers and the per-transfer inefficiency (1 - CTE):

MTF(f) = exp(-N * (1 - cte) * (1 - cos(π f / f_nyq)))

where N = (num_pixels + tdi_stages) * num_phases and f_nyq = 1 / (2 * pixel_pitch).

Parameters:
  • input_line_freq (Quantity) – Spatial frequency (e.g. in cy/mm).

  • num_pixels (int) – Number of pixels between the target pixel and the readout register.

  • num_phases (int) – Number of clock phases per pixel (typically 3 for 3-phase CCDs).

  • cte (float) – Charge transfer efficiency per transfer (dimensionless, 0 to 1).

  • pixel_pitch (Quantity[``”length”``]) – Pixel pitch.

  • tdi_stages (int, optional) – Number of on-chip analog TDI stages. Default is 0. Pass 0 for digital (“shift-and-add”) TDI and for the ACT direction.

Returns:

  • float | NDArray[np.float64] – CTE MTF value(s).

  • rtype: float | ndarray[tuple[Any, :py:class::py:data:`…<Ellipsis>`]`, :py:class:`~numpy.dtype`\ \[:py:class:`~numpy.double`]]`

Return type:

float | ndarray[tuple[Any, …], dtype[float64]]

detector_diffusion_mtf(input_line_freq_cy_mm, model, alpha, L_o, L_a, depth, s_over_d)[source]

Dispatcher for the detector diffusion MTF.

All length parameters are in µm, frequency in cy/mm (converted internally). Returns normalised MTF = η(f) / η(f≈0).

Return type:

float | ndarray[tuple[Any, ...], dtype[double]]

Parameters:
validate_crosstalk_params(xs, xd)[source]

Validate crosstalk coefficients for the center-pixel model.

Return type:

None

Parameters:
  • xs (float) – Side-neighbour crosstalk coefficient (dimensionless fraction).

  • xd (float) – Diagonal-neighbour crosstalk coefficient (dimensionless fraction).

validate_cte_params(num_pixels, num_phases, cte, tdi_stages)[source]

Validate parameters for the CTE MTF model.

Return type:

None

Parameters:
  • num_pixels (int) – Number of pixels between the target pixel and the readout register.

  • num_phases (int) – Number of clock phases per pixel (typically 3 for 3-phase CCDs).

  • cte (float) – Charge transfer efficiency per transfer (dimensionless, 0 to 1).

  • tdi_stages (int) – Number of on-chip analog TDI stages (0 for non-TDI or digital TDI).

validate_diffusion_params(model, field_free_depth, depletion_depth, surface_recomb_velocity, diffusion_coeff)[source]

Validate that supplied/missing parameters match the selected diffusion model.

Return type:

None

Parameters:

model (DetectorDiffusionModel)