scopesim.effects.electronic module

Electronic detector effects - related to detector readout.

Classes: - DetectorModePropertiesSetter - set parameters for readout mode - AutoExposure - determine DIT and NDIT automatically - SummedExposure - simulates a summed stack of ndit exposures - PoorMansHxRGReadoutNoise - simple readout noise for HAWAII detectors - BasicReadoutNoise - readout noise - ShotNoise - realisation of Poissonian photon noise - DarkCurrent - add dark current - LinearityCurve - apply detector (non-)linearity and saturation - ReferencePixelBorder - BinnedImage - UnequalBinnedImage - Bias - adds constant bias level to readout

Functions: - make_ron_frame - pseudo_random_field

class scopesim.effects.electronic.AutoExposure(**kwargs)[source]

Bases: Effect

Determine DIT and NDIT automatically from ImagePlane.

DIT is determined such that the maximum value in the incident photon flux (including astronomical source, sky and thermal backgrounds) fills the full well of the detector (!DET.full_well) to a given fraction (!OBS.autoexposure.fill_frac). NDIT is determined such that DIT * NDIT results in the requested exposure time.

The requested exposure time is taken from !OBS.exptime.

The effects sets the parameters !OBS.dit and !OBS.ndit.

Examples

The parameters !OBS.exptime, !DET.full_well and !DET.mindit should be defined as properties in the respective subsections.

name: auto_exposure
description: automatic determination of DIT and NDIT
class: AutoExposure
include: True
kwargs:
    fill_frac: "!OBS.auto_exposure.fill_frac"
apply_to(obj, **kwargs)[source]

TBA.

estimate_dit_ndit(exptime: float, image_plane_max: float, **kwargs) tuple[float, int][source]

Automatically determine DIT and NDIT from exposure time.

Parameters:
exptimefloat

Exposure time in seconds.

image_plane_maxfloat

Maximum pixel value from image plane, used to avoid saturation.

Returns:
ditfloat

Detector Integration Time.

nditint

Number of Integrations.

required_keys = {'fill_frac', 'full_well', 'mindit'}
class scopesim.effects.electronic.BasicReadoutNoise(**kwargs)[source]

Bases: Effect

Readout noise computed as: ron * sqrt(NDIT).

apply_to(det, **kwargs)[source]

TBA.

plot(det)[source]
plot_hist(det, **kwargs)[source]
required_keys = {'ndit', 'noise_std'}
class scopesim.effects.electronic.Bias(**kwargs)[source]

Bases: Effect

Adds a constant bias level to readout.

apply_to(obj, **kwargs)[source]

TBA.

required_keys = {'bias'}
class scopesim.effects.electronic.BinnedImage(**kwargs)[source]

Bases: Effect

apply_to(det, **kwargs)[source]

TBA.

required_keys = {'bin_size'}
class scopesim.effects.electronic.DarkCurrent(**kwargs)[source]

Bases: Effect

required: dit, ndit, value

apply_to(obj, **kwargs)[source]

TBA.

plot(det, **kwargs)[source]
required_keys = {'dit', 'ndit', 'value'}
class scopesim.effects.electronic.DetectorModePropertiesSetter(**kwargs)[source]

Bases: Effect

Set mode specific curr_sys properties for different detector readout modes.

A little class (DetectorModePropertiesSetter) that allows different "!DET" properties to be set on the fly.

Parameters:
mode_propertiesdict

A dictionary containing the DET parameters to be changed for each mode. See below for an example yaml entry.

Examples

Add the values for the different detector readout modes to all the relevant detector yaml files. In this case the METIS HAWAII (L, M band) and GeoSnap (N band) detectors: METIS_DET_IMG_LM.yaml , METIS_DET_IMG_N.yaml

- name: lm_detector_readout_parameters
  class: DetectorModePropertiesSetter
  kwargs:
    mode_properties:
      fast:
        mindit: 0.04
        full_well: !!float 1e5
        ron: 70
      slow:
        mindit: 1.3
        full_well: !!float 1e5
        ron: 14

Add the OBS dict entry !OBS.detector_readout_mode to the properties section of the mode_yamls descriptions in the default.yaml files.

mode_yamls:
  - object: observation
    alias: OBS
    name: lss_l
    yamls:
      ...
    properties:
      ...
      detector_readout_mode: slow
apply_to(obj, **kwargs)[source]

TBA.

list_modes()[source]

Return list of available detector modes.

required_keys = {'mode_properties'}
select_mode(obj, **kwargs)[source]

Automatically select detector mode based on image plane peak value.

Select the mode with lowest readnoise that does not saturate the detector. When all modes saturate, select the mode with the lowest saturation level (peak to full_well).

class scopesim.effects.electronic.LinearityCurve(**kwargs)[source]

Bases: Effect

Detector linearity effect.

The detector linearity curve is set in terms of incident flux (e/s) and measured detector values (ADU).

Examples

The effect can be instantiated in various ways.:

- name: detector_linearity
  class: LinearityCurve
  kwargs:
    filename: FPA_linearity.dat

- name: detector_linearity
  class: LinearityCurve
  kwargs:
    array_dict: {incident: [0, 77000, 999999999999],
                 measured: [0, 77000, 77000]}

- name: detector_linearity
  class: LinearityCurve
  kwargs:
    incident: [0, 77000, 99999999]
    measured: [0, 77000, 77000]
apply_to(obj, **kwargs)[source]

TBA.

plot(**kwargs)[source]
required_keys = {'ndit'}
class scopesim.effects.electronic.PoorMansHxRGReadoutNoise(**kwargs)[source]

Bases: Effect

apply_to(det, **kwargs)[source]

TBA.

plot(det, **kwargs)[source]
plot_hist(det, **kwargs)[source]
required_keys = {'n_channels', 'ndit', 'noise_std'}
class scopesim.effects.electronic.Quantization(**kwargs)[source]

Bases: Effect

Converts raw data to whole photons.

apply_to(obj, **kwargs)[source]

TBA.

class scopesim.effects.electronic.ReferencePixelBorder(**kwargs)[source]

Bases: Effect

apply_to(implane, **kwargs)[source]

TBA.

plot(implane, **kwargs)[source]
class scopesim.effects.electronic.ShotNoise(**kwargs)[source]

Bases: Effect

apply_to(det, **kwargs)[source]

TBA.

plot(det)[source]
plot_hist(det, **kwargs)[source]
class scopesim.effects.electronic.SummedExposure(**kwargs)[source]

Bases: Effect

Simulates a summed stack of ndit exposures.

apply_to(obj, **kwargs)[source]

TBA.

required_keys = {'dit', 'ndit'}
class scopesim.effects.electronic.UnequalBinnedImage(**kwargs)[source]

Bases: Effect

apply_to(det, **kwargs)[source]

TBA.

required_keys = {'binx', 'biny'}
scopesim.effects.electronic.make_ron_frame(image_shape, noise_std, n_channels, channel_fraction, line_fraction, pedestal_fraction, read_fraction)[source]
scopesim.effects.electronic.pseudo_random_field(scale=1, size=(1024, 1024))[source]