soxs_mdark

Every raw CCD image contains counts resulting from a ‘dark current’, electrons released due to the thermal effects in the CCD material. For both the UVB-VIS (< 0.00012 \(\rm{e^{-}/s/pixel}\)) and NIR detectors (< 0.005 \(\rm{e^{-}/s/pixel}\)), the dark current is almost negligible. Not all pixels will have the same dark current, with some pixels having a higher-than-typical current. These are so-called ‘hot-pixels’, and these must be identified and recorded (using the create_noise_map utility).

The purpose of the soxs_mdark recipe is to generate a master-dark frame used to remove flux attributed to the dark current from other frames.

Input

Table 50 Input files for the soxs_mdark recipe. The files are typically passed to the soxs_mdark recipe via a set-of-file (sof) file listing one file per line.

Data Type

Content

Related OB

Min. Frame Count

FITS images

raw dark frames (exposures with identical exposure time and detectors readout parameters).

SOXS_gen_cal_VISDark, SOXS_gen_cal_NIRDark, SOXS_img_cal_Dark

3

Table 51 Ancillary (static) files required by the soxs_mdark recipe. These files are packaged with and shipped with the code.

Data Type

Content

FITS images

Default bad-pixel map

Parameters

Table 52 The soxs_mdark recipe parameters.

Parameter

Description

Type

Entry Point

Related Util

frame_clipping_sigma

number of \(\sigma\) from the median frame flux beyond which pixel is added to the bad-pixel mask

float

settings file

clip_and_stack

frame_clipping_iterations

number of \(\sigma\)-clipping iterations to perform when adding pixels to the bad-pixel mask

int

settings file

clip_and_stack

stacked_clipping_sigma

number of \(\sigma\) deviations from the median pixel flux beyond which pixel is excluded from stack

float

settings file

clip_and_stack

stacked_clipping_iterations

number of \(\sigma\)-clipping iterations to perform before stacking

int

settings file

clip_and_stack

Method

The raw dark frames are stacked together (using the clip_and_stack utility) into master-dark frames and, in the process, clipping rogue pixels from the individual raw frames and reducing the read-noise contribution. The algorithm used in the soxs_mdark recipe is shown in Fig. 36.

Fig. 36 The soxs-mdark recipe algorithm.

Output

Table 53 Output files for the soxs_mdark recipe and their respective ESO PRO keywords.

Label

Content

Data Type

PRO CATG

PRO TYPE

PRO TECH

MDARK

Master dark frame (frame containing typical dark-current flux accumulated over the exposure time of the input frames)

FITS image

DARK_<ARM>

REDUCED

IMAGE

QC Metrics

Table 54 Quality Control metrics calculated in the soxs_mdark recipe.

Label

Description

Unit

Acceptable Range

HOTPIX FRAC

Fraction of hot pixels

-

-

MDARK MEDIAN

Median flux level of master dark

electrons

NIR: [-15, 50]

HOTPIX NUM

Number of hot pixels

-

-

RAW RON

RON in single DARK

electrons

NIR: [0,30]

Recipe API

class soxs_mdark(log, settings=False, inputFrames=[], verbose=False, overwrite=False, command=False, debug=False, turnOffMP=False)[source]

Bases: soxspipe.recipes.base_recipe.base_recipe

The soxs_mdark recipe generates a master-dark frame used to remove flux attributed to the dark current from other frames.

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_mdark
mdarkFrame = soxs_mdark(
    log=log,
    settings=settings,
    inputFrames=fileList,
    verbose=False,
    overwrite=False
).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]

generate a master dark frame

Return:

  • productPath – the path to master dark frame

qc_median_flux_level(frame, frameType='MBIAS', frameName='master bias', medianFlux=False)[source]
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]

verify input frame match those required by the soxs_mdark 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]