Flat-Illumination Scripts

FLAT0X

Flat-Fields

VIS Ground Calibration TEST: FLAT0X

Flat-fields acquisition / analysis script

Created on Tue Aug 29 17:32:52 2017

author

Ruyman Azzollini

class vison.flat.FLAT0X.FLAT0X(inputs, log=None, drill=False, debug=False, cleanafter=False)
build_scriptdict(diffvalues={}, elvis='7.5.X')

Builds FLAT0X script structure dictionary.

Parameters

diffvalues – dict, opt, differential values.

do_indiv_flats()

METACODE

Preparation of data for further analysis and
produce flat-field for each OBSID.

f.e. ObsID:
    f.e.CCD:

        load ccdobj

        f.e.Q:

            model 2D fluence distro in image area
            produce average profile along rows
            produce average profile along cols

        save 2D model and profiles in a pick file for each OBSID-CCD
        divide by 2D model to produce indiv-flat
        save indiv-Flat to FITS(?), update add filename

plot average profiles f. each CCD and Q (color coded by time)
do_master_flat()

METACODE

Produces Master Flat-Field

f.e.CCD:
    f.e.Q:
        stack individual flat-fields by chosen estimator
save Master FF to FITS
measure PRNU and
report PRNU figures
do_prdef_mask()

METACODE

Produces mask of defects in Photo-Response
Could use master FF, or a stack of a subset of images (in order
to produce mask, needed by other tasks, quicker).

f.e.CCD:
    f.e.Q:
        produce mask of PR defects
        save mask of PR defects
        count dead pixels / columns

report PR-defects stats
filterexposures(structure, explog, OBSID_lims)
inputsclass

alias of FLATS0X_inputs

prepare_images()

FLAT0X: Preparation of data for further analysis. Calls task.prepare_images().

Applies:

offset subtraction [bias structure subtraction, if available] cosmetics masking

set_inpdefaults(**kwargs)
class vison.flat.FLAT0X.FLATS0X_inputs(*args, **kwargs)

NL02

Non-linearity

VIS Ground Calibration TEST: NL02

Similar to NL01, but using 2 wavelengths:
  • ND4 for low fluences

  • 880 nm for high fluences

  • Also possible to use with different values of RD (stability tests)

End-To-End Non-Linearity Curve

Tasks:

  • Select exposures, get file names, get metadata (commandig, HK).

  • Check exposure time pattern matches test design.

  • Check quality of data (rough scaling of fluences with Exposure times).

  • Subtract offset level.

  • Divide by Flat-field.

  • Synoptic analysis:

    fluence ratios vs. extime ratios >> non-linearity curve

  • extract: Non-Linearity curve for each CCD and quadrant

  • produce synoptic figures

  • Save results.

Created on Tue Oct 23 15:22:00 2018

author

raf

class vison.flat.NL02.NL02(inputs, log=None, drill=False, debug=False, cleanafter=False)
build_scriptdict(diffvalues={}, elvis='7.5.X')

Builds NL02 script structure dictionary.

debug_NLPTC()
do_satCTE()

METACODE

select ObsIDs with fluence(exptime) >~ 0.5 FWC

f.e. ObsID:
    CCD:
        Q:
            measure CTE from amount of charge in over-scan relative to fluence

f.e. CCD:
    Q:
        get curve of CTE vs. fluence
        measure FWC from curve in ADU

report FWCs in electrons [via gain in inputs] f.e. CCD, Q (table)
extract_PTC()

Extractin a binned PTC (binned to marginalise BF).

inputsclass

alias of NL02_inputs

prep_data()

Takes Raw Data and prepares it for further analysis.

METACODE

f.e. ObsID:
    f.e.CCD:
        f.e.Q:
            mask-out bad pixels
            mask-out detector cosmetics
            subtract offset
            opt: [sub bias frame]
produce_NLCs()

METACODE

Obtains Best-Fit Non-Linearity Curve

f.e. CCD:
    f.e. Q:

        [opt] apply correction for source variability (interspersed exposure
          with constant exptime)
        Build NL Curve (NLC) - use stats and exptimes
        fit poly. shape to NL curve

plot NL curves for each CCD, Q
report max. values of NL (table)
simulNL()
class vison.flat.NL02.NL02_inputs(*args, **kwargs)

PTC0X

