Munipack's logo

Astrometry

Astrometrical calibration of FITS images.

Introduction

Optical devices maps spherical coordinates like Right Ascension or Declination to pixels. The astrometrical calibration is an inverse operation deriving the coordinates from a captured picture of a star field. The calibration can be mathematically described as two-step procedure. Firstly, the spherical coordinates are mapped (by gnomonical or another projection) on to rectangular coordinates and than the affine transformation (rotation, shift, scaling) is applied.

A known calibration can be stored in FITS image header. When an image is correctly calibrated, the direct transformation between pixels and spherical coordinates can be established.

screenshot
Panel with the coordinate indicator

How to describe of the astrometry calibration

The set of parameters used for interaction with user is different to set of parameters used in FITS header table, where the parameters are stored. The main reason for that is use of orthogonal parameters and robust fitting. In case of direct manipulation with parameters, use FITS utilities.

The meaning of parameters:

Projection
The type of projection of spherical coordinates onto rectangular. Currently only gnomonical projection is implemented.
Center of image: xcen,ycen
A point around its the image is rotated in rectangular coordinates. Usually center of image (half of image dimension). Parameters are directly saved at CRPIXx keyword.
Center of projection: acen,dcen
Center of projection of spherical coordinates. One corresponds with center of image in case of successful fitting. Parameters are directly saved at CRVALx keyword.
Scale c
Scale of image as ratio of pixels per degrees.
Angle of rotation φ
The angle around which the image is rotated at point xcen, ycen.

Astrometry calibration

Munipack provides calibration via astrometry module. The module offers these types of calibration:

Manual
Fully manual, all values are provided by an user. Detected objects or a catalogue are not required.
Fit
The parameters initially set by an user are used for fitting. The transformation is quite precise, but requires both detected stars and a catalogue.
Match
The initial parameters and correspondence between stars in a catalogue and detected objects is set by matching. Both detected stars and a catalogue is required, but no initial parameters are required. Precise transformation is reached by optional fitting.

Manual calibration

To write a calibration to FITS header, find the parameters by hand and type

$ munipack astrometry --disable-fit --disable-match -W --proj=GNOMONIC \
            --xcen=255 --ycen=170 --acen=110.471 --dcen=71.351 \
            --scale=5.64e-04 --angle=0.0 -o 0716_1R.fits

This is an example for blazar 0716+71 which observation is in FITS file 0716_1R.fits included to munipack-blazar.tar.gz.

Fitting and matching calibration

Before fitting can be started, we need provide a catalogue with stars and detects objects on the image.

The object detection is relative easy (detected objects are saved as the last HDU):

$ munipack -f 2 -t 5 photometry 0716_1R.fits

A catalogue with reference stars can be easy with help of Virtual Observatory:

$ munipack -t fits -o 0716_cat.fits --cat=UCAC3 -s "f.mag" \
           -r 0.2 cone 110.25,71.34

Note selection of catalogue UCAC3. The objects stored to the output file are sorted by magnitude designed as "f.mag". You must known catalogue structure before use (simply get catalogue without -s option, look for structure and than use -s with right parameter). Sorting importantly increase probability of successful matching.

The fitting procedure is started as

$ cp 0716_1R.fits 0716_cal.fits
$ munipack astrometry --disable-match -W --key-alpha="RAJ2000" \
           --key-delta="DEJ2000" --proj=GNOMONIC --xcen=255 --ycen=170 \
           --acen=110.4743 --dcen=71.3508 --scale=5.6616e-4 --angle=0 \
           -c 0716_cat.fits -o 0716_cal.fits  0716_1R.fits

Note initial file copy. We are working on copy of that original to prevent data loss in case of any fail.

In case of matching, when your are a lucky user, following command would give you excellent job:

$ cp 0716_1R.fits 0716_cal.fits
$ munipack  -W --proj=GNOMONIC --key-alpha="RAJ2000" --key-delta="DEJ2000" \
            -c 0716_cat.fits -o 0716_cal.fits  0716_1R.fits astrometry

Fine tune of calibration

The reference catalog matching with a detected stars is extremely difficult problem. Some parameters can help tune matching and fitting algorithms.

In doubts, check ones:

Astrometry transformation included to FITS

The transformation is stored in a selected FITS keywords. The original data are not affected by the astrometry calibration.

The affine transformation (translation, rotation, scale, mirroring, etc.) uses keywords described in table.

KeyDescription
CRTYPE1projection type along horizontal axis
CRTYPE2projection type along vertical axis
CRPIX1horizontal coordinate (in pixels) of center of rotation
CRPIX2vertical coordinate (in pixels) of center of rotation
CRVAL1longitudinal-like world coordinate (in degrees) of CRPIX1
CRVAL2latitudinal-like world coordinate (in degrees) of CRPIX2
CD1_1-cos φ ⋅ c
CD1_2-sin φ ⋅ c
CD2_1-sin φ ⋅ c
CD2_2cos φ ⋅ c

