ART Data Reduction Pipeline
This package takes raw images and calibration frames and returns cleaned images and photometric lightcurves for the object of interest. It consists of three routines:
art_calibrate.py
art_extract
art_phot.py
The routines are used in the above order. The first and last are python scripts and are called from the command line by:
python /path/to/script.py
art_extract is a c shell script and can be called form the command line by:
/path/to/art_axtract
An outline of each of the routines is given below.
art_calibrate
Purpose: Takes raw science frames and calibration frames. Bias and flat field corrects the science frames.
Input:
- Name of the target object (for naming of images)
- Location of the bias frames
- Location of the flat field frames
- Location of the science frames
- Wildcard specifications of the bias, flat field and science frames (eg. B*.fit for bias frames)
Edit the lines indicated at the top of the script to change the input.
Output:
- Master bias frame (in bias frame directory)
- Bias subtracted flat field frames (called Flatcal001.fit etc. in flat field frame directory)
- Master flat field frame and normalised master flat field frame (in flat field frame directory)
- Bias corrected science images in science/image/location/Less_bias/
- Bias and flat field corrected science images in science/image/location/Cal/
Caution:
- Images must all have the same dimensions
- If images already exist they will not be re-calculated
- If you have over 1000 images, make sure they are named Example-0001.fit etc. rather than Example-001.fit. Images names can be changed using Automator in mac. Choose ‘Files and Folders’ and then ‘Get specified Finder items’ and ‘Replace Text’. Then you can select your files and replace ‘-’ with ‘-0’.
Requires:
- Pyraf
- Pyfits
- Spicy
- glob
- os
art_extract
Purpose: Cleans the calibrated images of bad pixels and cosmic rays using BCLEAN. Extracts the fluxes of objects in the field using S-extractor.
Usage:
- Move the SE_config directory to the directory containing the corrected science frames.
- Change directory to the SE_config directory.
- Run art_extract from the command line
- To change BCLEAN parameters, edit line 31 of art_extract.
- To change S-extractor parameters, edit the existing configuration file (or create a new one). The configuration file is specified in line 39.
Output:
. Cleaned images in the directory CleanImages
. S-extractor output catalogues in the PhotCatalogues directory
Requires:
- Starlink (Figaro, Convert)
- S-extractor
art_phot
Input:
- Location of S-extractor output catalogues
- Location of calibrated science frames (to construct time array)
- Wild card specifications of catalogues and images
- Where output is to be stored
- Number of parameters returned in the S-extractor catalogue (inspect a catalogue to find this)
- Columns corresponding to x, y and flux in the S-extractor catalogue. Note that first column is 0, second is 1 etc. (inspect a catalogue to find these).
- Positions of the target and reference stars. Use GAIA to inspect a clean image to find these.
- Threshold for target and reference star fluxes. If the flux falls below its threshold, the star is no longer recognised.
- Portion of lightcurve to zoom in on (inspect the output before deciding this)
Edit the lines indicated at the top of the script to change the input.
Output:
Numpy save file with time (Julian Date) and normalised flux arrays. Access this from within a python session by:
. import numpy as np
. arrays = np.load(‘/path/to/flux_ratio_save.npz’)
. time = arrays[‘arr_0’]
. flux = arrays[‘arr_1’]
Numpy save files with time and reference star flux ratio arrays (not normalised).
A .dat file containing time (Julian Date) and normalised flux columns.
.dat files containing time and reference star flux ratio (one for each reference star).
Plots of raw flux and normalised flux ratio versus time (lightcurves) with a zoomed in portion also plotted.
Note:
- To add more reference stars, change line 76
- To change the plots produced, change from line 203 onwards
Requires:
- glob
- pyfits
- numpy
- math
- os
- matplotlib
Author: Rebecca Feeny-Barry: December 2012