WCSstandards, an automatic standard star photometry package

This page describes the WCSstandards routine I wrote in IRAF and Perl to perform automatic photometry on standard stars. It uses the WCS information in the image headers to locate stars in the Stetson catalog, and then uses IRAF to perform aperture photometry and solve for the zeropoint extinction and colour terms.

The package can be downloaded here.

This package relies on IRAF packages APPHOT and PHOTCAL, the WCS tools package by Doug Mink (and also the fits header utilities from the same author), and of course the standard star catalog of Peter Stetson (available at this CADC page), together with the Landolt catalog for the U band. I am grateful to all of these authors for their work.

Below is the information in the README file found in the package. Please send any comments, bug reports or questions to csnodgra (at) eso.org.

Readme for WCSstandards package, by C. Snodgrass, ESO 
---------------------------------------------------------------------

This package automatically finds standard stars in images, performs photometry
on them, and then solves for the zeropoint. It relies on there being reasonable
WCS information in the headers of the (.fit or .fits) images. It uses apphot for
the photometry and can use the interactive fitparams (photcal package) to solve
for the zeropoint, extinction and colour terms. 

The code is one .cl script (WCSstandards.cl), which calls various perl scripts
to manipulate the output coordinate and photometry files. It requires that the
WCStools package and the fits header utilities (both by Doug Mink, see
http://tdc-www.harvard.edu/wcstools/ ) are available in the path. One needs to
set the enviroment variable WCSSTANDARDS_PATH to the directory where the codes
and other necessary files (catalogues, defaults files) are located (ie, here).

The catalogue used is a modified version of the Stetson catalogue, available at
http://www2.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/community/STETSON/archive/
which I extended to include all of Landolt's measurements, including the U band.

to run it, enter iraf (cl) and type:
cl> task WCSstandards="$PATH/WCSstandards.cl"
cl> WCSstandards $INSTRUMENT inter+ displ+ refine+ fix- tidy-

each of the options (inter, displ, refine, fix, tidy) can be negated if you
don't want interactive solving for the zeropoints, display of the images (and
marking of matched star positions) or automatic refinement of the star 
positions,respectively. The option fix uses imwcs to refine the image wcs
solution, which is useful when the pointing / wcs accuracy is worse than the
refine option can cope with. For this option the environment variable UB1_PATH
needs to be set, to either a local copy of the USNO B1 catalog or a suitable
server (eg http://archive.tuc.noao.edu/cgi-bin/scat ). The tidy option deletes
temporary files at the end of the run, but uses wildcards so should be used
carefully if the working directory contains other files you want to keep.

INSTRUMENT should be the name of the instrument you are solving for. The 
instrument must have .config, .cfg and .defaults file in $WCSSTANDARDS_PATH.
Currently these files are available for instruments:
	EFOSC2
	FORS2

N.B. on properly set up systems (correct .cshrc and iraf login.cl) the path
     environment variable will already be set, and the WCSstandards routine
     will be loaded into iraf (no need to type task.... as above).

-------

notes from WCSstandards.cl header:

#
# C. Snodgrass, ESO
#
# Automatically measure standard star photometry.
# Only works on Stetson standard field images with WCS information 
# (Stetson includes most Landolt fields)
# -> use stetson-extended.cat, modified to contain all Landolt and also U band.
#
# Will go through all .fits files in the current directory, and measure 
# photometry on any standard star within them.
#
# Remember to type within IRAF
# cl> task WCSstandards = "$path/WCSstandards.cl"
# 
# Also, you should set the environment variable WCSSTANDARDS_PATH to the script
# directory in your (eg) .cshrc file:
# > setenv WCSSTANDARDS_PATH ~/iraf-files/scripts/WCSstandards
# and, in case you want to use the 'fix wcs' option, imwcs requires that the
# environment variable UB1_PATH is pointing to the USNO B1 catalog:
# > setenv UB1_PATH=http://archive.tuc.noao.edu/cgi-bin/scat
# will set it to retrieve the required regions automatically from NOAO.
# 
# Inputs:   1. 	requires name of instrument - $instrument.config must exist in
#	  	scripts directory. 
#	    2. 	interactive: boolean (inter+ or inter-) for interactive fitting
#	   	using IRAF photcal/fitparams
#	    3. 	display: boolean (displ+ or displ-) for displaying images
#	   	and overlaying coordinates
#	    4.	refine: boolean (ref+ or ref-) for refining positions based on 
#		stars found in 1st pass (picks up fainter stars 2nd time)
#	    5.	fix: boolean (fix+ or fix-) for fixing image wcs with imwcs,
#		in case offset is too large for refine to find stars.
#		NB, if fix+ then refine is not required: set refine- for speed
#	    6.	tidy: boolean (tidy+ or tidy-) cleans up temp files at end.
#		Be careful! This calls: delete("*.standards.*")
#					delete("*.match")
#					delete("*.cmd*")
#					delete("*.cat")
#		so don't use this option if you have other files that match!
#
# Outputs:  1.	$instrument.$filter.zeropoint.txt -> files for each filter with
#		results
#	    2.	$instrument.$filter.zeropoint.ps -> graph of mag vs catalog mag 
#		for non-interactive version
#	    3.	$instrument.ans -> fitparams output file
#	    
#	    4.  various working files (matched photometry, star positions etc) 
#		are also left in working directory if tidy is false
#
# Requires: 	make-command-file.pl	-> read fits headers, get star positions
#		refine-shifts.pl	-> improves star positions
#		match-standard-stars.pl -> match photometry with catalog stars
#		read-fitparams-out.pl	-> output zeropoints from fitparams to 
#					   screen and file
#		zeropoints.pl		-> non-interactive zeropoint finding
#
#		stetson-extended.cat	-> photometry catalog
#
#		$instrument.config	-> contains header translation keys.
#		$instrument.defaults	-> contains default ZP, ext, colour term
#		$instrument.cfg		-> defines equations for fitparams
#
#		All of these files should be in $WCSSTANDARDS_PATH/
#
#HISTORY:
#
# 30/7/08 - 1st version