corgidrp.bad_pixel_calibration#

Functions#

create_bad_pixel_map(dataset, master_dark, master_flat)

Compute a fixed bad pixel map for EXCAM from a master dark and flat.

detect_hot_warm_pixels_from_dark(dark, dthresh)

Detects warm/hot pixels from the dark frame, flagging anything above

detect_dead_pixels_from_flat(flat, ffrac, fwidth)

Compute a fixed bad pixel map from a flat field.

Module Contents#

corgidrp.bad_pixel_calibration.create_bad_pixel_map(dataset, master_dark, master_flat, dthresh=5.0, ffrac=0.8, fwidth=32, dark_outputdir=None)[source]#

Compute a fixed bad pixel map for EXCAM from a master dark and flat.

Parameters:
  • dataset (corgidrp.data.Dataset) – A dataset that is ignored by this class.

  • master_dark (corgidrp.data.Dark or corgidrp.data.DetectorNoiseMaps) – a dark frame, or, if it is a Noise Map, a synthesized master is created using calibrated noise maps for the EM gain and exposure time used in master_flat

  • master_flat (corgidrp.data.FlatField) – A master flat field object.

  • dthresh (float) – Number of standard deviations above the mean to threshold for hot pixels. Must be >= 0.

  • ffrac (float) – Fraction of local mean value below which poorly-functioning pixels are flagged. Must be >=0 and < 1.

  • fwidth (int) – Number of pixels to include in local mean check with ffrac. Must be >0.

  • dark_outputdir (str) – if not None, a file directory to save any synthetic darks created from noise maps

Returns:

A 2-D boolean array the same size as dark and flat, with bad pixels marked as True.

Return type:

corgi.data.BadPixelMap

corgidrp.bad_pixel_calibration.detect_hot_warm_pixels_from_dark(dark, dthresh)[source]#

Detects warm/hot pixels from the dark frame, flagging anything above dthresh standard deviations above the mean dark level in the frame. For example, dthresh = 5 will flag any pixel > 5 standard deviations above the mean of dark.

Ported from II&T pipeline

Parameters:
  • dark (array_like) – 2-D array containing the master dark frame.

  • dthresh (float) – Threshold for flagging hot pixels, specified as the number of standard deviations above the mean dark level. Must be >= 0.

Returns:

A 2-D boolean array the same size as the input dark frame, with hot pixels marked as True.

Return type:

fixedbp_dark (array_like)

corgidrp.bad_pixel_calibration.detect_dead_pixels_from_flat(flat, ffrac, fwidth)[source]#

Compute a fixed bad pixel map from a flat field.

Detects low- or non-functional pixels from the flat frame, flagging any pixels less than ffrac times the local mean flat level. Flat uses local mean as flats may have low-spatial-frequency variations due to e.g. fringing or vignetting. For example, ffrac = 0.8 and fwidth = 32 will flag any pixel which is < 80% of the mean value in a 32-pixel box centered on the pixel. (Centration will use FFT rules, where odd-sized widths center on the pixel, and even-sized place the pixel to the right of center, e.g.:

odd: [. x .] even: [. . x .]

For boxes near the edge, only the subset of pixels within the box will be used for the calculation.

Ported from II&T pipeline

Parameters:
  • flat (array_like) – 2-D array containing the master flat field.

  • ffrac (float) – Fraction of the local mean value below which pixels are considered poorly-functioning.

  • fwidth (int) – Width of the box used to calculate the local mean, in pixels.

Returns:

A 2-D boolean array the same size as the input flat frame, with dead pixels marked as True.

Return type:

fixedbp_flat (array_like)