acdc.dark_correction

Perform a custom dark correction on COS/FUV data. For each input science exposure, a quiescent and an active superdark of the appropriate segment+HV combination are used to determine the dark rate of the science exposure. A custom dark correction is then applied using this model dark rate, creating custom corrtag products. These corrtags are calibrated using CalCOS to create custom x1d files. x1d files should be coadded offline in order to increase SNR.

Classes

Acdc

Perform a custom dark correction on COS/FUV data.

class Acdc(indir, darkcorr_outdir, x1d_outdir=None, binned=True, segment=None, hv=None, overwrite=False, exclude_airglow=False, superdark_dir=None, superdarks=None, calibrate=True)[source]

Bases: object

Perform a custom dark correction on COS/FUV data.

indir

Input directory that houses corrtags to correct.

Type:

str

darkcorr_outdir

Custom dark-corrected corrtags will be written here.

Type:

str

x1d_outdir

Custom dark-corrected x1ds will be written here.

Type:

str

binned

If True, pre-binned superdarks will be used.

Type:

Bool

corr_dict

Dictionary where each key is the segment+HV setting and each value is a list of all corrtags with that setting.

Type:

dict

custom_corrtags

List of corrtags which have had the custom dark correction applied.

Type:

list

dark_dict

Nested dictionary where each key is the segment+HV setting and each value is a dictionary where each key is the type of superdark (either ‘active’ or ‘quiescent’) and each value is the superdark name.

Type:

dict

Parameters:
  • indir (str) – Input directory that houses corrtags to correct.

  • darkcorr_outdir (str) – Custom dark-corrected corrtags will be written here.

  • x1d_outdir (str) – Custom dark-corrected x1ds will be written here.

  • binned (Bool) – If True, pre-binned superdarks will be used.

  • superdark_dir (str) – Location of superdarks.

calibrate_corrtags()[source]

Calibrate custom dark-corrected corrtags to product x1ds.

Calibrate each custom dark-corrected corrtag using the BOXCAR extraction method in CalCOS. The TWOZONE extraction method does not work with BACKCORR=OMIT.

custom_dark_correction()[source]

Perform the custom dark correction.

For each corrtag, use the superdarks to predict the dark rate across the entire detector. Then use this predicted dark rate to perform a custom dark correction to each corrtag.

get_best_superdarks(superdarks)[source]

Sort superdarks into a dictionary based on segment and HV setting.

Returns:

dark_dict (dict) – Dictionary where each key is the segment+HV setting and each value is a list of all applicable superdarks.

sort_corrtags(corrtags)[source]

Sort corrtags into a dictionary. If specified, filter corrtags based on segment and HV setting.

Parameters:

corrtags (array-like) – All corrtags to be corrected.

Returns:

corr_dict (dict) – Dictionary where each key is the segment+HV setting and each value is a list of all corrtags with that setting.