III. 3. C. Picking the PSF stars, and making the PSF: pickem3var.cl
Source code for pickem2var.cl can be obtained here.
Source code for fwhmed.f
Source code for pickem2var.cl can be obtained here.
Source code for phil2select.f can be obtained here.
Source code for mode2pick.f can be obtained here.
After much fiddling, we concluded that for the 4-m Mosaic data that the
PSF is variable even within the boundary of a single chip. Tests, using
a large aperture as the reference, convinced us that using a variable PSF
is the right then to do. So, we need
a lot of good PSF stars, and we need them well distributed over the chip.
We found the psfselect
routine to be inadequate for several reasons.
First, and foremost, it has no way to distinguish two blended stars that
were not detected as such by daofind. So, instead we use the aperture
corrections to determine if a single star is really single.
The script begins by dumping the ids, x and y positions, magnitude and error
from the *.mag.1 file into a tempoary file, "temppsf". The FORTRAN program
phil2select then goes through this file, selecting only stars which are truely well
isolated based upon the photometry list. These are put in the temporary
file "pospst". After exiting from the FORTRAN code, the script then
calls fwhmed.f,
which compares the fwhm's of these stars to that determined earlier by character3.cl,
and throws out any that are 15% larger or smaller. The script then
runs phot on these stars, using both a small and large aperture (3.5
and 15 pixels, with a sky annulus extending from 18 to 26 pixels.
A second FORTRAN mode2pick finds the modal aperture
correction in this bunch, and leaves the value sitting in a file
"temppst4". The FORTRAN code then selects stars which have aperture
corrections within 0.03 mag of the mode. Upon exiting the FORTRAN code,
the script then reads the aperture correction out of temppst4 and stores
it in the header as "apcor", and then proceeds to build a point spread
function using the "pst-like" list "temppst3", generated by mode2pick.
Up to 100 stars are used. Since the list has been sorted by magnitude,
stars from all around the frame are hopefully used.
In late-breaking news, if not enough stars are found for a good variable
PSF a constant PSF is determined. If there's not enough stars for that,
then the file is listed in "FAILED" and the routine moves on....