slotphot – Photometry from SALT slot mode image data
slotphot images outfile srcfile (newfits) (phottype) (subbacktype) (sigback) (mbin) (iter) (sorder) (sigdet) (contpix) (ignorexp) (reltime) (finddrift) (clobber) (logfile) (verbose) (debug)
String. Name of the file defining the raw CCD pixel position of two sources in the image data and defining the size of circular aperture for the extraction of source counts and and a circular annulus for the extraction of background counts. The file format is an ascii table with 7 columns and 2 rows. An example is provided below:
# star amplifier x y r r_bkg1 r_bkg2
# ---------------------------------------
1 3 193 11 12 13 14
2 3 37 12 12 13 14
Rows beginning with the character ‘#’ are ignored. Column 1 contains a numeric flag for the star which is either 1 or 2. The tool will follow any source drift over the image over time, always using star 2 as the ‘guide star’ The output file will always contain the source count ratio Star 1 / Star 2, never the inverse ratio. Column 2 of the srcfile contains the amplifier on which a source is detected. There are a maximum of four amplifiers for SALTICAM data and six amplifiers for RSS data. Note that there is no functionality currently to accurately extract source counts which fall across amplifier boundaries. Both sources are required to be on the same amplifier. Column 3 is the position of a source in (binned) CCD pixel units in the x-direction, or if you prefer the column number. Column 4 refers to the corresponding y- or row coordinate. Both x and y can be routintely read off of your ds9 viewer. Column 5 contains the radius of the circular extraction region for the source counts. Columns 6 and 7 contain the inner and outer radii of the annulus used to extract background counts for each source. Any of the radial parameters are permitted to fall off of the edges of the image without breaking the tool, some loss of performace should be expected but the tool does take the image edges into account during calculations. However, the onus is on the user to ensure that x and y are contained within the first image of the input list.
This tool has been developed primarily to perform aperture photometry on SALTICAM slot mode data, and also perhaps Frame Transfer mode data which is an order of magntiude slower in frame rate. A specific SLOT mode tool was required in order to process the large body of image data in a reasonable amount of time. It is recommended that raw images be processed by the tool saltslot prior to aperture photometry.
Photometry is extracted from two user-defined sources contained in the input images. For the time being, both sources have to be on the same amplifier (extension). Source positions and extraction regions are defined in a user-prepared ascii table, fIsrcfilefR. The sources often drift around the slot on timescales of minutes. It is necessary therefore for saltphot to follow the sources over time, updating the postions in fIsrcfilefR frequently.
If selected, a global background will be subtracted from the data. The user options allow for three different options. One, no background can be subtrated. Two, the subtracted background can be created from a median smoothing of the image. Bright sources will be excluded from the image by setting the sigback value, and any pixel above that value will be replaced with the sigma-clipped mean background value of that row. The median smoothed image will have a filter window equal to mbin and the filtering will be repeated the number of times indicated by the iter parameter. Three, a median of a row will be subtracted from each row.
To capture the drift of the source, the algorithm first tries to find the source in the same coordinates as indicated by the user. If the source is found within a box of size 2r (where r is specificied in the srcfile for the companion star), then the companion star x and y values are updated and a similar shift is applied to the target stars coordinates. If the companion star is not found, the search is expanding to the columns within +-r of the original x coordinates. Objects are detected in these columns and the nearest star is selected as the comparison star. If the comparison star is still not found, the search is expanding to the entire image and the nearest star is found. If no star is find at all, the coordinates revert back to the last set of identified coordinates. The user can also set the maximum search area for the star by setting the driftlimit parameter. If the star is not found in that circle, no new coordinates will be set.
Once the companion and target star are found, photometry is performed on both sources. The options of the photometry are square, circular, cog, and optimal. Square photometry performs a single square aperture photometry around both sources. The local sky background is calculated in a square apreture defined by br1 and br2 in the srcfile and subtracted from the calculated magnitude. Circular photometry performs the same task except with circular, not square, apertures. For the circular photometry, no sub-pixel sampling occurs.
Curve of growth phtometry is performed by the cog function. N number of apertures ranging from a minimum of 2 pixels to a maximum of br2, where N is given by the r value of the comparison star in the srcfile. Then, the radius with the maximum signal to noise is calculated. Photometry for both the comparison star and target star are both given within this square aperture.
Finally, optimal photometry calculates the flux ratio between the comparison and target star by minimizing the X^2 difference between the two stars. The PSF of the comparison star is assumed to be the model, and the follow equation is minimized for h:
X^2=sum(T_ij - hxC_ij)**2/sigma_ij**2
In this equation, T_ij is the background subtract flux of the target source, C_ij is the background subtracted flux of the comparison star, sigma_ij is the variance in each pixel, and h is the normalization of the comparison star psf to the target star. The summation is done over a square aperture with sides of length 2r. If sigma_ij is assumed to be a constant for all pixels ( which is true for background limit observations, but also minimizes the dependance of h with the brightness of the star), then h is given by:
h = sum(T_ij x C_ij)/ sum(C_ij**2)
For optimal photometry, h is returned as the flux ratio, and the brightness of the target star is reported as hxC_ij.
Errors reported for all photometry types are calculated as the quadratic sum of the source flux, read noise, sky variance, and error in the measurement of the sky flux. The flux error is given by:
sigma**2=flux+area*rdnoise**2+area*berr**2+area**2*berr**2/npix
where flux is the counts for the source, area is the area of the aperture, rdnoise is the read noise, berr is the background error, and npix is the number of pixels used to determine the background error.
All results are written out to a file. The format of the output file records an id number, the time, the flux ratio, flux ratio error, the target x, y, flux, and flux error values, and comarison x, y, flux, and flux error values. The time is either the absolute time or the relative time since the first exposure depending on the reltime parameter.
If newfits is specified (not blank or ‘none’), then a new fits file will be created with the filename specified in the newfits parameter. The fits file will be a multi-extension fits file wher each extension will be an image that contains the target and comparison star (essentially removing all of the extensions in the image list that do not contain useful images).
Once the newfits file has been satisfactorily created, this file can be used in slotphot by setting ampperccd=0 and updating the other settings. The srcfile must be updated so the amplifier of the sources is set to 1. In addition, the newfits file should be set to ‘none’, the subbacktype should be updated, and ignorexp should be set to zero. Then, by setting the just created newfits file as the input img, slotphot will only perform photometry on this image.
To extract counts from two field stars over a series of exposures:
--> saltphot images="*.fits" outfile="result.dat" srcfile="targets.dat"
newfits='out.fits', subbacktype='median', phottype='optimal',
sigback=2.5, mbin=7, iter=3, sorder=3, sigdet=5, contpix=10,
ignorexp=0 reltime=y finddrift=y clobber=y logfile=salt.log
verbose=y
A linux machine with 2 GB of RAM and a 2.8 Ghz processer was able to process one 4x4 binned SALTICAM slotmode exposures in 0.08 seconds. The data were median backgroun subtracted, finddrift=y, and optimal photometry was performed.
The current version of SLOTPHOT has been tested only on SALTICAM slot mode data. Counts from only two stars can be extracted during one execution. Both sources must be on the same amplifier.
Send feedback and bug reports to salthelp@saao.ac.za