Photon-Transfer Curves

VIS Ground Calibration TEST: PTC0X

Photon-Transfer-Curve Analysis

PTC01 - nominal temperature and wavelength PTC02 - alternative temperatures / wavelengths / RD

Tasks:

  • Select exposures, get file names, get metadata (commandig, HK).

  • Check exposure time pattern matches test design.

  • Check quality of data (rough scaling of fluences with Exposure times).

  • Subtract pairs of exposures with equal fluence

  • Synoptic analysis:

    variance vs. fluence variance(binned difference-frames) vs. fluence

  • extract: RON, gain, gain(fluence)

  • produce synoptic figures

  • Save results.

Created on Mon Apr 3 17:00:24 2017

author

raf

class vison.flat.PTC0X.PTC0X(inputs, log=None, drill=False, debug=False, cleanafter=False)
build_scriptdict(diffvalues={}, elvis='7.5.X')

Builds PTC0X script structure dictionary.

#:param exptimes: list of ints [ms], exposure times. #:param frames: list of ints, number of frames for each exposure time. #:param wavelength: int, wavelength. Default: 800 nm. :param diffvalues: dict, opt, differential values.

debug_PRE_HER()
debugtask()
extract_HER()

Hard Edge Response Analysis.

Extraction of overscan profiles (also parallel, for satCTE analysis).

extract_PTC()
Performs basic analysis of images:
  • builds PTC curves: both on non-binned [and binned images]

METACODE

create list of OBSID pairs

create segmentation map given grid parameters

f.e. OBSID pair:
    CCD:
        Q:
            subtract CCD images
            f.e. segment:
                measure central value
                measure variance
f_extract_PTC(ccdobjcol, medcol, varcol, binfactor=1)
filterexposures(structure, explog, OBSID_lims)
inputsclass

alias of PTC0X_inputs

make_plotBM_dict(bmcdp)
meta_analysis()

Analyzes the variance and fluence: gain, and gain(fluence)

METACODE

f.e. CCD:
    Q:
        (using stats across segments:)
        fit PTC to quadratic model
        solve for gain
        solve for alpha (pixel-correls, Guyonnet+15)
        solve for blooming limit (ADU)
            convert bloom limit to electrons, using gain

plot PTC curves with best-fit f.e. CCD, Q
report on gain estimates f. e. CCD, Q (table)
report on blooming limits (table)
produce_Bloom_Maps(debug=False)
set_inpdefaults(**kwargs)
class vison.flat.PTC0X.PTC0X_inputs(*args, **kwargs)

BF01

Brighter-Fatter (using data from PTC0X tests)

VIS Ground Calibration TEST: BF01

Brighter-Fatter Analysis

Using data from test PTC01 or PTC02

Created on Wed Mar 7 10:57:00 2018

author

raf

class vison.flat.BF01.BF01(inputs, log=None, drill=False, debug=False, cleanafter=False)
build_scriptdict(diffvalues={}, elvis='7.5.X')

Builds PTC0X script structure dictionary.

#:param exptimes: list of ints [ms], exposure times. #:param frames: list of ints, number of frames for each exposure time. #:param wavelength: int, wavelength. Default: 800 nm. :param diffvalues: dict, opt, differential values.

correct_BFE_G15()
debugtask()
Performs basic analysis of images:
  • extracts COVARIANCE matrix for each fluence

extract_BF()
Performs basic analysis of images:
  • extracts BF matrix for each COV matrix

extract_COV()
Performs basic analysis of images:
  • extracts COVARIANCE matrix for each fluence

extract_PTCs()
f_correct_BFE_G15(ccdobjname, fixA=False)

Applies BFE solutions from G+15 to images, to later test effectivity through PTC.

filterexposures(structure, explog, OBSID_lims)
inputsclass

alias of BF01_inputs

meta_analysis()

Analyzes the BF results across fluences.

set_inpdefaults(**kwargs)
class vison.flat.BF01.BF01_inputs(*args, **kwargs)
vison.flat.BF01.correct_BFE_one_image(q, dd, inputs, iObs, nObs, CCDs, Quads, picklespath, Asol)
vison.flat.BF01.fit_BF(X, Y)
vison.flat.BF01.process_one_fluence_covmaps(q, dd, dpath, CCDs, jCCD, ku, ulabels, **kwargs)