3.2.3. extractStripes

Extracts the stripes from the original 2D spectrum to a sparse array, containing only relevant pixels.

This function marks all relevant pixels for extraction. Reinterpreting the flat reference it iterates over all stripes in the image and saves a sparse matrix for each stripe.

3.2.3.1. Parameters

adinputslist of AstroData

Input science frames.

suffixstr

Suffix to be added to output files.

flatstr or AstroData, optional

Processed flat frame. If None, queries the calibration database.

darkstr or AstroData, optional

Processed dark frame. If None, queries the calibration database.

dark_subtraction_skip_fiberslist of int, optional

Fiber numbers (1-5) to skip dark frame subtraction.

straylight_removal_fiberslist of int, optional

Fiber numbers (1-5) for which straylight will be removed.

slit_heightint

Total slit height in px.

test_extractionbool

Used in unit test for this function, saves science extraction, flat extraction, and the bpm-extraction in FITS-readable format (STRIPES, F_STRIPES, STRIPES_MASKS).

reportbool

Passed along to the straylight removal primitive.

3.2.3.2. Returns

list of AstroData

Input frames with sparse matrices added holding the 2D extractions for each fiber/order for the science frame, flat frame, and BPM. Extensions added:

  • STRIPES : science frame stripes.

  • F_STRIPES : flat frame stripes.

  • STRIPES_MASKS : bad pixel mask stripes.

If test_extraction=True, the extensions are stored in FITS-readable format instead of sparse matrix format.

3.2.3.3. Parameter defaults and options

suffix               ''                   Filename suffix
flat                 None                 Processed flat
dark                 None                 Processed dark
dark_subtraction_skip_fibers None                 Fiber numbers (1-5) to skip dark frame subtraction.
straylight_removal_fibers None                 Fiber numbers (1-5) for which straylight will be removed.
slit_height          10                   Pixel illumination in cross-dispersion
test_extraction      False                Save in FITS-readable format for testing
legacy               False                Legacy patch
report               True                 Generate PDF diagnostic report

3.2.3.4. Algorithm

Todo

add description

3.2.3.5. Issues and Limitations

Todo

add description