Skip to content
Epzack edited this page Aug 27, 2021 · 17 revisions

Steps (photometry\reduction\steps)

Prepare

Prepares the data by converting the multi-header extension FITS files to a standard single frame, adding extra information to the header, and removing extraneous headers. Creates a binary image containing detailing the saturated pixels for each frame. Then preforms bias and dark subtraction via master bias and master dark files.

In: raw object files in selected folder (*.fits), master bias (bias_*.fits) , (if applicable) master dark (dark_*.fits).

Out: bias and dark subtracted frames (p*.fits), binary saturation image (SAT_*.fits).

flow_prepare

Functions

Called Externally

  • autopipedefaults - Set commonly used variables to use throughout each step.
  • autopipeprepare - Detects master bias/dark and runs pipeprepare on valid frames, assigns 'p' prefix.

Called Internally

  • pipeprepare - Normalize header keywords in FITS files and performs bias/dark subtraction.
  • find_sats - Creates a binary image detailing saturated pixels.

Flatten

Flattens the data by dividing each image by the flatfield (master flat). A more refined cropping is also done at this stage, depending on the placement of the image area during the run (which is variable.)

In: Bias/dark subtracted frames (p*.fits), master flat (flat_*.fits).

Out: Flattened frames (fp*.fits).

flow_flatten

Functions

Called Externally

  • autopipeimflatten - Detects master flat, calls flatpipeproc, appends 'f' prefix.

Called Internally

  • flatpipeproc - Check if flat is same size as data, then divide for correct filter.

Makesky

Makes a master sky for each filter to be used for sky subtraction. If skyflattarg == True then will construct a master sky for each target/filter combination. A master sky is created by first making a 3D stack of images with the same filter or filter/target. Then it identifies which pixels are considered source pixels and excludes them. Then it take the sigma clipped median pixel by pixel across the stack of images. Any overlapping source pixels across all images are interpolated over.

Note: Master sky keywords are taken from the middle image of the stack of images. Many keywords will not be useful.

In: Flattened frames (fp*.fits).

Out: Master sky (eg. sky-Z.fits or sky-Z_GRB180618A.fits), (if debug == True) a binary plot detailing which pixels are being masked (sky-*skymask.fits)

flow_makesky

Functions

Called Externally

  • autopipemakesky - Creates a stack of images by filter or by unique filter/target combinations, calls call_skypipecombine.

Called Internally

Skysub

Subtracts out master sky and median if mastersky == True, or else subtracts only the median. If skyflattarg == True will search for master sky of the form sky-FILTER_TARGNAME.fits, or else of the form sky-FILTER.fits.

In: Flattened frames (fp*.fits), Master sky (eg. sky-Z.fits or sky-Z_GRB180618A.fits).

Out: Sky subtracted frames (sfp*.fits).

flow_skysub

Functions

Called Externally

  • autopipeskysubmed - Subtracts median, does not use master sky, appends 's' prefix.
  • autopipeskysub - Locates appropriate master sky file, calls skypipeproc, appends 's' prefix.

Called Internally

  • skypipeproc - Subtracts master sky flat from data, then subtracts median of that from remaining data.

Crclean

Removes cosmic rays using the independent routines cosmics.py that use Laplacian cosmic ray identification. This process can be skipped with nocrclean = True in autoproc

This can be a time-consuming process.

In: Sky subtracted frames (sfp*.fits)

Out: Cosmic ray removed frames (zsfp*.fits).

flow_crclean

Functions

Called Externally

  • autopipecrcleanim - Calls cosmiczap, appends 'z' prefix.

Called Internally

  • cosmiczap - Remove cosmic rays using Laplacian cosmic ray identification written in cosmics.py.

Astrometry

Solves the astrometry of the field against the best available online catalog (SDSS/2MASS/PanSTARRs/APASS/USNO-B1.0), using the independent vlt_autoastrometry.py code. (Also requires sextractor to be installed.)

Uses two passes of Scamp for a secondary correction. Scamp accounts for distortion. Uses higher distortion parameters if already supplied distortion keywords.

In: Cosmic ray zapped frames (zsfp*.fits)

Out: Astrometry corrected frames (azsfp*.fits).

flow_astrometry

Functions

Called Externally

  • autopipeastrometry - Calls vlt_autoastrometry.py for initial coordinate correction, calls astrometry twice for coordinate refinements, appends 'a' prefix.

Called Internally

  • astrometry - Run sextractor and scamp to refine astrometric solution.

Zpoint

Calculates zero point and flux scale for each field to be used in stacking via a weighted masked median. It first finds sources via sextractor. Then it constructs a catalogue based off of a either a passed in custom catalogue (customcat) or creates a catalogue using get_SEDs.py. It identifies and matches the extracted sources and the catalogue sources. Then it removes sources containing saturated pixels using SAT_*.fits files. Then it calculates the zero point using a robust scatter method. Then it calculates the flux scale and removes frames with a bad zero point or flux scale. This step heavily utilizes methods from autoproc_depend.py.

In: Astrometry corrected frames (azsfp*.fits), binary saturation image (SAT_*.fits).

Out: Zero point calibrated frames (tazsfp*.fits), Coordinates of saturated sources (SATcoords_.txt), (if debug == True) a plot of difference between catalogue and observed magnitudes before/after zero point calculation ('zptall_.png'/zpt_*.png) and a histogram of magnitude errors for all observed sources (zptall_hist_*.png).

flow_zpoint

Functions

Called Externally

  • autopipezpoint - Extracts sources via autoproc_depend/findsexobj, creates catalogue using get_SEDs.py, identifies matches between extracted sources and catalogue via autoproc_depend/identify_matches, removes saturated sources, calculates zeropoint using autoproc_depend/calc_zpt, calculates flux scale, removes bad frames, appends 't' prefix.

Called Internally

Stack

Uses flux scale to stack images using Swarp. Extracts sources via autoproc_depend/findsexobj, creates catalogue using get_SEDs.py, identifies matches between extracted sources and catalogue via autoproc_depend/identify_matches, reads coordinates of saturated sources from SATcoords_*.txt and removes those sources, calculates the absolute zeropoint using autoproc_depend/calc_zpt. Saves coadded images.

In: Zero point calibrated frames (tazsfp*.fits), Coordinates of saturated sources (SATcoords_*.txt).

Out: Coadded images (coadd[object].[filter].fits), (if debug == True) a plot of difference between catalogue and observed magnitudes before/after zero point calculation ('zptall_COADD_*.png'/zpt_COADD_*.png) and a histogram of magnitude errors for all observed sources (zptall_hist_COADD_*.png).

flow_stack

Functions

Called Externally

  • autopipestack - Uses flux scale to stack images in Swarp, calculates absolute zero point correction, and save Coadded images.

Called Internally

Clone this wiki locally