detrend

For the UVB-VIS arm, we will often need to scale the master-dark frame to match the exposure time of our science/calibration frame. If this is the case, the master-bias frame needs to be subtracted from the master-dark frame before scaling. However, if the master-dark frame has the same exposure time as your science/calibration frame, it can be subtracted directly from the frame, as this serves to remove the bias and dark-current contributions simultaneously.

This logic is all housed within the detrend method.

Fig. 68 The algorithm used to detrend raw images.

Utility API

detrend(inputFrame, master_bias=False, dark=False, master_flat=False, order_table=False)[source]

subtract calibration frames from an input frame

Key Arguments:

  • inputFrame – the input frame to have calibrations subtracted. CCDData object.

  • master_bias – the master bias frame to be subtracted. CCDData object. Default False.

  • dark – a dark frame to be subtracted. CCDData object. Default False.

  • master_flat – divided input frame by this master flat frame. CCDData object. Default False.

  • order_table – order table with order edges defined. Used to subtract scattered light background from frames. Default False.

Return:

  • calibration_subtracted_frame – the input frame with the calibration frame(s) subtracted. CCDData object.

Usage:

Within a soxspipe recipe use detrend like so:

myCalibratedFrame = self.detrend(
    inputFrame=inputFrameCCDObject, master_bias=masterBiasCCDObject, dark=darkCCDObject)