psfphot¶
psfphot measures stars by fitting a model of the point spread function (PSF)
to each one.
Use it instead of aperture photometry when the field is crowded or when you
want the best precision on faint stars. Close neighbours are fitted together,
so blended stars get sensible fluxes. The stars come from find, and the
results go into a new PSFPHOT table in the same file. The measured flux,
PSFCOUNT, is the total flux of the star, so phcal can calibrate it
with --photometry psf.
Usage¶
munipack psfphot [options] file(s)
Run find first. Running aphot as well is recommended,
because psfphot takes the sky annulus and the starting sky from it; without
it, a default annulus just outside the fitting radius is used. The gain, read
noise and saturation level are read from the FITS header (GAIN, READNS or
RDNOISE, SATURATE); you can override them with the options below.
Choosing a PSF¶
GAUSS(default) orMOFFAT: an analytic profile. Its width (and the Moffat β) is fitted on bright, isolated stars unless you give it. Add--ellipticfor stars that are not round.FILE: a PSF file that can change over the field, in the same format that artificial--psf-filereads (see PSF files). This is the natural choice when you have a model of your optics.EMPIRICAL: the PSF is built from the stars of the frame itself, as an analytic core plus a table of corrections. It can vary over the field (--psf-var,--psf-var-radial). If you also give--psf-file, the file is used as a starting point and the frame only corrects it.
An empirical PSF needs enough bright, isolated, unsaturated stars, and they
should be mostly single stars, since any close companion goes into the PSF. If there are
too few for the requested variation, psfphot lowers the order and warns you.
Options¶
PSF model¶
Option |
Default |
Description |
|---|---|---|
|
|
The PSF type. |
|
— |
A PSF file; with |
|
fitted |
FWHM of the analytic PSF. |
|
fitted (2.5 with |
The Moffat exponent β. |
|
off |
Also fit the axis ratio and position angle. |
|
header (WCS) |
Plate scale used to place stars in a PSF file. |
|
|
Field centre of the PSF file [pix]. |
Empirical PSF¶
Option |
Default |
Description |
|---|---|---|
|
|
Analytic core of the empirical PSF. |
|
4 for FWHM < 5 px, else 2 |
Samples per pixel of the correction table. |
|
99.5 % of the flux, at least 4 × FWHM |
Radius of the correction table. |
|
0 |
Order of the variation in x, y over the field. |
|
0 |
Order of the variation with distance from the field centre. |
|
100 |
Maximum number of PSF stars. |
|
automatic |
Your own PSF stars: |
|
— |
Save the PSF as a PSF file (single input file only). |
|
by cross-validation |
Smoothing of the correction table. |
Fit¶
Option |
Default |
Description |
|---|---|---|
|
1.5 × FWHM, min. 3 |
Fitting radius. |
|
|
|
|
1.5 |
Stars closer than this are fitted together; |
|
50 |
Maximum iterations of one fit. |
|
3 |
Number of passes over all stars. |
|
header |
Saturation level; pixels at or above it are ignored. |
|
header |
Detector gain. |
|
header |
Read noise. |
Residuals¶
Option |
Default |
Description |
|---|---|---|
|
0 |
Passes that look for missed stars in the residual image. |
|
from the false-alarm rate (about 5 for 2048 × 2048) |
Detection threshold in the residuals. |
|
— |
Save the image with all fitted stars subtracted (single file only). |
Output and general¶
Option |
Description |
|---|---|
|
Write output files to this directory. |
|
Turn on advanced output filename processing. |
|
Matching pattern (for |
|
Mask for output files (for |
|
Format of output files (for |
|
Print the fitted PSF, the PSF stars and the groups. |
|
Show the help. |
Output¶
The PSFPHOT table has one row per FIND star, in the same order. Stars that
psfphot adds itself (saturated stars that find skipped, and stars found in
the residuals) follow at the end.
Column |
Description |
|---|---|
|
Fitted position and its errors [pix]. |
|
Total flux and its error [ADU]. |
|
Sky and its error [ADU]. |
|
Reduced χ² of the fit, about 1 for a good fit. |
|
Positive for objects sharper than the PSF (cosmic rays), negative for extended ones (galaxies, blends). |
|
Ellipticity of the star minus that of the PSF. |
|
Number of fitted pixels. |
|
Bit flags, see below. |
|
The group the star was fitted in (0 if alone) and its size. |
|
|
|
Meaning |
|---|---|
1 |
Saturated core; flux from the wings only. |
2 |
Some pixels in the fitting radius were excluded. |
4 |
Position not fitted (too faint, or the fit wandered off). |
8 |
The fit did not converge. |
16 |
The fit failed; the flux is not valid. |
32 |
Another star lies within the fitting radius. |
64 |
Saturated star added by |
128 |
Star found in the residuals. |
256 |
S/N below 2. |
Note
FLAG is a sum of bits, so test the bits you care about rather than
FLAG != 0. Bits 32 and 256 are common in crowded fields and do not make a
measurement bad. phcal picks its stars by their relative error, not by FLAG.
The table header records the PSF that was used (type, FWHM, shape) and the detector values.
Examples¶
Fit a Gaussian PSF with the width found automatically, then calibrate:
munipack find frame.fits
munipack aphot frame.fits
munipack psfphot --verbose frame.fits
munipack phcal --photometry psf -c cat.fits --col-ra RAJ2000 --col-dec DEJ2000 \
--col-mag Vmag --col-magerr e_Vmag --photsys-ref Johnson -f V frame.fits
Use an elliptical Moffat PSF with a locally fitted sky, and keep the residual image to check the fit by eye:
munipack psfphot --psf MOFFAT --elliptic --sky local --residual resid.fits frame.fits
Build an empirical PSF that varies over the field, save it, and reuse it on other frames:
munipack psfphot --psf EMPIRICAL --psf-var 2 --psf-save epsf.fits frame.fits
munipack psfphot --psf-file epsf.fits other.fits
Notes¶
A low-order variation in x, y cannot follow a PSF that changes shape strongly across the field. If the change follows the distance from the centre (typical of wide-field optics), use
--psf-var-radial; otherwise start from a model PSF file with--psf EMPIRICAL --psf-file.A file saved with
--psf-savecan also be read byartificial --psf-file. If the frame had no astrometry, use the file with--scale 1.Stars closer than about half the FWHM cannot be separated.