| wcsxymatch | images.immatch | wcsxymatch |
wcsxymatch -- match input and reference image x-y coordinates using the WCS
wcsxymatch input reference output
If the units are not specified the default is "native".
WCSXYMATCH matches the logical x and y pixel coordinates of a set of points in the input image input with the logical x and y pixels coordinates of the same points in the reference image reference using world coordinate information in the respective image headers, and writes the results to a coordinate file output suitable for input to the GEOMAP task. The input and reference images may be 1D or 2D but must both have the same dimensionality.
If coords = "grid", WCSXYMATCH computes a grid of nx * ny logical x and y pixel coordinates evenly distributed over the logical pixel space of the reference image as defined by the xmin , xmax , ymin , ymax parameters. The logical x and y pixel reference image coordinates are transformed to the world coordinate system defined by wcs using world coordinate information stored in the reference image header. The world coordinates are then transformed back to the logical x and y pixel input image coordinates, using world coordinate system information stored in the input image header.
If coords is a file name, WCSXYMATCH reads a list of x and y reference image world coordinates from columns xcolumn and ycolumn in the input coordinates file, and transforms these coordinates to "native" coordinate units using the xunits and yunits parameters. The reference image world coordinates are transformed to logical reference and input image coordinates using the value of the wcs parameter and world coordinate information in the reference and input image headers.
WCSXYMATCH will terminate with an error if the reference and input images are not both either 1D or 2D. If the world coordinate system information cannot be read from either the reference or input image header, the requested transformations from the world <-> logical coordinate systems cannot be compiled for either or both images, or the world coordinate systems of the reference and input images are fundamentally imcompatible in some way, the output logical reference and input image coordinates are both set to a grid of points spanning the logical pixel space of the input, not the reference image, and defining an identify transformation, is written to the output file.
The computed reference and input logical coordinates and the world coordinates are written to the output file using the xformat and yformat , and the wxformat and wxformat parameters respectively. If these formats are undefined and, in the case of the world coordinates, a format attribute cannot be read from either the reference or the input images, the coordinates are output with the %g format and min_sigdigits of precision.
If the reference and input images are 1D then the output logical and world y coordinates are set to 1.
If verbose is "yes" then a title section is written to the output file for each set of computed coordinates, along with messages about what if anything went wrong with the computation.
A format specification has the form "%w.dCn", where w is the field width, d is the number of decimal places or the number of digits of precision, C is the format code, and n is radix character for format code "r" only. The w and d fields are optional. The format codes C are as follows:
b boolean (YES or NO)
c single character (c or '\c' or '\0nnn')
d decimal integer
e exponential format (D specifies the precision)
f fixed format (D specifies the number of decimal places)
g general format (D specifies the precision)
h hms format (hh:mm:ss.ss, D = no. decimal places)
m minutes, seconds (or hours, minutes) (mm:ss.ss)
o octal integer
rN convert integer in any radix N
s string (D field specifies max chars to print)
t advance To column given as field W
u unsigned decimal integer
w output the number of spaces given by field W
x hexadecimal integer
z complex format (r,r) (D = precision)
Conventions for w (field width) specification:
W = n right justify in field of N characters, blank fill
-n left justify in field of N characters, blank fill
0n zero fill at left (only if right justified)
absent, 0 use as much space as needed (D field sets precision)
Escape sequences (e.g. "\n" for newline):
\b backspace (not implemented)
\f formfeed
\n newline (crlf)
\r carriage return
\t tab
\" string delimiter character
\' character constant delimiter character
\\ backslash character
\nnn octal value of character
Examples
%s format a string using as much space as required
%-10s left justify a string in a field of 10 characters
%-10.10s left justify and truncate a string in a field of 10 characters
%10s right justify a string in a field of 10 characters
%10.10s right justify and truncate a string in a field of 10 characters
%7.3f print a real number right justified in floating point format
%-7.3f same as above but left justified
%15.7e print a real number right justified in exponential format
%-15.7e same as above but left justified
%12.5g print a real number right justified in general format
%-12.5g same as above but left justified
%h format as nn:nn:nn.n
%15h right justify nn:nn:nn.n in field of 15 characters
%-15h left justify nn:nn:nn.n in a field of 15 characters
%12.2h right justify nn:nn:nn.nn
%-12.2h left justify nn:nn:nn.nn
%H / by 15 and format as nn:nn:nn.n
%15H / by 15 and right justify nn:nn:nn.n in field of 15 characters
%-15H / by 15 and left justify nn:nn:nn.n in field of 15 characters
%12.2H / by 15 and right justify nn:nn:nn.nn
%-12.2H / by 15 and left justify nn:nn:nn.nn
\n insert a newline
Additional information on IRAF world coordinate systems including more detailed descriptions of the "logical", "physical", and "world" coordinate systems can be found in the help pages for the WCSEDIT and WCRESET tasks. Detailed documentation for the IRAF world coordinate system interface MWCS can be found in the file "iraf$sys/mwcs/MWCS.hlp". This file can be formatted and printed with the command "help iraf$sys/mwcs/MWCS.hlp fi+ | lprint". Information on the spectral coordinates systems and their suitability for use with WCSXYMATCH can be obtained by typing "help specwcs | lprint". Details of the FITS header world coordinate system interface can be found in the document "World Coordinate Systems Representations Within the FITS Format" by Hanisch and Wells, available from our anonymous ftp archive.
1. Compute a matched list of 100 logical x and y coordinates for an X-ray and radio image of the same field, both of which have accurate sky projection world coordinate systems. Print the output world coordinates in hh:mm:ss.ss and dd:mm:ss.s format
cl> wcsxymatch image refimage coords wxformat=%12.2H \ wyformat=%12.1h
2. Given a list of ras and decs of objects in the reference image, compute a list of matched logical x and y coordinates for the two images, both of which have a accurate sky projection wcss. The ras and decs are in columns 3 and 4 of the input coordinate file and are in hh:mm:ss.ss and dd:mm:ss.s format respectively. Print the output world coordinates in the same units as the input.
cl> wcsxymatch image refimage coords coords=radecs \ xcolumn=3 ycolumn=4 xunits=hours wxformat=%12.2H \ wyformat=%12.1h
tprecess,wcstran,geomap,register,geotran,wcsmap,wregister