soxs_mbias

A zero-second exposure will contain only read-noise and ~half of pixels within this Gaussian distribution centred around zero count will always contain negative flux. To avoid negative counts an offset bias voltage is applied at the amplifier stage so that even when no photons are detected the A/D converter will always register a positive value. This bias-voltage offset must be accounted for in the data reduction process.

The purpose of the soxs_mbias recipe is to provide a master-bias frame that can be subtracted from science/calibration frames to remove the contribution of pixel counts resulting from the bias-voltage.

Input

Data Type Content Related OB
FITS images raw bias frames (UV-VIS/AC exposures with exptime = 0) SOXS_img_cal_Bias, SOXS_gen_cal_VISBias

Parameters

Parameter Description Type Entry Point Related Util
frame-clipping-sigma number of σ from the median frame flux beyond which pixel is added to the bad-pixel mask float settings file

clip_and_stack

clipping-iteration-count number of sigma-clipping iterations to perform when added pixels to the bad-pixel mask int settings file

clip_and_stack

stacked-clipping-sigma number of σ deviations from the median pixel flux beyond which pixel is excluded from stack float settings file

clip_and_stack

stacked-clipping-iterations number of σ-clipping iterations to perform before stacking float settings file

clip_and_stack

Input parameters for the soxs-mbias recipe

Method

The purpose of the soxs_mbias recipe is to stack raw bias-frames together (using the clip_and_stack utility) into master-bias frames and in the process clipping rogue pixels from the individual raw frames and reducing the read-noise contribution.

The workflow for the soxs mbias recipe

Output

Data Type Content
FITS image Master bias frame (frame containing typical bias-voltage applied to the detector)

QC Metrics

Metric Description
TBC

Recipe API

class soxs_mbias(log, settings=False, inputFrames=[], verbose=False, overwrite=False)[source]

The soxs_mbias recipe is used to generate a master-bias frame from a set of input raw bias frames. The recipe is used only for the UV-VIS arm as NIR frames have bias (and dark current) removed by subtracting an off-frame of equal expsoure length.

Key Arguments

  • log – logger

  • settings – the settings dictionary

  • inputFrames – input fits frames. Can be a directory, a set-of-files (SOF) file or a list of fits frame paths.

  • verbose – verbose. True or False. Default False

  • overwrite – overwrite the prodcut file if it already exists. Default False

Usage

from soxspipe.recipes import soxs_mbias
mbiasFrame = soxs_mbias(
    log=log,
    settings=settings,
    inputFrames=fileList
).produce_product()

Todo

  • add a tutorial about soxs_mbias to documentation

verify_input_frames()[source]

verify the input frame match those required by the soxs_mbias recipe

If the fits files conform to required input for the recipe everything will pass silently, otherwise an exception shall be raised.

produce_product()[source]

generate a master bias frame

Return:
  • productPath – the path to the master bias frame

qc_bias_structure(combined_bias_mean)[source]

calculate the structure of the bias

Key Arguments:
  • combined_bias_mean – the mbias frame

Return:
  • structx – slope of BIAS in X direction

  • structx – slope of BIAS in Y direction

Usage:

structx, structy = self.qc_bias_structure(combined_bias_mean)
qc_periodic_pattern_noise(frames)[source]

calculate the periodic pattern noise based on the raw input bias frames

A 2D FFT is applied to each of the raw bias frames and the standard deviation and median absolute deviation calcualted for each result. The maximum std/mad is then added as the ppnmax QC in the master bias frame header.

Key Arguments:
  • frames – the raw bias frames (imageFileCollection)

Return:

- ``ppnmax``

Usage:

self.qc_periodic_pattern_noise(frames=self.inputFrames)