phcal¶
phcal converts the instrumental counts of a frame into photons, fluxes and
magnitudes, calibrated against a reference catalogue or an already calibrated
frame.
It matches the stars of the frame with the reference, fits the calibration
ratio CTPH (photons per count) and rewrites the image and the photometry
table in calibrated units. To correct for the difference between your filters
and a standard system, measure a transformation table with phfotran
and pass it with --tratab.
Usage¶
munipack phcal [options] file(s)[,result(s)]
Each frame needs an astrometric solution (astrometry), instrumental
photometry (aphot, gphot or psfphot), the date of
observation and a FILTER keyword. The exposure time and telescope area are
read from EXPTIME and AREA; if they are missing, phcal warns and uses
1 s and 1 m², so give --area when your headers lack it.
By default frame.fits is written as frame_cal.fits. Use -t to write
into another directory, or give input and output as one quoted argument
separated by a space: 'frame.fits result.fits'. The comma form shown by
--help does not work.
Options¶
Calibration source¶
Give exactly one of -c, -r or -C, always together with --photsys-ref.
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
file |
– |
Reference catalogue (FITS table, e.g. from |
|
file |
– |
A frame already calibrated by |
|
value(s) |
– |
Set CTPH by hand, one value per filter in the order of |
Catalogue and filters¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
list |
– |
Filters to calibrate, comma separated; frames are paired by their |
|
name |
|
Right Ascension column. |
|
name |
|
Declination column. |
|
list |
– |
Magnitude column(s), in the order of |
|
list |
none |
Magnitude error column(s); without them errors come from photon counts. |
|
file |
bundled |
VO catalogue configuration (column IDs of known catalogues). |
Star selection and matching¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
number |
0.1 |
Use only stars brighter than this multiple of the sky in the aperture. |
|
number |
0.1 |
Use only stars with a relative flux error below this. |
|
deg |
HWHM of the frame |
Cross-match radius. |
Which photometry¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
|
|
Photometry to calibrate: |
|
integer |
0 (automatic) |
Aperture number to use from the aperture photometry. |
|
|
|
Aperture correction: enclosed energy when available, none, or a constant factor. |
Errors and colour terms¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
|
|
Systematic error added to all errors: fitted, or a fixed value ( |
|
|
none |
Fit a colour term in the catalogue colour A − B; repeat for up to 3 colours. |
|
|
|
Linear or quadratic colour term (a list gives one per |
|
|
|
Colour at which CTPH is defined; fix it (e.g. |
|
|
|
Correct the colour term for the errors of the catalogue colours. |
Photometric systems and output units¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
name |
– |
Photometric system of the catalogue (required); bundled are |
|
name |
|
Instrumental photometric system. |
|
m² |
|
Area of the telescope’s entrance aperture. |
|
list |
|
Output quantities (see Output quantities). |
|
file |
none |
Transformation table made by |
|
file |
bundled |
Table of photometric system definitions. |
|
– |
– |
List the available photometric systems and exit. |
Output and general¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
– |
off |
Also keep the input extensions and add |
|
dir |
– |
Write outputs into this directory. |
|
– |
off |
Turn on advanced output names ( |
|
regex |
– |
Pattern for input names (with |
|
mask |
– |
Output name mask, e.g. |
|
format |
– |
Output file format (with |
|
– |
off |
Print the fit results. |
|
– |
– |
Show the help. |
How it works¶
phcal converts each catalogue magnitude into an expected number of
photons, using the passband of the photometric system, the exposure time and
the telescope area. CTPH is the ratio of these photons to the measured
counts; for counts in ADU it also contains the gain. The fit is robust: misidentified, blended or variable stars are
recognised as outliers and get no weight, so you do not need to clean the
catalogue by hand.
Calibrate the total flux. An aperture holds only part of a star’s light,
and that part changes across the field when the PSF does. To calibrate the
total flux, use gphot or psfphot photometry, or run aphot with an
enclosed-energy model and keep the default --apcorr auto.
Systematic error. By default phcal measures the extra scatter of the
calibration stars beyond their quoted errors and adds it to every output
error. With very few stars (it warns below 10) this estimate is little more
than a guess; then measure it from many frames of the same setup and pass a
fixed value, e.g. --syserr 0.02.
Colour terms. Your filter is never exactly the catalogue’s, so the
calibration depends slightly on the colour of the star. --color-term
fits this dependence in a catalogue colour. Stars without a catalogue colour
get the average correction, with a correspondingly larger error. If several
colours are given they must be independent (not u − g, g − r and u − r).
Colour terms need a catalogue (-c) and cannot be combined with -r or
--tratab.
Noisy catalogue colours. Errors in the catalogue colours flatten the
fitted colour term. When the colour columns come with error columns
(--color-term u,g,e_u,e_g), phcal corrects for this. With fewer than
about 17 stars the correction is unreliable, so it is skipped with a
warning. If your catalogue colours are more precise than their quoted
errors (e.g. frames simulated from the catalogue), use
--color-err-correct no, otherwise the colour term is over-corrected.
Several filters. Each filter is calibrated on its own, but only stars
present on all frames are used and written out. Colour corrections between
filters come only from --color-term or --tratab.
Output quantities¶
All quantities follow from the photon count n = CTPH × counts. Undefined magnitudes are written as 99.99999.
Quantity |
Meaning |
Unit |
|---|---|---|
|
photon count |
photon |
|
photon flux |
photon/s/m² |
|
photon flux per frequency |
photon/s/m²/Hz |
|
photon flux per wavelength |
photon/s/m²/nm |
|
energy flux in the band |
eV/s/m² |
|
flux density per frequency |
W/m²/Hz |
|
flux density per wavelength |
W/m²/nm |
|
magnitude in the photometric system |
mag |
|
AB magnitude |
mag |
|
ST magnitude |
mag |
Output¶
One calibrated file per frame; existing output files are overwritten. The
image is converted to photons. The PHOTOMETRY table gets the photon counts
and a value/error column pair for each -q quantity (e.g. MAG, MAGERR).
Its header holds CTPH, CTPHERR, the systematic error PHSYSERR, any
colour-term coefficients, and a list of the calibration stars.
Examples¶
Calibrate a V frame against a catalogue, writing magnitudes, flux densities and AB magnitudes:
munipack cone -c UCAC4 -o cat.fits -r 0.2 -- 110.47 71.34
munipack phcal -c cat.fits --photsys-ref Johnson -f V --col-mag Vmag --col-magerr e_Vmag \
-q MAG,FLAM,ABMAG frame_V.fits
Calibrate PSF photometry of B and V frames, fitting a colour term in B − V:
munipack phcal --photometry psf -c cat.fits --photsys-ref Johnson --area 0.3 \
-f V,B --col-mag Vmag,Bmag --col-magerr e_Vmag,e_Bmag \
--color-term Bmag,Vmag,e_Bmag,e_Vmag --verbose -t calibrated frame_B.fits frame_V.fits
Calibrate a later frame relative to one already calibrated:
munipack phcal --photsys-ref Johnson -r frame_001_cal.fits frame_002.fits