soxspipe.recipes.soxs_mbias

*The recipe for creating master-bias frames *

Author

David Young & Marco Landoni

Date Created

January 22, 2020

Module Contents

Classes

soxs_mbias

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 exposure length.

API

class soxspipe.recipes.soxs_mbias.soxs_mbias(log, settings=False, inputFrames=[], verbose=False, overwrite=False, command=False, debug=False, turnOffMP=False)[source][source]

Bases: soxspipe.recipes.base_recipe.base_recipe

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 exposure 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 product file if it already exists. Default False

  • command – the command called to run the recipe

  • debug – debug mode. True or False. Default False

  • turnOffMP – turn off multiprocessing. True or False. Default False. If True, multiprocessing will be turned off and the recipe will run in serial. This is useful for debugging.

Usage

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

Initialization

clean_up(forceFail=False)[source]
clip_and_stack(frames, recipe, ignore_input_masks=False, post_stack_clipping=True)[source]
detrend(inputFrame, master_bias=False, dark=False, master_flat=False, order_table=False)[source]
flag_poor_data()[source]
get_recipe_settings()[source]
prepare_frames(save=False)[source]
produce_product()[source][source]

generate a master bias frame

Return:

  • productPath – the path to the master bias frame

qc_bias_structure(combined_bias_mean)[source][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_median_flux_level(frame, frameType='MBIAS', frameName='master bias', medianFlux=False)[source]
qc_periodic_pattern_noise(frames)[source][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)
qc_ron(frameType=False, frameName=False, masterFrame=False, rawRon=False, masterRon=False)[source]
report_output(rformat='stdout')[source]
subtract_mean_flux_level(rawFrame)[source]
update_fits_keywords(frame, rawFrames=False)[source]
verify_input_frames()[source][source]

verify the input frame match those required by the soxs_mbias recipe

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

xsh2soxs(frame)[source]