The φ is the angle of rotation about center (position angle). The c is the scale in pixels per degrees.

The possible mappings uses keywords described in table.

ValueProjection
RA--TAN, DEC--TANGnomonic

(Yes, Just only Gnomonic is implemented).

The detailed description of FITS world coordinates is in Greisen and Calabretta: A & A, 395, 1061-1075 (2002). See also links in FITS Support Office.

Synopsis

Usage: munipack [-c <str>] [-t <str>] [-o <str>] [-W] [--proj <str>] [--xcen <str>] [--ycen <str>] [--acen <str>] [--dcen <str>] [--scale <str>] [--angle <str>] [--disable-fit] [--tol <str>] [--disable-match] [--nmatch <str>] [--maxmatch <str>] [--uradius <str>] [--validity <str>] [--key-alpha <str>] [--key-delta <str>] [-h] [--verbose] astrometry [file(s)...]
  -c:<str>         	reference catalog
  -t:<str>         	reference table (image)
  -o:<str>         	output FITS
  -W, --wcs-write  	write WCS to header
  --proj=<str>     	projection: identity, gnomonic(default)
  --xcen=<str>     	center pixel for rotation (half of width of image)
  --ycen=<str>     	center pixel for rotation (half of height of image)
  --acen=<str>     	center projection in Right Ascension [deg]
  --dcen=<str>     	center projection in Declination [deg]
  --scale=<str>    	scale [deg/pix]
  --angle=<str>    	position angle [deg]
  --disable-fit    	disable fitting
  --tol=<str>      	uncertainty of centroids of objects [pix]
  --disable-match  	disable inital matching
  --nmatch=<str>   	no. stars in match sequence
  --maxmatch=<str> 	no. stars for matching
  --uradius=<str>  	tol. radius in triangle space
  --validity=<str> 	acceptable validity level
  --key-alpha=<str>	name of Right Ascension column in catalog
  --key-delta=<str>	name of Declination column in catalog

Example

An example of calibration included in FITS header follows (irrelevant lines are hidden).

NAXIS   =                    2 / number of data axes
NAXIS1  =                  765 / length of data axis 1
NAXIS2  =                  510 / length of data axis 2
CTYPE1  = 'RA---TAN'           / the coordinate type for the first axis
CTYPE2  = 'DEC--TAN'           / the coordinate type for the second axis
CRVAL1  = 2.6944069055870182E+02 / [deg] first axis value at reference pixel
CRVAL2  = 4.6930039119824798E+00 / [deg] second axis value at reference pixel
CRPIX1  = 3.8250000000000000E+02 / x-coordinate of reference pixel
CRPIX2  = 2.5500000000000000E+02 / y-coordinate of reference pixel
CD1_1   = -3.7717763701937851E-04 / partial of first axis coordinate w.r.t. x
CD1_2   = 1.4673394322043144E-05 / partial of first axis coordinate w.r.t. y
CD2_1   = 1.4673394322043144E-05 / partial of second axis coordinate w.r.t. x
CD2_2   = 3.7717763701937851E-04 / partial of second axis coordinate w.r.t. y
COMMENT Astrometric solution:
COMMENT No. of objects used = 8
COMMENT Residual sum =     0.8325448827     ["]
COMMENT RMS =     0.4080551146     ["]
COMMENT Scale =      1.358866619     +-  2.12E-04 ["/pix]
COMMENT cos(pa) =    0.9992441307 +-  1.17E-07
COMMENT sin(pa) =    0.0388737341 +-  3.00E-06
COMMENT Position angle (pa)  =    2.2278622479 +-  1.72E-04 [deg]
COMMENT RA  center projection (CRVAL1) =  269.4406905587 +-  8.28E-07 [deg]
COMMENT Dec center projection (CRVAL2) =    4.6930039120 +-  8.59E-07 [deg]
COMMENT RA,Dec [deg]                centroids [pix]       residuals["]
COMMENT  269.46645390   4.70561220  315.840  290.982   -21.2E-03   -54.7E-03
COMMENT  269.46575330   4.60649810  307.327   28.288   162.6E-03  -390.4E-03
COMMENT  269.53804220   4.65767420  122.113  171.831  -138.4E-03   478.1E-03
COMMENT  269.47676000   4.68059670  286.103  225.963   -58.9E-03   143.2E-03
COMMENT  269.37093860   4.68203110  565.604  218.981  -259.8E-03   254.0E-03
COMMENT  269.51065610   4.69915030  198.361  278.256   231.7E-03  -288.0E-03
COMMENT  269.42034500   4.73162720  440.132  354.947    18.5E-03  -287.9E-03
COMMENT  269.36353280   4.66275830  582.924  167.138    64.4E-03   154.2E-03

The calibration can be easy understand:

Copyright © 1997-2011, F. Hroch (✉, Blog⤴), DTFA, Masaryk University.