Flat

Overview

This file describes the data model for the Flat. It is a series of images starting from the combination of all input pixelflat frames.

The images are written to disk as a multi-extension FITS file prefixed by Flat in the Calibrations/ folder. See Calibration Frame Naming for the naming convention.

Inspecting

PypeIt provides the pypeit_chk_flats script to inspect the key Flat outputs.

The script usage can be displayed by calling the script with the -h option:

$ pypeit_chk_flats -h
usage: pypeit_chk_flats [-h] [--type TYPE] [--try_old] file

Display flat images in Ginga viewer

positional arguments:
  file         PypeIt Flat file [e.g. Flat_A_1_DET01.fits]

options:
  -h, --help   show this help message and exit
  --type TYPE  Which flats to display. Must be one of: pixel, illum, all
               (default: all)
  --try_old    Attempt to load old datamodel versions. A crash may ensue..
               (default: False)

pypeit_chk_flats

This script takes a Flat as input and displays a series of images in a ginga viewer, each in a separate tab.

Here is a typical call:

pypeit_chk_flats Calibrations/Flat_A_1_DET01.fits

Below we describe the standard products. There is enough variation from spectrograph to spectrograph that we have not included example screen-shots.

Raw Flat

This is the processed and combined pixelflat image. Despite the name, it is not completely raw.

This image should look like any one of your input pixelflat images.

Pixel Flat

This is the normalized to unity image which is used to correct for pixel-to-pixel variations across the detector.

It should look mainly like a salt-and-pepper, random-noise image fluctuating very close around values of 1.

For many detectors there may be ‘pock’ marks, columns, and even funny patterns.

It is also typical for the extreme spectral portions (top/bottom) to have more structure or pattern noise. This is especially true if there is limited flux at these ends (e.g. the data goes below the atmospheric cutoff).

Illumination Flat

This image should also have most values near unity, but there will be vertical coherence. And the edges (left/right) may fall off well below unity.

Flat Model

This image should largely resemble the Raw Flat.

Troubleshooting

If one or more of your image appears to be in err, here are the things to consider:

  • Is one or more of your flat frames junk?

  • Is one or more of your input flat frames mis-labeled?

  • Did you saturate portions of the flat?

Current FlatImages Data Model

Internally, the image is held in FlatImages which subclasses from pypeit.datamodel.DataContainer.

The datamodel written to disk is:

Version 1.1.2

HDU Name

HDU Type

Data Type

Description

PRIMARY

astropy.io.fits.PrimaryHDU

Empty data HDU. Contains basic header information.

PIXELFLAT_RAW

astropy.io.fits.ImageHDU

float64

Processed, combined pixel flats

PIXELFLAT_NORM

astropy.io.fits.ImageHDU

float64

Normalized pixel flat

PIXELFLAT_MODEL

astropy.io.fits.ImageHDU

float64

Model flat

PIXELFLAT_SPAT_ID-?-BSPLINE

astropy.io.fits.BinTableHDU

bspline model of the pixelflat for spat_id=?; see bspline

PIXELFLAT_SPAT_ID-?-FINECORR

astropy.io.fits.BinTableHDU

2D polynomial fits to the fine correction of the spatial illumination profile of the pixelflat for slit_id=?; see PypeItFit

PIXELFLAT_BPM

astropy.io.fits.ImageHDU

int16

Mirrors SlitTraceSet mask for flat-specific flags

PIXELFLAT_SPEC_ILLUM

astropy.io.fits.ImageHDU

float64

Relative spectral illumination

PIXELFLAT_WAVEIMG

astropy.io.fits.ImageHDU

float64

Waveimage for pixel flat

ILLUMFLAT_RAW

astropy.io.fits.ImageHDU

float64

Processed, combined illum flats

ILLUMFLAT_SPAT_ID-?-BSPLINE

astropy.io.fits.BinTableHDU

bspline model of the illumflat for spat_id=?; see bspline

ILLUMFLAT_SPAT_ID-?-FINECORR

astropy.io.fits.BinTableHDU

2D polynomial fits to the fine correction of the spatial illumination profile of the illumflat for slit_id=?; see PypeItFit

ILLUMFLAT_BPM

astropy.io.fits.ImageHDU

int16

Mirrors SlitTraceSet mask for flat-specific flags

SPAT_ID

astropy.io.fits.ImageHDU

int64

Slit spat_id