aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/imcoords/doc
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/images/imcoords/doc
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/images/imcoords/doc')
-rw-r--r--pkg/images/imcoords/doc/ccfind.hlp596
-rw-r--r--pkg/images/imcoords/doc/ccget.hlp463
-rw-r--r--pkg/images/imcoords/doc/ccmap.hlp1028
-rw-r--r--pkg/images/imcoords/doc/ccsetwcs.hlp562
-rw-r--r--pkg/images/imcoords/doc/ccstd.hlp480
-rw-r--r--pkg/images/imcoords/doc/cctran.hlp412
-rw-r--r--pkg/images/imcoords/doc/ccxymatch.hlp781
-rw-r--r--pkg/images/imcoords/doc/hpctran.hlp109
-rw-r--r--pkg/images/imcoords/doc/imcctran.hlp598
-rw-r--r--pkg/images/imcoords/doc/mkcwcs.hlp93
-rw-r--r--pkg/images/imcoords/doc/mkcwwcs.hlp110
-rw-r--r--pkg/images/imcoords/doc/skyctran.hlp861
-rw-r--r--pkg/images/imcoords/doc/starfind.hlp304
-rw-r--r--pkg/images/imcoords/doc/wcsctran.hlp340
-rw-r--r--pkg/images/imcoords/doc/wcsedit.hlp429
-rw-r--r--pkg/images/imcoords/doc/wcsreset.hlp272
16 files changed, 7438 insertions, 0 deletions
diff --git a/pkg/images/imcoords/doc/ccfind.hlp b/pkg/images/imcoords/doc/ccfind.hlp
new file mode 100644
index 00000000..33eceb7c
--- /dev/null
+++ b/pkg/images/imcoords/doc/ccfind.hlp
@@ -0,0 +1,596 @@
+.help ccfind Jun99 images.imcoords
+.ih
+NAME
+ccfind -- locate objects in an image given a celestial coordinate list and
+the image wcs
+.ih
+USAGE
+ccfind input output image
+.ih
+PARAMETERS
+.ls input
+The list of input celestial coordinate files. Coordinates may be entered
+by hand by setting input to "STDIN". A STDIN coordinate list is terminated
+by typing <EOF> (usually <ctrl/d> or <ctrl/z>).
+.le
+.ls output
+The list of output matched coordinate files. The computed pixel values
+are appended to the input coordinate file line and written to output. The number
+of output files must equal the number of input files. Results may be
+printed on the terminal by setting output to "STDOUT".
+.le
+.ls image
+The list of input images associated with the input coordinate files. The number
+of input images must equal the number of input coordinate files.
+.le
+.ls lngcolumn = 1, latcolumn = 2
+The input coordinate file columns containing the celestial ra / longitude and
+dec / latitude coordinates respectively.
+.le
+.ls lngunits = "", latunits = ""
+The units of the input ra / longitude and dec / latitude coordinates. The
+options are "hours", "degreees", and "radians" for ra / longitude and
+"degrees" and "radians" for dec / latitude. If lngunits and latunits are
+undefined they default to the preferred units for the coordinates
+system specified by \fIinsystem\fR, e.g. "hours" and "degrees" for
+equatorial systems and "degrees" and "degrees" for ecliptic, galactic, and
+supergalactic systems.
+.le
+.ls insystem = "j2000"
+The input celestial coordinate system. The \fIinsystem\fR parameter
+sets the preferred units for the input celestial coordinates, and
+tells CCFIND how to transform the input celestial coordinates
+the input image celestial coordinate system. The systems of most
+interest to users are "icrs", "j2000", and "b1950". The full set
+of options are the following:
+
+.ls equinox [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system if equinox is a
+Julian epoch, e.g. J2000.0 or 2000.0, or the equatorial mean place
+pre-IAU 1976 system (FK4) if equinox is a Besselian epoch, e.g. B1950.0
+or 1950.0. Julian equinoxes are prefixed by a J or j, Besselian equinoxes
+by a B or b. Equinoxes without the J / j or B / b prefix are treated as
+Besselian epochs if they are < 1984.0, Julian epochs if they are >= 1984.0.
+Epoch is the epoch of the observation and may be a Julian
+epoch, a Besselian epoch, or a Julian date. Julian epochs
+are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to the epoch type of
+equinox if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls icrs [equinox] [epoch]
+The International Celestial Reference System (ICRS) where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk5 [equinox] [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system where equinox is a
+Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0. Epoch
+is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls noefk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system but without the E-terms
+where equinox is a Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day. If undefined epoch defaults to equinox.
+.le
+.ls apparent epoch
+The equatorial geocentric apparent place post-IAU 1976 system where
+epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date.
+.le
+.ls ecliptic epoch
+The ecliptic coordinate system where epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch values < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day.
+.le
+.ls galactic [epoch]
+The IAU 1958 galactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+.ls supergalactic [epoch]
+The deVaucouleurs supergalactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+
+In all the above cases fields in [] are optional with the defaults as
+described. The epoch field for the icrs, fk5, galactic, and supergalactic
+coordinate systems is only used if the input coordinates are in the
+equatorial fk4, noefk4, fk5, or icrs systems and proper motions are supplied.
+Since CCFIND does not currently support proper motions these fields are
+not required.
+.le
+.ls usewcs = no
+Use image header information to compute the input image celestial coordinate
+system ? If usewcs is "yes", the image coordinate system is read from the
+image header. If usewcs is "no", the input image celestial coordinates
+system is defined by \fIxref\fR, \fIyref\fR, \fIxmag\fR, \fIymag\fR,
+\fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+\fIlngrefunits\fR, \fIlatrefunits\fR, \fIrefsystem\fR, and \fIprojection\fR
+parameters respectively.
+.le
+.ls xref = INDEF, yref = INDEF
+The x and y pixel coordinates of the reference point.
+xref and yref default to the center of the image in pixel coordinates.
+.le
+.ls xmag = INDEF, ymag = INDEF
+The x and y scale factors in arcseconds per pixel. xmag and ymag default
+to 1.0 and 1.0 arcseconds per pixel.
+.le
+.ls xrotation = INDEF, yrotation = INDEF
+The x and y rotation angles in degrees. xrotation and yrotation are
+interpreted as the rotation of the ra / longitude and dec / latitude
+coordinates with respect to the x and y axes, and default 0.0 and 0.0 degrees
+respectively. To set east to the up, down, left, and right directions,
+set xrotation to 90, 270, 180, and 0 respectively. To set north to the
+up, down, left, and right directions, set yrotation to 0, 180, 90, and 270
+degrees respectively. Any global rotation must be added to both the
+xrotation and yrotation values.
+.le
+.ls lngref = "INDEF", latref = "INDEF"
+The ra / longitude and dec / latitude of the reference point. Lngref and latref
+may be numbers, e.g 13:20:42.3 and -33:41:26, or keywords for the
+appropriate parameters in the image header, e.g. RA and DEC for NOAO
+image data. If lngref and latref are undefined they default to 0.0 and 0.0
+respectively.
+.le
+.ls lngrefunits = "", latrefunits = ""
+The units of the reference point celestial coordinates. The options
+are "hours", "degrees", and "radians" for the ra / longitude coordinates,
+and "degrees" and "radians" for the dec /latitude coordinates.
+If lngrefunits and latrefunits are undefined they default to the preferred
+units of the reference system.
+.le
+.ls refsystem = "INDEF"
+The celestial coordinate system of the reference point. Refsystem may
+be any one of the options listed under the \fIinsystem\fR parameter, e.g.
+"b1950", or an image header keyword containing the epoch of the observation
+in years, e.g. EPOCH for NOAO data. If refsystem is undefined
+the celestial coordinate system of the reference point defaults to the
+celestial coordinate system of the input coordinates \fIinsystem\fR.
+.le
+.ls projection = "tan"
+The sky projection geometry. The most commonly used projections in
+astronomy are "tan", "arc", "sin", and "lin". Other supported projections
+are "ait", "car", "csc", "gls", "mer", "mol", "par", "pco", "qsc", "stg",
+"tsc", and "zea".
+.le
+.ls center = yes
+Center the object pixel coordinates using an x and y marginal centroiding
+algorithm ?
+.le
+.ls sbox = 21
+The search box width in pixels. Sbox defines the region of the input image
+searched and used to compute the initial x and y marginal centroids. Users
+worried about contamination can set sbox = cbox, so that the first
+centering iteration will be the same as the others.
+.le
+.ls cbox = 9
+The centering box width in pixels. Cbox defines the region of the input
+image used to compute the final x and y marginal centroids.
+.le
+.ls datamin = INDEF, datamax = INDEF
+The minimum and maximum good data values. Values outside this range
+are exclude from the x and y marginal centroid computation.
+.le
+.ls background = INDEF
+The background value used by the centroiding algorithm. If background is
+INDEF, a value equal to the mean value of the good data pixels for
+each object is used.
+.le
+.ls maxiter = 5
+The maximum number of centroiding iterations to perform. The centroiding
+algorithm will halt when this limit is reached or when the desired tolerance
+is reached.
+.le
+.ls tolerance = 0
+The convergence tolerance of the centroiding algorithm. Tolerance is
+defined as the maximum permitted integer shift of the centering box in
+pixels from one iteration to the next.
+.le
+.ls verbose
+Print messages about actions taken by the task?
+.le
+
+.ih
+DESCRIPTION
+
+CCFIND locates the objects in the input celestial coordinate lists \fIinput\fR
+in the input images \fIimage\fR using the image world coordinate system,
+and writes the located objects to the output matched coordinates files
+\fIoutput\fR. CCFIND computes the pixel coordinates of each object by,
+1) transforming the input celestial coordinates to image celestial coordinate
+system, 2) using the image celestial coordinate system to compute the
+initial pixel coordinates, and 3) computing the final pixel coordinates
+using a centroiding algorithm. The image celestial coordinate system may
+be read from the image header or supplied by the user. The CCFIND output
+files are suitable for input to the plate solution computation task CCMAP.
+
+The input ra / longitude and dec / latitude coordinates are read from
+columns \fIlngcolumn\fR and \fIlatcolumn\fR in the input coordinate
+file respectively.
+
+The input celestial coordinate system is set by the \fIinsystem\fR parameter,
+and must be one of the following: equatorial, ecliptic, galactic, or
+supergalactic. The equatorial coordinate systems must be one of: 1) FK4,
+the mean place pre-IAU 1976 system, 2) FK4-NO-E, the same as FK4 but without
+the E-terms, 3) FK5, the mean place post-IAU 1976 system, 4) ICRS the
+International Celestial Reference System, 5) GAPPT, the geocentric apparent
+place in the post-IAU 1976 system.
+
+The \fIlngunits\fR and \fIlatunits\fR parameters set the units of the input
+celestial coordinates. If undefined, lngunits and latunits assume sensible
+defaults for the input celestial coordinate system set by the \fIinsystem\fR
+parameter, e.g. "hours" and "degrees" for equatorial coordinates and "degrees"
+and "degrees" for galactic coordinates.
+
+If the \fIusewcs\fR parameter is "yes", the image celestial coordinate
+system is read from the image header keywords CRPIX, CRVAL, CD or CDELT/CROTA,
+RADECSYS, EQUINOX or EPOCH, and MJD-OBS or DATE-OBS, where the mathematical
+part of this transformation is shown below.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = CD1_1
+ c = CD1_2
+ e = CD2_1
+ f = CD2_2
+ a = - b * CRPIX1 - c * CRPIX2
+ d = - e * CRPIX1 - f * CRPIX2
+ lng = CRVAL1 + PROJ (xi, eta)
+ lat = CRVAL2 + PROJ (xi, eta)
+.fi
+
+If usewcs is "no", then the image celestial coordinate system is computed
+using the values of the \fIxref\fR, \fIyref\fR, \fIxmag\fR, \fIymag\fR,
+\fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+\fIlngrefunits\fR, \fIlatrefunits\fR, \fIrefsystem\fR, and \fIprojection\fR
+supplied by the user, where the mathematical part of this transformation is
+shown below.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = -ymag * sin (yrotation)
+ e = xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = - b * xref - c * yref
+ d = - e * xref - f * yref
+ lng = lngref + PROJ (xi, eta)
+ lat = latref + PROJ (xi, eta)
+.fi
+
+In both the above examples, x and y are the pixel coordinates, xi and eta
+are the usual projected (standard) coordinates, lng and lat are the celestial
+coordinates, and PROJ stands for the projection function, usually
+the tangent plane projection function.
+
+Once the image celestial coordinate system is determined, CCFIND transforms
+the input celestial coordinates to the image celestial coordinate system
+using the value of the \fIinsystem\fR parameter, and either the values of
+the image header keywords RADECSYS, EQUINOX / EPOCH, and MJD-OBS / DATE-OBS
+(if \fIusewcs\fR = "yes"), or the value of the \fIrefsystem\fR parameter (if
+\fIusewcs\fR = "no"), and then transforms the image celestial coordinates
+to pixel coordinates using the inverse of the transformation functions
+shown above.
+
+If \fIcenter\fR is yes, CCFIND locates the objects in the input
+image using an xn and y marginal centroiding algorithm. Pixels
+inside a box \fIsbox\fR pixels wide centered in the initial coordinates,
+are used to locate the objects in the image. Accurate final centering
+is done using pixels inside a region \fIcbox\fR pixels wide centered on
+these initial coordinates. Sbox should be set to a value large enough
+to locate the object, but small enough to exclude other bright sources.
+Cbox should be set to a value small enough to exclude sky values and other
+bright sources, but large enough to include the wings of point sources.
+Bad data can be excluded from the centroiding algorithm by setting
+the \fIdatamin\fR and \fIdatamax\fR parameters. If \fIbackground\fR is
+undefined then the centroiding algorithm sets the background value to
+the mean of the good data values inside the centering box.
+The centroiding algorithm iterates until the maximum number of
+iterations \fImaxiter\fR limit is reached, or until the tolerance
+criteria \fItolerance\fR is achieved.
+
+Only objects whose coordinates are successfully located in the
+input image are written to the output coordinate file. The computed
+output pixel coordinates are appended to the input image line using
+the format parameters \fIxformat\fR and \fIyformat\fR parameters,
+whose default values are "%10.3f" and "%10.3f" respectively
+
+.ih
+FORMATS
+
+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:
+
+.nf
+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
+cctran.hlp-(67%)-line 268-file 1 of 1
+%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
+.fi
+
+.ih
+EXAMPLES
+
+1. Locate the object in the list wpix.coords in the image wpix using
+the existing image header wcs. The input celestial coordinates file
+contains j2000 GSC catalog coordinates of 5 objects in the field.
+The image wcs is in b1950.
+
+.nf
+cl> imcopy dev$wpix wpix
+ ... copy the test image into the current directory
+
+cl> hedit wpix equinox 1950.0 add+
+ ... change the epoch keyword value to the correct number
+
+cl> type wpix.coords
+13:29:47.297 47:13:37.52
+13:29:37.406 47:09:09.18
+13:29:38.700 47:13:36.23
+13:29:55.424 47:10:05.15
+13:30:01.816 47:12:58.79
+
+cl> ccfind wpix.coords wpix.match wpix usewcs+
+
+Input File: wpix.coords Output File: wpix.match
+ Image: wpix Wcs:
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Refsystem: wpix.imh logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK4 Equinox: B1950.000
+ Epoch: B1987.25767884 MJD: 46890.00000
+Located 5 objects in image wpix
+
+cl> type wpix.match
+# Input File: wpix.coords Output File: wpix.match
+# Image: wpix Wcs:
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Refsystem: wpix.imh logical Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK4 Equinox: B1950.000
+# Epoch: B1987.25767884 MJD: 46890.00000
+
+13:29:47.297 47:13:37.52 327.504 410.379
+13:29:37.406 47:09:09.18 465.503 62.101
+13:29:38.700 47:13:36.23 442.013 409.654
+13:29:55.424 47:10:05.15 224.351 131.200
+13:30:01.816 47:12:58.79 134.373 356.327
+
+cl> ccmap wpix.match ccmap.db xcol=3 ycol=4 lngcol=1 latcol=2 ...
+.fi
+
+2. Repeat the previous example but input the image coordinate system by hand.
+The scale is known to be ~0.77 arcseconds per pixel, north is up, east is left,
+and the center of the image is near ra = 13:27:47, dec = 47:27:14 in 1950
+coordinates.
+
+.nf
+cl> ccfind wpix.coords wpix.match wpix xmag=-0.77 ymag=.77 lngref=13:27:47 \
+latref=47:27:14 refsystem=b1950.
+
+Input File: wpix.coords Output File: wpix.match.1
+ Image: wpix Wcs:
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Refsystem: b1950 Coordinates: equatorial FK4
+ Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
+Located 5 objects in image wpix
+
+
+cl> type wpix.match
+
+# Input File: wpix.coords Output File: wpix.match
+# Image: wpix Wcs:
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Refsystem: b1950 Coordinates: equatorial FK4
+# Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
+
+13:29:47.297 47:13:37.52 327.504 410.379
+13:29:37.406 47:09:09.18 465.503 62.101
+13:29:38.700 47:13:36.23 442.013 409.654
+13:29:55.424 47:10:05.15 224.351 131.200
+13:30:01.816 47:12:58.79 134.373 356.327
+.fi
+
+3. Repeat the previous example but read the ra, dec, and epoch from the
+image header keywords RA, DEC, and EPOCH. It turns out the telescope
+RA and DEC recorded in the image header are not very accurate and that
+EPOCH is 0.0 instead of 1987.26 so we will fix up the header before
+trying out the example.
+
+.nf
+cl> hedit wpix EPOCH 1987.26
+cl> hedit wpix RA '13:29:21'
+cl> hedit wpix DEC '47:15:42'
+
+cl> ccfind wpix.coords wpix.match wpix xmag=-0.77 ymag=.77 lngref=RA \
+latref=DEC refsystem=EPOCH
+
+Input File: wpix.coords Output File: wpix.match
+ Image: wpix Wcs:
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Refsystem: 1987.26 Coordinates: equatorial FK5
+ Equinox: J1987.260 Epoch: J1987.26000000 MJD: 46891.21500
+Located 5 objects in image wpix
+
+# Input File: wpix.coords Output File: wpix.match
+# Image: wpix Wcs:
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Refsystem: 1987.26 Coordinates: equatorial FK5
+# Equinox: J1987.260 Epoch: J1987.26000000 MJD: 46891.21500
+
+13:29:47.297 47:13:37.52 327.504 410.379
+13:29:37.406 47:09:09.18 465.503 62.101
+13:29:38.700 47:13:36.23 442.013 409.654
+13:29:55.424 47:10:05.15 224.351 131.200
+13:30:01.816 47:12:58.79 134.373 356.327
+.fi
+
+4. Use ccfind to predict the pixel coordinate in the last example by
+turning off the object centering, and mark the predicted coordinates
+on the image display with red dots.
+
+.nf
+cl> ccfind wpix.coords wpix.match wpix xmag=-0.77 ymag=.77 lngref=RA \
+latref=DEC refsystem=EPOCH center-
+
+Input File: wpix.coords Output File: wpix.match
+ Image: wpix Wcs:
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Refsystem: 1987.26 Coordinates: equatorial FK5
+ Equinox: J1987.260 Epoch: J1987.26000000 MJD: 46891.21500
+Located 5 objects in image wpix
+
+cl> type wpix.match
+
+# Input File: wpix.coords Output File: wpix.match
+# Image: wpix Wcs:
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Refsystem: 1987.26 Coordinates: equatorial FK5
+# Equinox: J1987.260 Epoch: J1987.26000000 MJD: 46891.21500
+
+13:29:47.297 47:13:37.52 333.954 401.502
+13:29:37.406 47:09:09.18 465.338 53.175
+13:29:38.700 47:13:36.23 447.687 399.967
+13:29:55.424 47:10:05.15 226.600 125.612
+13:30:01.816 47:12:58.79 141.892 351.084
+
+cl> display wpix 1
+
+cl> fields wpix.match 3,4 | tvmark 1 STDIN col=204
+
+.fi
+
+.ih
+TIME REQUIREMENTS
+.ih
+BUGS
+.ih
+SEE ALSO
+starfind, ccxymatch, ccmap, ccsetwcs, cctran
+.endhelp
diff --git a/pkg/images/imcoords/doc/ccget.hlp b/pkg/images/imcoords/doc/ccget.hlp
new file mode 100644
index 00000000..fef9afba
--- /dev/null
+++ b/pkg/images/imcoords/doc/ccget.hlp
@@ -0,0 +1,463 @@
+.help ccget Oct00 images.imcoords
+.ih
+NAME
+ccget -- extract objects in a user specified field from a text file catalog
+.ih
+USAGE
+ccget input output lngcenter latcenter lngwidth latwidth
+.ih
+PARAMETERS
+.ls input
+The input text file catalog(s). The text file columns must be
+delimited by whitespace and all the input catalogs must have the same format.
+.le
+.ls output
+The output catalogs containing the extracted objects. The number of
+output catalogs must be one or equal to the number of input catalogs.
+.le
+.ls lngcenter, latcenter
+The center of the field containing the objects to be extracted. Lngcenter and
+latcenter are assumed to be in the coordinate system specified by
+\fIfcsystem\fR, e.g. ra and dec for equatorial systems, galactic longitude and
+latitude for galactic systems, etc. and in the units specified by
+\fIfclngunits\fR and \fIlatunits\fR.
+.le
+.ls lngwidth, latwidth
+The width of the user specified field in degrees.
+.le
+.ls fcsystem = ""
+The celestial coordinate system of the field center. If undefined fcsystem
+defaults to the catalog celestial coordinate system specified by
+\fIcatsystem\fR. The two systems of
+most interest to users are "j2000" and "b1950". The full set of options is:
+
+.ls equinox [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system if equinox is a
+Julian epoch, e.g. J2000.0 or 2000.0, or the equatorial mean place
+pre-IAU 1976 system (FK4) if equinox is a Besselian epoch, e.g. B1950.0
+or 1950.0. Julian equinoxes are prefixed by a J or j, Besselian equinoxes
+by a B or b. Equinoxes without the J / j or B / b prefix are treated as
+Besselian epochs if they are < 1984.0, Julian epochs if they are >= 1984.0.
+Epoch is the epoch of the observation and may be a Julian
+epoch, a Besselian epoch, or a Julian date. Julian epochs
+are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to the epoch type of
+equinox if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk5 [equinox] [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system where equinox is a
+Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0. Epoch
+is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls noefk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system but without the E-terms
+where equinox is a Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day. If undefined epoch defaults to equinox.
+.le
+.ls apparent epoch
+The equatorial geocentric apparent place post-IAU 1976 system where
+epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date.
+.le
+.ls ecliptic epoch
+The ecliptic coordinate system where epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch values < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day.
+.le
+.ls galactic [epoch]
+The IAU 1958 galactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+.ls supergalactic [epoch]
+The deVaucouleurs supergalactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+
+In all the above cases fields in [] are optional with the defaults as
+described. The epoch field for the fk5, galactic, and supergalactic
+coordinate systems is only used if the input coordinates are in the
+equatorial fk4, noefk4, or fk5 systems and proper motions are supplied.
+Since ccget does not currently support proper motions these fields are
+not required.
+.le
+
+.ls fclngunits = "", fclatunits = ""
+The units of the field center coordinates. The options are "hours", "degrees",
+and "radians" for the ra / longitude coordinate and "degrees" and "radians"
+for the dec / latitude coordinates. If fclngunits and fclatunits are undefined
+they default to the preferred units for the given system, e.g. "hours" and
+degrees" for equatorial systems and "degrees" and "degrees" for ecliptic,
+galactic, and supergalactic systems.
+.le
+.ls colaliases = ""
+The list of input catalog column aliases separated by commas. By default the
+catalog columns are "c1", "c2", "c10", etc. If colaliases is defined then
+the aliases are assigned to the columns in order. For example if colaliases
+is "id,ra,dec,v,bv" then columns c1, c2, c3, c4, c5 will be assigned
+the names id, ra, dec, v, and bv and any remaining columns in the input catalog
+file will be assigned default names beginning with c6.
+.le
+.ls lngcolumn = "c2", latcolumn = "c3"
+The input catalog columns containing the coordinates of catalog objects.
+.le
+.ls catsystem = "j2000"
+The celestial coordinate system of the input catalog(s). The two systems of
+most interest to users are "j2000" and "b1950". The full set of options is
+described in the \fIfcsystem\fR parameter section.
+.le
+.ls catlngunits = "", catlatunits = ""
+The units of the catalog coordinates. The options are "hours", "degrees",
+and "radians" for the ra / longitude coordinate and "degrees" and "radians"
+for the dec / latitude coordinates. If catlngunits and catlatunits are undefined
+they default to the preferred units for the catalog system, e.g. "hours" and
+degrees" for equatorial systems and "degrees" and "degrees" for ecliptic,
+galactic, and supergalactic systems.
+.le
+.ls outsystem = ""
+The celestial coordinate system of the output coordinates. If undefined
+outsystem defaults to the celestial coordinate system of the catalog.
+The two systems of most interest to users are "j2000" and "b1950". The
+full set of options is described under the \fIfcsystem\fR parameter
+section.
+.le
+.ls olngunits = "", olatunits = ""
+The units of the output coordinates. The options are "hours", "degrees",
+and "radians" for the ra / longitude coordinate and "degrees" and "radians"
+for the dec / latitude coordinates. If olngunits and olatunits are undefined
+they default to the preferred units for outsystem, e.g. "hours" and degrees" for
+equatorial systems and "degrees" and "degrees" for ecliptic, galactic, and
+supergalactic systems.
+.le
+.ls olngformat = "", olatformat=""
+The output ra / longitude and dec / latitude formats if the output
+celestial coordinate system is different from the catalog celestial
+coordinate system. The defaults are " %010.1h" for hours, " %9h" for degrees
+and " %9.7g" for radians.
+.le
+.ls exprs = "c[*]"
+The list of output columns and column expressions separated by commas.
+By default the entire record for the extracted object is output exactly
+as it is. The output columns can be individual columns e.g. c1 or c5
+or column ranges, e.g. c[1-10] or c[2-4]. Column expressions are
+expressions of the catalog columns, e.g c4 + c5. Columns and column
+expression are output in the order in which they appear in exprs.
+.le
+.ls formats = ""
+An optional list of column formats separated by commas. Column formats must
+be placeholders, e.g. the letter f for existing columns which are not
+reformatted (with the possible exception of the coordinate columns).
+Column expression formats may be any regular formatting expression.
+For example if \fIexprs\fR is "c[1-3],c4+c5,c5+c7", then formats might be
+"f,%7.3f,%7.3f".
+.le
+.ls verbose = yes
+Print messages on the standard output about actions taken by the task.
+.le
+
+.ih
+DESCRIPTION
+
+Ccget extracts objects in a user specified field from the input catalogs
+\fIinput\fR and writes the extracted records to the output
+catalogs \fIoutput\fR.
+
+The user field is specified by the parameters \fIlngcenter\fR, \fIlatcenter\fR,
+\fIlngwidth\fR, and \fIlatwidth\fR, where the field center is entered in
+the celestial coordinate system specified by \fIfcsystem\fR and the
+units are specified by \fIfclngunits\fR and \fIfclatunits\fR. If fcsystem
+is undefined it defaults to the value of the catalog coordinate system
+\fIcatsystem\fR.
+
+The input catalogs must be text files containing 2 or more columns separated
+by whitespace. By default these columns are assigned names of the form
+c1, c2, ..., cn. Legal columns names must have the form described
+in the following column names section. Users may assign their own names
+to the columns by setting
+the \fIcolaliases\fR parameter. The input catalog columns \fIlngcolumn\fR and
+\fIlatcolumn\fR must contain the ra / longitude and dec / latitude coordinates
+of the catalog objects respectively. The parameters \fIcatsystem\fR,
+\fIcatlngunits\fR, and \fIcatlatunits\fR specify the coordinate system
+of the input catalog and its coordinate units respectively.
+
+At task startup the user field center is transformed from the coordinate
+system defined by \fIfcsystem\fR to the catalog coordinate system
+\fIcatsystem\fR and the ra / longitude and dec / latitude limits of the
+user field are computed. As each input catalog record is read, the catalog
+coordinates are decoded and tested against these limits. If the
+object is inside the user field then the column and column
+expressions specified by \fIexprs\fR are extracted from the input catalogs
+and written to the output catalogs.
+
+If the output celestial coordinate system \fIoutsystem\fR is
+different from \fIcatsystem\fR, then the catalog coordinates are transformed
+and to the output coordinates system, and written to the output catalog
+in the units specified
+by \fIolngunits\fR and \fIolatunits\fR, with the formats specified by
+\fIolngformat\fR and \fIolatformat\fR. Existing columns are written to
+the output catalog in the same
+format they have in the input catalog. Column expressions are written
+using the formats specified by \fIformats\fR or the builtin defaults
+of %5b, %10d, %10g, or %s for boolean, integer, floating point, or
+string columns respectively.
+
+.ih
+COLUMN NAMES
+
+By default column names are of the form c1, c2, ..., cN. However users can
+also define their own column names, which must have the following syntax
+
+.nf
+ {a-zA-Z}[{a-zA-Z0-9._$}]*
+.fi
+
+where [] indicates optional, {} indicates a class, - indicates an ascii
+range of characters, and * indicates zero or more occurrences. In words
+a column name must begin with an alphabetic character and be followed
+by any combination of alphabetic, digit, or '.', '_', and '$' characters.
+The ccget task imposes a 19 character limit on the columns names so it is
+best to keep them short.
+
+.ih
+COLUMN EXPRESSIONS
+
+Expressions must consist of operands and operators. The operands may be
+column names, numeric constants, functions, and quoted string constants.
+Values given as sexagesimal strings are automatically converted to
+decimal numbers. The operators are arithmetic, logical, and string.
+
+The following operators are supported:
+
+
+.nf
+ + - * / arithmetic operators
+ ** exponentiation
+ // string concatenation
+ ! - boolean not, unary negation
+ < <= > >= order comparison (works for strings)
+ == != && || equals, not equals, and, or
+ ?= string equals pattern
+ ? : conditional expression
+.fi
+
+The following intrinsic functions are supported:
+
+
+.nf
+ abs atan2 deg log min real sqrt
+ acos bool double log10 mod short str
+ asin cos exp long nint sin tan
+ atan cosh int max rad sinh tanh
+.fi
+
+
+.ih
+COLUMN FORMATS
+
+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:
+
+.nf
+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
+.fi
+
+.ih
+SOME BUILTIN CATALOG FORMATS
+
+The nlandolt.dat catalog in noao$photcal/catalogs/ has the following format.
+
+.nf
+# Column Quantity
+
+ 1 id
+ 2 ra
+ 3 dec
+ 4 v
+ 5 b-v
+ 6 u-b
+ 7 v-r
+ 8 r-i
+ 9 v-i
+ 10 n
+ 11 m
+ 12 err(v)
+ 13 err(b-v)
+ 14 err(u-b)
+ 15 err(v-r)
+ 16 err(r-i)
+ 17 err(v-i)
+.fi
+
+where the coordinates are in j2000, the errors are all mean errors of the mean,
+and n and m are the number of observations and number of independent nights
+of observations respectively.
+
+.ih
+REFERENCES
+
+The catalog references are
+
+.nf
+nlandolt.dat - Landolt, A.U. 1992, A.J. 104, 340
+.fi
+
+.ih
+EXAMPLES
+
+Example 1. Extract all Landolt standard stars within a 1 degree field
+surrounding the position ra = 3:55:00 dec = 0:00:00 (J2000).
+
+.nf
+cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0
+.fi
+
+Example 2. Repeat example 1 but output the coordinates in the b1950
+celestial coordinate system.
+
+.nf
+cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0 \
+outsystem=b1950
+.fi
+
+Example 3. Repeat example 1 but extract only the id, ra, dec, v,
+and b-v fields from the Landolt catalog. Note that since these
+columns are the first five in the catalog they can be specified
+as a range.
+
+.nf
+cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0 \
+exprs="c[1-5]"
+.fi
+
+Example 4. Repeat example 1 but extract the id, ra, dec, b and
+b-r colors. Note that b and b-r are not columns in the input catalog
+but may be computed from them. Note also that formats should be
+specified to give the desired spacing, although defaults will be
+supplied.
+
+.nf
+cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0 \
+exprs="c[1-3],c4+c5,c5+c7" formats="%7.3f,%7.3f
+.fi
+
+.ih
+TIME REQUIREMENTS
+.ih
+BUGS
+.ih
+SEE ALSO
+.endhelp
diff --git a/pkg/images/imcoords/doc/ccmap.hlp b/pkg/images/imcoords/doc/ccmap.hlp
new file mode 100644
index 00000000..e19d30fa
--- /dev/null
+++ b/pkg/images/imcoords/doc/ccmap.hlp
@@ -0,0 +1,1028 @@
+.help ccmap Jan01 images.imcoords
+.ih
+NAME
+ccmap -- compute plate solutions using matched pixel and celestial coordinate
+lists
+.ih
+USAGE
+ccmap input database
+.ih
+PARAMETERS
+.ls input
+The input text files containing the pixel and celestial coordinates of
+points in the input images. The coordinates are listed one per line with x, y,
+ra / longitude, and dec / latitude in the columns specified by the
+\fIxcolumn\fR, \fIycolumn\fR, \fIlngcolumn\fR, and \fIlatcolumn\fR parameters
+respectively. Whether all files are combined to produce one solution or
+each file produces a separate solution depends on whether there is a
+matching list of output \fIsolutions\fR names or \fIresults\fR files.
+.le
+.ls database
+The text database file where the computed plate solutions are stored.
+.le
+.ls solutions = ""
+An optional list of plate solution names. If there are multiple input
+coordinate files and no name or a single name is specified then the
+input coordinates are combined to produce a single solution. Otherwise
+the list must match the number of input coordinate files. If no names are
+supplied then the database records are assigned the names of the input
+images \fIimages\fR, or the names of the coordinate files \fIinput\fR.
+In the case of multiple coordinate files the first image or input is used.
+.le
+.ls images = ""
+The images associated with the input coordinate files. The number of images
+must be zero or equal to the number of input coordinate files. If an input
+image exists and the \fIupdate\fR parameter is enabled, the image wcs will
+be created from the linear component of the computed plate solution
+and written to the image header.
+.le
+.ls results = ""
+Optional output files containing a summary of the results including a
+description of the plate geometry and a listing of the input coordinates,
+the fitted coordinates, and the fit residuals. The number of
+results files must be zero, one or equal to the number of input files. If
+results is "STDOUT" the results summary is printed on the standard output.
+If there are multiple input coordinate files and zero or one output is
+specified then the input coordinates are combined to produce a single solution.
+.le
+.ls xcolumn = 1, ycolumn = 2, lngcolumn = 3, latcolumn = 4
+The input coordinate file columns containing the x, y, ra / longitude and
+dec / latitude values.
+.le
+.ls xmin = INDEF, xmax = INDEF, ymin = INDEF, ymax = INDEF
+The range of x and y pixel coordinates over which the computed coordinate
+transformation is valid. These limits should be left at INDEF or set to
+the values of the column and row limits of the input images, e.g xmin = 1.0,
+xmax = 512, ymin= 1.0, ymax = 512 for a 512 x 512 image. If xmin, xmax, ymin,
+or ymax are undefined, they are set to the minimum and maximum x and y
+pixels values in \fIinput\fR.
+.le
+.ls lngunits = "", latunits = ""
+The units of the input ra / longitude and dec / latitude coordinates. The
+options are "hours", "degrees", and "radians" for ra / longitude, and
+"degrees" and "radians" for dec / latitude. If the lngunits and latunits
+are undefined they default to the preferred units for the coordinate system
+specified by \fIinsystem\fR, e.g. "hours" and "degrees" for equatorial
+systems, and "degrees" and "degrees" for ecliptic, galactic, and
+supergalactic systems.
+.le
+.ls insystem = "j2000"
+The input celestial coordinate system. The \fIinsystem\fR parameter
+sets the preferred units for the input celestial coordinates,
+tells CCMAP how to transform the celestial coordinates of the reference
+point from the reference point coordinate system to the input coordinate
+system, and sets the correct values of the image header keywords CTYPE,
+RADECSYS, EQUINOX, and MJD-WCS if the image header wcs is updated. The
+systems of most interest to users are "icrs", "j2000", and "b1950" which
+stand for the ICRS J2000.0, FK5 J2000.0 and FK4 B1950.0 celestial coordinate
+systems respectively. The full set of options are the following:
+
+.ls equinox [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system if equinox is a
+Julian epoch, e.g. J2000.0 or 2000.0, or the equatorial mean place
+pre-IAU 1976 system (FK4) if equinox is a Besselian epoch, e.g. B1950.0
+or 1950.0. Julian equinoxes are prefixed by a J or j, Besselian equinoxes
+by a B or b. Equinoxes without the J / j or B / b prefix are treated as
+Besselian epochs if they are < 1984.0, Julian epochs if they are >= 1984.0.
+Epoch is the epoch of the observation and may be a Julian
+epoch, a Besselian epoch, or a Julian date. Julian epochs
+are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to the epoch type of
+equinox if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls icrs [equinox] [epoch]
+The International Celestial Reference System where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk5 [equinox] [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system where equinox is a
+Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0. Epoch
+is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls noefk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system but without the E-terms
+where equinox is a Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day. If undefined epoch defaults to equinox.
+.le
+.ls apparent epoch
+The equatorial geocentric apparent place post-IAU 1976 system where
+epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date.
+.le
+.ls ecliptic epoch
+The ecliptic coordinate system where epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch values < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day.
+.le
+.ls galactic [epoch]
+The IAU 1958 galactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+.ls supergalactic [epoch]
+The deVaucouleurs supergalactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+
+In all the above cases fields in [] are optional with the defaults as
+described. The epoch field for the icrs, fk5, galactic, and supergalactic
+coordinate systems is only used if the input coordinates are in the
+equatorial fk4, noefk4, fk5, or icrs systems and proper motions are supplied.
+Since CCMAP does not currently support proper motions these fields are
+not required.
+.le
+
+.ls refpoint = "coords"
+The definition of the sky projection reference point in celestial coordinates,
+e.g. the tangent point in the case of the usual tangent plane projection.
+The options are:
+.ls coords
+The celestial coordinates of the reference point are set to the mean of the
+input celestial coordinates, e.g. the mean of ra / longitude and dec /
+latitude coordinates. If the true tangent point is reasonably close to
+the center of the input coordinate distribution and the input is not
+too large, this approximation is reasonably accurate.
+.le
+.ls user
+The values of the keywords \fIlngref\fR, \fIlatref\fR, \fIrefsystem\fR,
+\fIlngrefunits\fR, and \fIlatrefunits\fR are used to determine the celestial
+coordinates of the reference point.
+.le
+.le
+.ls xref = "INDEF", yref = "INDEF"
+The reference pixel may be specified as a value or image header keyword.
+In the latter case a reference image must be specified. By specifying
+the reference pixel the solution will be constrained to putting the
+reference coordinate at that point.
+.le
+.ls lngref = "INDEF", latref = "INDEF"
+The ra / longitude and dec / latitude of the reference point(s). Lngref
+and latref may be numbers, e.g 13:20:42.3 and -33:41:26 or keywords for the
+appropriate parameters in the image header, e.g. RA/DEC or CRVAL1/CRVAL2.
+Each parameter may be a list to apply different reference points to
+each input coordinate list. If lngref and latref are undefined then
+the position of the reference point defaults to the mean of the input
+coordinates.
+.le
+.ls refsystem = "INDEF"
+The celestial coordinate system of the reference point. Refsystem may
+be any one of the options listed under the \fIinsystem\fR parameter, e.g.
+"b1950", or an image header keyword containing the epoch of the observation
+in years, e.g. EPOCH for NOAO data. In the latter case the coordinate system is
+assumed to be equatorial FK4 at equinox EPOCH. If refsystem is undefined
+the celestial coordinate system of the reference point defaults to the
+celestial coordinate system of the input coordinates \fIinsystem\fR.
+.le
+.ls lngrefunits = "", latrefunits = ""
+The units of the reference point celestial coordinates. The options
+are "hours", "degrees", and "radians" for the ra / longitude coordinates,
+and "degrees" and "radians" for the dec /latitude coordinates.
+If lngunits and latunits are undefined they default to the units of the
+input coordinate system.
+.le
+.ls projection = "tan"
+The sky projection geometry. The most commonly used projections in astronomy
+are "tan", "arc", "sin", and "lin". Other supported standard projections
+are "ait", "car","csc", "gls", "mer", "mol", "par", "pco", "qsc", "stg",
+"tsc", and "zea". A new experimental function "tnx", a combination of the
+tangent plate projection and polynomials, is also available.
+.le
+.ls fitgeometry = "general"
+The plate solution geometry to be used. The options are the following, where
+xi and eta refer to the usual standard coordinates used in astrometry.
+.ls shift
+Xi and eta shifts only are fit.
+.le
+.ls xyscale
+Xi and eta shifts and x and y magnification factors in " / pixel are fit.
+Axis flips are allowed for.
+.le
+.ls rotate
+Xi and eta shifts and a rotation angle are fit. Axis flips are allowed for.
+.le
+.ls rscale
+Xi and eta shifts, a magnification factor in " / pixel assumed to be the same
+in x and y, and a rotation angle are fit. Axis flips are allowed for.
+.le
+.ls rxyscale
+Xi and eta shifts, x and y magnifications factors in " / pixel, and a rotation
+angle are fit. Axis flips are allowed for.
+.le
+.ls general
+A polynomial of arbitrary order in x and y is fit. A linear term and a
+distortion term are computed separately. The linear term includes a xi and eta
+shift, an x and y scale factor in " / pixel, a rotation and a skew. Axis
+flips are also allowed for in the linear portion of the fit. The distortion
+term consists of a polynomial fit to the residuals of the linear term. By
+default the distortion term is set to zero.
+.le
+
+For all the fitting geometries except "general" no distortion term is fit,
+i.e. the x and y polynomial orders are assumed to be 2 and the cross term
+switches are assumed to be set to "none", regardless of the values of the
+\fIxxorder\fR, \fIxyorder\fR, \fIxxterms\fR, \fIyxorder\fR, \fIyyorder\fR
+and \fIyxterms\fR parameters set by the user.
+.le
+.ls function = "polynomial"
+The type of analytic coordinate surface to be fit. The options are the
+following.
+.ls legendre
+Legendre polynomials in x and y.
+.le
+.ls chebyshev
+Chebyshev polynomials in x and y.
+.le
+.ls polynomial
+Power series polynomials in x and y.
+.le
+.le
+.ls xxorder = 2, xyorder = 2, yxorder = 2, yyorder = 2
+The order of the polynomials in x and y for the xi and eta fits respectively.
+The default order and cross term settings define the linear term in x
+and y, where the 6 coefficients can be interpreted in terms of an xi and eta
+shift, an x and y scaling in " / pixel, and rotations of the x and y axes.
+The "shift", "xyscale", "rotation", "rscale", and "rxyscale", fitting geometries
+assume that the polynomial order parameters are 2 regardless of the values
+set by the user. If any of the order parameters are higher than 2 and
+\fIfitgeometry\fR is "general", then a distortion surface is fit to the
+residuals from the linear portion of the fit.
+.le
+.ls xxterms = "half", yxterms = "half"
+The options are:
+.ls none
+The individual polynomial terms contain powers of x or powers of y but not
+powers of both.
+.le
+.ls half
+The individual polynomial terms contain powers of x and powers of y, whose
+maximum combined power is MAX (xxorder - 1, xyorder - 1) for the xi fit and
+MAX (yxorder - 1, yyorder - 1) for the eta fit. This is the recommended
+option for higher order plate solutions.
+.le
+.ls full
+The individual polynomial terms contain powers of x and powers of y, whose
+maximum combined power is MAX (xxorder - 1 + xyorder - 1) for the xi fit and
+MAX (yxorder - 1 + yyorder - 1) for the eta fit.
+.le
+
+The "shift", "xyscale", "rotation",
+"rscale", and "rxyscale" fitting geometries, assume that the
+cross term switches are set to "none" regardless of the values set by the user.
+If either of the cross-terms parameters is set to "half" or "full" and
+\fIfitgeometry\fR is "general" then a distortion surface is fit to the
+residuals from the linear portion of the fit.
+.le
+.ls maxiter = 0
+The maximum number of rejection iterations. The default is no rejection.
+.le
+.ls reject = INDEF
+The rejection limit in units of sigma.
+.le
+.ls update = no
+Update the world coordinate system in the input image headers ?
+The required numerical quantities represented by the keywords CRPIX,
+CRVAL, and CD are computed from the linear portion of the plate solution,
+The values of the keywords CTYPE, RADECSYS, EQUINOX, and MJD-WCS
+are set by the \fIprojection\fR and \fIinsystem\fR parameters. As there
+is currently no standard mechanism for storing the higher order plate solution
+terms if any in the image header wcs, these terms are currently ignored
+unless the projection function is the experimental function "tnx". The "tnx"
+function is not FITS compatible and can only be understood by IRAF. Any existing
+image wcs represented by the above keywords is overwritten during the update.
+.le
+.ls pixsystem = "logical"
+The input pixel coordinate system. The options are:
+.ls logical
+The logical pixel coordinate system is the coordinate system of the image
+pixels on disk. Since most users measure the pixel coordinates of objects
+in this system, "logical" is the system of choice for most applications.
+.le
+.ls physical
+The physical coordinate system is the pixel coordinate system of the
+parent image if any. This option may be useful for users working on images
+that are pieces of a larger mosaic.
+.le
+
+The choice of pixsystem has no affect on the fitting process, but does
+determine how the image header wcs is updated.
+.le
+.ls verbose = yes
+Print detailed messages about the progress of the task on the standard output ?
+.le
+.ls interactive = yes
+Compute the plate solution interactively ?
+In interactive mode the user may interact with the fitting process, e.g.
+change the order of the fit, reject points, display the data and refit, etc.
+.le
+.ls graphics = "stdgraph"
+The graphics device.
+.le
+.ls cursor = ""
+The graphics cursor.
+.le
+.ih
+DESCRIPTION
+
+CCMAP computes the plate solution for an image or set of images using lists
+of matched pixel and celestial coordinates. The celestial coordinates
+are usually equatorial coordinates, but may also be ecliptic, galactic,
+or supergalactic coordinates. The input coordinate files \fIinput\fR must
+be text file tables whose columns are delimited by whitespace. The pixel
+and celestial coordinates are listed in input, one per line with x, y,
+ra / longitude, and dec / latitude in columns \fIxcolumn\fR, \fIycolumn\fR,
+\fIlngcolumn\fR, and \fIlatcolumn\fR respectively.
+
+The \fIxmin\fR, \fIxmax\fR, \fIymin\fR and \fIymax\fR parameters define
+the region of validity of the fit in the pixel coordinate system. They should
+normally either be left set to INDEF, or set to the size of input images
+\fIimages\fR if any, e.g. xmin= 1.0, xmax= 512.0, ymin = 1.0, ymax = 512.0
+for a 512 square image. If set these parameters are also used to reject out
+of range pixel data before the actual fitting is done.
+
+The \fIlngunits\fR and \fIlatunits\fR parameters set the units of the input
+celestial coordinates. If undefined lngunits and latunits assume sensible
+defaults for the input celestial coordinate system set by the \fIinsystem\fR
+parameter, e.g. "hours" and "degrees" for equatorial coordinates and "degrees"
+and "degrees" for galactic coordinates. The input celestial coordinate system
+must be one of the following: equatorial, ecliptic, galactic, or supergalactic.
+The equatorial coordinate systems must be one of: 1) FK4, the mean place
+pre-IAU 1976 system, 2) FK4-NO-E, the same as FK4 but without the E-terms,
+3) FK5, the mean place post-IAU 1976 system, 4) GAPPT, the geocentric apparent
+place in the post-IAU 1976 system.
+
+The plate solution computed by CCMAP has the following form, where x and y
+are the pixel coordinates of points in the input image and xi and eta are the
+corresponding standard coordinates in units of " / pixel.
+
+.nf
+ xi = f (x, y)
+ eta = g (x, y)
+.fi
+
+The standard coordinates xi and eta are computed from the input celestial
+coordinates using the sky projection geometry \fIprojection\fR and
+the celestial coordinates of the projection reference point set by
+the user. The default projection is the tangent plane or gnomonic
+projection commonly used in optical astronomy. The projections most commonly
+used in astronomy are "sin" (the orthographic projection, used in radio
+aperture synthesis), "arc" (the zenithal equidistant projection, widely
+used as an approximation for Schmidt telescopes), and "lin" (linear).
+Other supported projections are "ait", "car", "csc", "gls", "mer", "mol",
+"par", "pco", "qsc", "stg", "tsc", and "zea". The experimental projection
+function "tnx" combines the "tan" projection with a polynomial fit
+to the residuals can be used to represent more complicated distortion
+functions.
+
+There are two modes in which this task works with multiple input
+coordinate lists. In one case each input list and possible associated
+image is treated independently and produce separate solutions. To
+select this option requires specifying a matching list of solution
+names or output results files. Note that this can also be simply done
+by running the task multiple times with a single input list each time.
+
+In the second mode data from multiple input lists are combined to
+produce a single solution. This is useful when multiple exposures are
+taken to define a higher quality astrometric solution. This mode is
+selected when there are multiple input lists, and possibly associated
+images, and no solution name or a single solution name is specified.
+
+When combining input data each set of coordinates may have different
+reference points which can be specified either as a list or by
+reference to image header keywords. The different reference points
+are used to convert each set of coordinates to the same coordinate
+frame. Typically this occurs when a set of exposures, each with the
+same coordinate reference pixel, has slightly different pointing as
+defined by the coordinate reference value. These different points
+result from a dither and can be useful to more completely sample the
+image pixel space. In other words, astrometric reference stars can be
+moved around the images to produce many more fitting points than occur
+with a single exposure. The key point to this process is that the
+shifts are mapped by the reference points of the pointing and the
+standard coordinates are independent of the pointing.
+
+A particular feature primarily intending for combining multiple
+exposures, but applies to single exposures as well, is an adjustment to
+the specified tangent point value based on the image WCS. When images,
+reference pixels, and reference coordinates are all defined and the
+images contain a celestial WCS the following computation is performed.
+The reference information replaces the WCS tangent point values, though
+typically the initial reference information is specified as the tangent
+point, and the updated WCS is used to evaluate celestial coordinates
+from the input pixel coordinates. The average difference between the WCS
+evaluated coordinates and the input celestial coordinates is computed.
+This difference is applied to the reference point prior to the standard
+coordinate plate solution calculation. In other words, the reference
+point is tweaked in the initial image WCS to make it agree on average with
+the input reference coordinates. If one updates the WCS of the images by
+the plate solution and the repeats the plate solution, particularly when
+using multiple exposures, an iterative convergence to a self-consistent
+WCS of both the tangent point and plate solution can be obtained.
+
+Several polynomial cross terms options are available. Options "none",
+"half", and "full" are illustrated below for a quadratic polynomial in
+x and y.
+
+.nf
+xxterms = "none", xyterms = "none"
+xxorder = 3, xyorder = 3, yxorder = 3, yyorder = 3
+
+ xi = a11 + a21 * x + a12 * y +
+ a31 * x ** 2 + a13 * y ** 2
+ eta = a11' + a21' * x + a12' * y +
+ a31' * x ** 2 + a13' * y ** 2
+
+xxterms = "half", xyterms = "half"
+xxorder = 3, xyorder = 3, yxorder = 3, yyorder = 3
+
+ xi = a11 + a21 * x + a12 * y +
+ a31 * x ** 2 + a22 * x * y + a13 * y ** 2
+ eta = a11' + a21' * x + a12' * y +
+ a31' * x ** 2 + a22' * x * y + a13' * y ** 2
+
+xxterms = "full", xyterms = "full"
+xxorder = 3, xyorder = 3, yxorder = 3, yyorder = 3
+
+ xi = a11 + a21 * x + a31 * x ** 2 +
+ a12 * y + a22 * x * y + a32 * x ** 2 * y +
+ a13 * y ** 2 + a23 * x * y ** 2 + a33 * x ** 2 * y ** 2
+ eta = a11' + a21' * x + a31' * x ** 2 +
+ a12' * y + a22' * x * y + a32' * x ** 2 * y +
+ a13' * y ** 2 + a23' * x * y ** 2 + a33' * x ** 2 * y ** 2
+.fi
+
+If \fIrefpoint\fR is "coords", then the sky projection reference point is set
+to the mean of the input celestial coordinates. For images where the true
+reference point is close to the center of the input coordinate distribution,
+this definition is adequate for many purposes. If \fIrefpoint\fR is "user",
+the user may either set the celestial coordinates of the reference
+point explicitly, e.g. \fIlngref\fR = 13:41:02.3 and \fIlatref\fR = -33:42:20,
+or point these parameters to the appropriate keywords in the input image
+header, e.g. \fIlngref\fR = RA, \fIlatref\fR = DEC for NOAO image data.
+If undefined the celestial coordinate system of the reference point
+\fIrefsystem\fR defaults to the celestial coordinate system of the input
+coordinates, otherwise it be any of the supported celestial coordinate
+systems described above. The user may also set \fIrefsystem\fR to the
+image header keyword containing the epoch of the celestial reference point
+coordinates in years, e.g. EPOCH for NOAO data. In this case the
+reference point coordinates are assumed to be equatorial FK4 coordinates at the
+epoch specified by EPOCH. The units of the reference point celestial
+coordinates are specified by the \fIlngrefunits\fR and \fIlatrefunits\fR
+parameters. Lngrefunits and latrefunits default to the values of the input
+coordinate units if undefined by either the user or the \fIrefsystem\fR
+parameter. ONCE DETERMINED THE REFERENCE POINT CANNOT BE RESET DURING
+THE FITTING PROCESS.
+
+The \fIxref\fR and \fIyref\fR parameters may be used to constrain the
+solution to putting the reference coordinate at the reference pixel.
+Effectively what this does is fix the zero-th order coefficient in the
+linear part of the solution. If a reference pixel is not specified the
+solution will produce a point determined from the zero-th order
+constant coefficient. This may not be what is expected based on
+the specified reference celestial coordinate.
+
+The fitting functions f and g are specified by the \fIfunction\fR parameter
+and may be power series polynomials, Legendre polynomials, or Chebyshev
+polynomials of order \fIxxorder\fR and \fIxyorder\fR in x and \fIyxorder\fR
+and \fIyyorder\fR in y. Cross-terms are optional and are turned on and
+off by setting the \fIxxterms\fR and \fIxyterms\fR parameters. If the
+\fBfitgeometry\fR parameter is anything other than "general", the order
+parameters assume the value 2 and the cross-terms switches assume the value
+"none", regardless of the values set by the user. All computation are done in
+double precision. Automatic pixel rejection may be enabled by setting
+\fImaxiter\fR > 0 and \fIreject\fR to a positive value, usually something
+in the range 2.5-5.0.
+
+CCMAP may be run interactively by setting \fIinteractive\fR to "yes" and
+inputting commands by the use of simple keystrokes. In interactive mode the
+user has the option of changing the fitting parameters and displaying the
+data and fit graphically until a satisfactory fit has been achieved. The
+keystroke commands are listed below.
+
+.nf
+
+? Print options
+f Fit data and graph fit with the current graph type (g,x,r,y,s)
+g Graph the data and the current fit
+x,r Graph the xi residuals versus x and y respectively
+y,s Graph the eta residuals versus x and y respectively
+d,u Delete or undelete the data point nearest the cursor
+o Overplot the next graph
+c Toggle the line of constant x and y plotting option
+t Plot a line of constant x and y through nearest data point
+l Print xishift, etashift, xscale, yscale, xrotate, yrotate
+q Exit the interactive fitting code
+.fi
+
+The parameters listed below can be changed interactively with simple colon
+commands. Typing the parameter name along will list the current value.
+
+.nf
+:show List parameters
+:projection Sky projection
+:refpoint Sky projection reference point
+:fit [value] Fit type (shift,xyscale,rotate,rscale,rxyscale,general)
+:function [value] Fitting function (chebyshev,legendre,polynomial)
+:xxorder [value] Xi fitting function order in x
+:xyorder [value] Xi fitting function order in y
+:yxorder [value] Eta fitting function order in x
+:yyorder [value] Eta fitting function order in y
+:xxterms [n/h/f] The xi fit cross terms type
+:yxterms [n/h/f] The eta fit cross terms type
+:maxiter [value] Maximum number of rejection iterations
+:reject [value] K-sigma rejection threshold
+.fi
+
+The final fit is stored in the text database file \fIdatabase\fR file in a
+format suitable for use by the CCSETWCS and CCTRAN tasks. Each fit is
+stored in a record whose name is the name of the input image \fIimage\fR
+if one is supplied, or the name of the input coordinate file \fIinput\fR.
+
+If the \fIupdate\fR switch is "yes" and an input image is specified,
+a new image wcs is derived from the linear component of the computed plate
+solution and written to the image header. The numerical components of
+the new image wcs are written to the standards FITS keywords, CRPIX, CRVAL,
+and CD, with the actual values depending on the input pixel coordinate
+system \fIpixsystem\fR.
+The FITS keywords which define the image celestial coordinate
+system CTYPE, RADECSYS, EQUINOX, and MJD-WCS are set by the \fIinsystem\fR and
+\fIprojection\fR parameters.
+
+The first four characters of the values of the ra / longitude and dec / latitude
+axis CTYPE keywords specify the celestial coordinate system. They are set to
+RA-- / DEC- for equatorial coordinate systems, ELON / ELAT for the ecliptic
+coordinate system, GLON / GLAT for the galactic coordinate system, and
+SLON / SLAT for the supergalactic coordinate system.
+
+The second four characters of the values of the ra / longitude and dec /
+latitude axis CTYPE keywords specify the sky projection geometry. IRAF
+currently supports the TAN, SIN, ARC, AIT, CAR, CSC, GLS, MER, MOL, PAR, PCO,
+QSC, STG, TSC, and ZEA standard projections, in which case the second 4
+characters of CTYPE are set to -TAN, -ARC, -SIN, etc. IRAF and CCMAP also
+support the experiment TAN plus polynomials function driver.
+
+If the input celestial coordinate system is equatorial, the value of the
+RADECSYS keyword specifies the fundamental equatorial system, EQUINOX
+specifies the epoch of the mean place, and MJD-WCS specifies the epoch
+for which the mean place is correct. The permitted values of
+RADECSYS are FK4, FK4-NO-E, FK5, ICRS, and GAPPT. EQUINOX is entered in years
+and interpreted as a Besselian epoch for the FK4 system, a Julian epoch
+for the FK5 system. The epoch of the wcs MJD-WCS is entered as
+a modified Julian date. Only those keywords necessary to defined the
+new wcs are written. Any existing keywords which are not required to
+define the wcs or are redundant are removed, with the exception of
+DATE-OBS and EPOCH, which are left unchanged for obvious (DATE_OBS) and
+historical (use of EPOCH keyword at NOAO) reasons.
+
+If \fIverbose\fR is "yes", various pieces of useful information are
+printed to the terminal as the task proceeds. If \fIresults\fR is set to a
+file name then the original pixel and celestial coordinates, the fitted
+celestial coordinates, and the residuals of the fit in arcseconds are written
+to that file.
+
+The transformation computed by the "general" fitting geometry is arbitrary
+and does not correspond to a physically meaningful model. However the computed
+coefficients for the linear term can be given a simple geometrical
+interpretation for all the fitting geometries as shown below.
+
+.nf
+ fitting geometry = general (linear term)
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+
+ fitting geometry = shift
+ xi = a + x
+ eta = d + y
+
+ fitting geometry = xyscale
+ xi = a + b * x
+ eta = d + f * y
+
+ fitting geometry = rotate
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b * f - c * e = +/-1
+ b = f, c = -e or b = -f, c = e
+
+ fitting geometry = rscale
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b * f - c * e = +/- const
+ b = f, c = -e or b = -f, c = e
+
+ fitting geometry = rxyscale
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b * f - c * e = +/- const
+.fi
+
+The coefficients can be interpreted as follows. X0, y0, xi0, eta0
+are the origins in the reference and input frames respectively. By definition
+xi0 and eta0 are 0.0 and 0.0 respectively. Rotation and skew are the rotation
+of the x and y axes and their deviation from perpendicularity respectively.
+Xmag and ymag are the scaling factors in x and y in " / pixel and are assumed
+to be positive by definition.
+
+.nf
+ general (linear term)
+ xrotation = rotation - skew / 2
+ yrotation = rotation + skew / 2
+ b = xmag * cos (xrotation)
+ c = ymag * sin (yrotation)
+ e = -xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * x0 - c * y0 = xshift
+ d = eta0 - e * x0 - f * y0 = yshift
+
+ shift
+ xrotation = 0.0, yrotation = 0.0
+ xmag = ymag = 1.0
+ b = 1.0
+ c = 0.0
+ e = 0.0
+ f = 1.0
+ a = xi0 - x0 = xshift
+ d = eta0 - y0 = yshift
+
+ xyscale
+ xrotation 0.0 / 180.0 yrotation = 0.0
+ b = + /- xmag
+ c = 0.0
+ e = 0.0
+ f = ymag
+ a = xi0 - b * x0 = xshift
+ d = eta0 - f * y0 = yshift
+
+ rscale
+ xrotation = rotation + 0 / 180, yrotation = rotation
+ mag = xmag = ymag
+ const = mag * mag
+ b = mag * cos (xrotation)
+ c = mag * sin (yrotation)
+ e = -mag * sin (xrotation)
+ f = mag * cos (yrotation)
+ a = xi0 - b * x0 - c * y0 = xshift
+ d = eta0 - e * x0 - f * y0 = yshift
+
+ rxyscale
+ xrotation = rotation + 0 / 180, yrotation = rotation
+ const = xmag * ymag
+ b = xmag * cos (xrotation)
+ c = ymag * sin (yrotation)
+ e = -xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * x0 - c * y0 = xshift
+ d = eta0 - e * x0 - f * y0 = yshift
+.fi
+
+.ih
+REFERENCES
+
+
+Additional information on the IRAF 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".
+
+Details of the FITS header world coordinate system interface can
+be found in the draft paper "World Coordinate Systems Representations Within the
+FITS Format" by Hanisch and Wells, available from the iraf anonymous ftp
+archive and the draft paper which supersedes it "Representations of Celestial
+Coordinates in FITS" by Greisen and Calabretta available from the NRAO
+anonymous ftp archives.
+
+The spherical astronomy routines employed here are derived from the Starlink
+SLALIB library provided courtesy of Patrick Wallace. These routines
+are very well documented internally with extensive references provided
+where appropriate. Interested users are encouraged to examine the routines
+for this information. Type "help slalib" to get a listing of the SLALIB
+routines, "help slalib opt=sys" to get a concise summary of the library,
+and "help <routine>" to get a description of each routine's calling sequence,
+required input and output, etc. An overview of the library can be found in the
+paper "SLALIB - A Library of Subprograms", Starlink User Note 67.7
+by P.T. Wallace, available from the Starlink archives.
+
+
+
+.ih
+EXAMPLES
+
+1. Compute the plate scale for the test image dev$pix given the following
+coordinate list. Set the tangent point to the mean of the input celestial
+coordinates. Compute the plate scale interactively.
+
+.nf
+cl> type coords
+
+13:29:47.297 47:13:37.52 327.50 410.38
+13:29:37.406 47:09:09.18 465.50 62.10
+13:29:38.700 47:13:36.23 442.01 409.65
+13:29:55.424 47:10:05.15 224.35 131.20
+13:30:01.816 47:12:58.79 134.37 356.33
+
+cl> imcopy dev$pix pix
+
+cl> hedit pix epoch 1987.26
+
+cl> ccmap coords coords.db image=pix xcol=3 ycol=4 lngcol=1 latcol=2
+
+ ... a plot of the mapping function appears
+ ... type ? to see the list of commands
+ ... type x to see the xi fit residuals versus x
+ ... type r to see the xi fit residuals versus y
+ ... type y to see the eta fit residuals versus x
+ ... type s to see the eta fit residuals versus y
+ ... type g to return to the default plot
+ ... type l to see the computed x and y scales in " / pixel
+ ... type q to quit and save fit
+.fi
+
+2. Repeat example 2 but compute the fit non-interactively and list the
+fitted values of the ra and dec and their residuals on the standard
+output.
+
+.nf
+cl> ccmap coords coords.db image=pix results=STDOUT xcol=3 ycol=4 \
+lngcol=1 latcol=2 inter-
+
+# Coords File: coords Image: pix
+# Database: coords.db Record: pix
+# Refsystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Coordinate mapping status
+# XI fit ok. ETA fit ok.
+# Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+# Coordinate mapping parameters
+# Sky projection geometry: tan
+# Reference point: 13:29:48.129 47:11:53.37 (hours degrees)
+# Reference point: 318.735 273.900 (pixels pixels)
+# X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+# X and Y axis rotation: 179.110 358.958 (degrees degrees)
+# Wcs mapping status
+# Ra/Dec or Long/Lat wcs rms: 0.229 0.241 (arcsec arcsec)
+#
+# Input Coordinate Listing
+# X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+#
+327.5 410.4 13:29:47.30 47:13:37.5 13:29:47.28 47:13:37.9 0.128 -0.370
+465.5 62.1 13:29:37.41 47:09:09.2 13:29:37.42 47:09:09.2 -0.191 -0.062
+442.0 409.6 13:29:38.70 47:13:36.2 13:29:38.70 47:13:35.9 0.040 0.282
+224.3 131.2 13:29:55.42 47:10:05.2 13:29:55.40 47:10:05.1 0.289 0.059
+134.4 356.3 13:30:01.82 47:12:58.8 13:30:01.84 47:12:58.7 -0.267 0.091
+.fi
+
+3. Repeat the previous example but in this case input the position of the
+tangent point in fk4 1950.0 coordinates.
+
+.nf
+cl> ccmap coords coords.db image=pix results=STDOUT xcol=3 ycol=4 lngcol=1 \
+latcol=2 refpoint=user lngref=13:27:46.9 latref=47:27:16 refsystem=b1950.0 \
+inter-
+
+# Coords File: coords Image: pix
+# Database: coords.db Record: pix
+# Refsystem: b1950.0 Coordinates: equatorial FK4
+# Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Coordinate mapping status
+# XI fit ok. ETA fit ok.
+# Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+# Coordinate mapping parameters
+# Sky projection geometry: tan
+# Reference point: 13:29:53.273 47:11:48.36 (hours degrees)
+# Reference point: 250.256 266.309 (pixels pixels)
+# X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+# X and Y axis rotation: 179.126 358.974 (degrees degrees)
+# Wcs mapping status
+# Ra/Dec or Long/Lat wcs rms: 0.229 0.241 (arcsec arcsec)
+#
+# Input Coordinate Listing
+# X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+
+327.5 410.4 13:29:47.30 47:13:37.5 13:29:47.28 47:13:37.9 0.128 -0.370
+465.5 62.1 13:29:37.41 47:09:09.2 13:29:37.42 47:09:09.2 -0.191 -0.062
+442.0 409.6 13:29:38.70 47:13:36.2 13:29:38.70 47:13:35.9 0.040 0.282
+224.3 131.2 13:29:55.42 47:10:05.2 13:29:55.40 47:10:05.1 0.289 0.059
+134.4 356.3 13:30:01.82 47:12:58.8 13:30:01.84 47:12:58.7 -0.267 0.091
+.fi
+
+Note the computed image scales are identical in examples 2 and 3 but that
+the assumed position of the tangent point is different (the second estimate
+is more accurate) producing different values for the pixel and celestial
+coordinates of the reference point and small differences in the computed
+rotation angles.
+
+4. Repeat the previous example but in this case extract the position of the
+tangent point in from the image header keywords RA, DEC, and EPOCH.
+
+.nf
+cl> imheader pix l+
+
+...
+DATE-OBS= '05/04/87' / DATE DD/MM/YY
+RA = '13:29:24.00' / RIGHT ASCENSION
+DEC = '47:15:34.00' / DECLINATION
+EPOCH = 1987.26 / EPOCH OF RA AND DEC
+...
+
+cl> ccmap coords coords.db image=pix results=STDOUT xcol=3 ycol=4 \
+lngcol=1 latcol=2 refpoint=user lngref=RA latref=DEC refsystem=EPOCH \
+inter-
+
+# Coords File: coords Image: pix
+# Database: coords.db Record: pix
+# Refsystem: fk4 b1987.26 Coordinates: equatorial FK4
+# Equinox: B1987.260 Epoch: B1987.26000000 MJD: 46890.84779
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Coordinate mapping status
+# XI fit ok. ETA fit ok.
+# Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+# Coordinate mapping parameters
+# Sky projection geometry: tan
+# Reference point: 13:29:56.232 47:11:38.19 (hours degrees)
+# Reference point: 211.035 252.447 (pixels pixels)
+# X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+# X and Y axis rotation: 179.135 358.983 (degrees degrees)
+# Wcs mapping status
+# Ra/Dec or Long/Lat wcs rms: 0.229 0.241 (arcsec arcsec)
+#
+# Input Coordinate Listing
+# X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+
+327.5 410.4 13:29:47.30 47:13:37.5 13:29:47.28 47:13:37.9 0.128 -0.370
+465.5 62.1 13:29:37.41 47:09:09.2 13:29:37.42 47:09:09.2 -0.191 -0.062
+442.0 409.6 13:29:38.70 47:13:36.2 13:29:38.70 47:13:35.9 0.040 0.282
+224.3 131.2 13:29:55.42 47:10:05.2 13:29:55.40 47:10:05.1 0.289 0.059
+134.4 356.3 13:30:01.82 47:12:58.8 13:30:01.84 47:12:58.7 -0.267 0.091
+
+.fi
+
+Note that the position of the tangent point is slightly different again but
+that this does not have much affect on the fitted coordinates for this image.
+
+5. Repeat the third example but this time store the computed world coordinate
+system in the image header and check the header update with the imheader and
+skyctran tasks.
+
+.nf
+cl> imheader pix l+
+...
+DATE-OBS= '05/04/87' / DATE DD/MM/YY
+RA = '13:29:24.00' / RIGHT ASCENSION
+DEC = '47:15:34.00' / DECLINATION
+EPOCH = 1987.26 / EPOCH OF RA AND DEC
+...
+
+cl> ccmap coords coords.db image=pix results=STDOUT xcol=3 ycol=4 \
+lngcol=1 latcol=2 refpoint=user lngref=13:27:46.9 latref=47:27:16 \
+refsystem=b1950.0 inter- update+
+
+# Coords File: coords Image: pix
+# Database: coords.db Record: pix
+# Refsystem: b1950.0 Coordinates: equatorial FK4
+# Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
+# Insystem: j2000 Coordinates: equatorial FK5
+# Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+# Coordinate mapping status
+# Coordinate mapping status
+# XI fit ok. ETA fit ok.
+# Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+# Coordinate mapping parameters
+# Sky projection geometry: tan
+# Reference point: 13:29:53.273 47:11:48.36 (hours degrees)
+# Reference point: 250.256 266.309 (pixels pixels)
+# X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+# X and Y axis rotation: 179.126 358.974 (degrees degrees)
+# Wcs mapping status
+# Ra/Dec or Long/Lat wcs rms: 0.229 0.241 (arcsec arcsec)
+# Updating image header wcs
+#
+#
+# Input Coordinate Listing
+# X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+
+327.5 410.4 13:29:47.30 47:13:37.5 13:29:47.28 47:13:37.9 0.128 -0.370
+465.5 62.1 13:29:37.41 47:09:09.2 13:29:37.42 47:09:09.2 -0.191 -0.062
+442.0 409.6 13:29:38.70 47:13:36.2 13:29:38.70 47:13:35.9 0.040 0.282
+224.3 131.2 13:29:55.42 47:10:05.2 13:29:55.40 47:10:05.1 0.289 0.059
+134.4 356.3 13:30:01.82 47:12:58.8 13:30:01.84 47:12:58.7 -0.267 0.091
+
+cl> imheader pix l+
+...
+DATE-OBS= '05/04/87' / DATE DD/MM/YY
+RA = '13:29:24.00' / RIGHT ASCENSION
+DEC = '47:15:34.00' / DECLINATION
+EPOCH = 1987.26 / EPOCH OF RA AND DEC
+...
+RADECSYS= 'FK5 '
+EQUINOX = 2000.
+MJD-WCS = 51544.5
+WCSDIM = 2
+CTYPE1 = 'RA---TAN'
+CTYPE2 = 'DEC--TAN'
+CRVAL1 = 202.471969550729
+CRVAL2 = 47.1967667056819
+CRPIX1 = 250.255619786203
+CRPIX2 = 266.308757328719
+CD1_1 = -2.1224568721716E-4
+CD1_2 = -3.8136850875221E-6
+CD2_1 = -3.2384199624421E-6
+CD2_2 = 2.12935798198448E-4
+LTM1_1 = 1.
+LTM2_2 = 1.
+WAT0_001= 'system=image'
+WAT1_001= 'wtype=tan axtype=ra'
+WAT2_001= 'wtype=tan axtype=dec'
+...
+
+cl> skyctran coords STDOUT "pix log" "pix world" lngcol=3 latcol=4 trans+
+
+# Insystem: pix logical Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK5 Equinox: J2000.000
+# Epoch: J2000.00000000 MJD: 51544.50000
+# Outsystem: pix world Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK5 Equinox: J2000.000
+# Epoch: J2000.00000000 MJD: 51544.50000
+
+# Input file: incoords Output file: STDOUT
+
+13:29:47.297 47:13:37.52 13:29:47.284 47:13:37.89
+13:29:37.406 47:09:09.18 13:29:37.425 47:09:09.24
+13:29:38.700 47:13:36.23 13:29:38.696 47:13:35.95
+13:29:55.424 47:10:05.15 13:29:55.396 47:10:05.09
+13:30:01.816 47:12:58.79 13:30:01.842 47:12:58.70
+
+.fi
+
+Note that two versions of the rms values are printed, one for the fit
+and one for the wcs fit. For the default fitting parameters these
+two estimates should be identical. If a non-linear high order plate
+solution is requested however, the image wcs will have lower precision
+than the than the full plate solution, because only the linear component
+of the plate solution is preserved in the wcs.
+
+.ih
+BUGS
+
+.ih
+SEE ALSO
+cctran,ccsetwcs,skyctran,imctran,finder.tfinder,finder.tastrom
+.endhelp
diff --git a/pkg/images/imcoords/doc/ccsetwcs.hlp b/pkg/images/imcoords/doc/ccsetwcs.hlp
new file mode 100644
index 00000000..b5700cbc
--- /dev/null
+++ b/pkg/images/imcoords/doc/ccsetwcs.hlp
@@ -0,0 +1,562 @@
+.help ccsetwcs Jun99 images.imcoords
+.ih
+NAME
+ccsetwcs -- create an image wcs from a plate solution
+.ih
+USAGE
+ccsetwcs image database solutions
+.ih
+PARAMETERS
+.ls images
+The input images for which the wcs is to be created.
+.le
+.ls database
+The text database file written by the ccmap task containing the
+plate solutions. If database is undefined ccsetwcs computes
+the image wcs using the xref, yref, xmag, ymag, xrotation, yrotation,
+lngref, latref, lngrefunits, latrefunits, and projection parameters.
+.le
+.ls solutions
+The list of plate solutions. The number of plate solutions must be one
+or equal to the number of input images. Solutions is either a user name
+supplied to the ccmap task, or the
+name of the ccmap task input image for which the plate solution is valid,
+or the name of the coordinate file that the ccmap task used to compute the
+plate solution. The quantities stored in transform always supersede the
+values of the xref, yref, xmag, ymag, xrotation, yrotation, lngref, latref,
+lnrefunits, latrefunits, and projection parameters.
+.le
+.ls xref = INDEF, yref = INDEF
+The x and y pixel coordinates of the sky projection reference point.
+If database is undefined then xref and yref default to the center of the
+image in pixel coordinates, otherwise these parameters are ignored.
+.le
+.ls xmag = INDEF, ymag = INDEF
+The x and y scale factors in arcseconds per pixel. If database is undefined
+xmag and ymag default to 1.0 and 1.0 arcsec / pixel, otherwise these parameters
+are ignored.
+.le
+.ls xrotation = INDEF, yrotation = INDEF
+The x and y rotation angles in degrees measured counter-clockwise with
+respect to the x and y axes. Xrotation and yrotation are interpreted as the
+rotation of the coordinates with respect to the x and y axes and default 0.0
+and 0.0 degrees. For example xrotation and yrotation values of 30.0 and 30.0
+will rotate a point 30 degrees counter-clockwise with respect to the x and y
+axes. To flip the x axis coordinates in this case either set the angles to
+210.0 and 30.0 degrees or leave the angles set to 30.0 and 30.0 and set the
+xmag parameter to a negative value. To set east to the up, down, left, and
+right directions, set xrotation to 90, 270, 180, and 0 respectively. To set
+north to the up, down, left, and right directions, set yrotation to 0, 180,
+90, and 270 degrees respectively. Any global rotation must be added to both the
+xrotation and yrotation values.
+.le
+.ls lngref = INDEF, latref = INDEF
+The celestial coordinates of the sky projection reference point, e.g.
+the ra and dec of the reference point for equatorial systems. If database is
+undefined lngref and latref default to 0.0 and 0.0, otherwise these parameters
+are ignored.
+.le
+.ls lngunits = "", latunits = ""
+The units of the lngref and latref parameters.
+The options are "hours", "degrees", "radians" for the ra / longitude
+coordinates, and "degrees" and "radians" for the dec / latitude coordinates.
+If database is undefined then lngunits and latunits default to the preferred
+units for the celestial coordinate system defined by the \fIcoosystem\fR
+parameter, otherwise these parameters are ignored.
+.le
+.ls transpose = no
+Transpose the newly created image wcs ?
+.le
+.ls projection = "tan"
+The sky projection geometry. The most commonly used projections in
+astronomy are "tan", "arc", "sin", and "lin". Other supported projections
+are "ait", "car", "csc", "gls", "mer", "mol", "par", "pco", "qsc", "stg",
+"tsc", and "zea".
+.le
+.ls coosystem = "j2000"
+The celestial coordinate system. The systems of most interest to users
+are "icrs", "j2000" and "b1950" which stand for the ICRS J2000.0, FK5 J2000.0,
+and FK4 B1950.0 celestial coordinate systems respectively. The full set of
+options are listed below. The celestial coordinate system sets the preferred
+units for the lngref and latref parameters and the correct values of the image
+wcs header keywords CTYPE, RADECSYS, EQUINOX, and MJD-WCS if the image header
+wcs is updated. If database is undefined the coosystem parameter is used,
+otherwise this parameter is ignored.
+
+.ls equinox [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system if equinox is a
+Julian epoch, e.g. J2000.0 or 2000.0, or the equatorial mean place
+pre-IAU 1976 system (FK4) if equinox is a Besselian epoch, e.g. B1950.0
+or 1950.0. Julian equinoxes are prefixed by a J or j, Besselian equinoxes
+by a B or b. Equinoxes without the J / j or B / b prefix are treated as
+Besselian epochs if they are < 1984.0, Julian epochs if they are >= 1984.0.
+Epoch is the epoch of the observation and may be a Julian
+epoch, a Besselian epoch, or a Julian date. Julian epochs
+are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to the epoch type of
+equinox if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls icrs [equinox] [epoch]
+The International Celestial Reference System where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk5 [equinox] [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system where equinox is a
+Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0. Epoch
+is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls noefk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system but without the E-terms
+where equinox is a Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day. If undefined epoch defaults to equinox.
+.le
+.ls apparent epoch
+The equatorial geocentric apparent place post-IAU 1976 system where
+epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date.
+.le
+.ls ecliptic epoch
+The ecliptic coordinate system where epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch values < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day.
+.le
+.ls galactic [epoch]
+The IAU 1958 galactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+.ls supergalactic [epoch]
+The deVaucouleurs supergalactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+
+In all the above cases fields in [] are optional with the defaults as
+described. The epoch field for icrs, fk5, galactic, and supergalactic
+coordinate systems is required only if the input coordinates are in the
+equatorial fk4, noefk4, fk5, or icrs systems and proper motions are defined.
+.le
+.ls update = yes
+Update the world coordinate system in the input image headers ?
+The numerical quantities represented by the keywords CRPIX,
+CRVAL, and CD are computed from the linear portion of the plate solution.
+The values of the keywords CTYPE, RADECSYS, EQUINOX, and MJD-WCS
+are set by the \fIprojection\fR and \fIcoosystem\fR parameters if database
+is undefined, otherwise projection and coosystem are read from the plate
+solution. As there is currently no standard mechanism for storing the higher
+order plate solution terms if any in the image header wcs, these terms are
+ignored. Any existing image wcs represented by the above keywords is
+overwritten during the update.
+.le
+.ls pixsystem = "logical"
+The pixel coordinate system. The options are:
+.ls logical
+The logical pixel coordinate system is the coordinate system of the image
+pixels on disk. Since most users measure the pixel coordinates of objects
+in this system, "logical" is the system of choice for most applications.
+.le
+.ls physical
+The physical coordinate system is the pixel coordinate system of the
+parent image. This option is useful for users working on images that are
+pieces of a larger mosaic.
+.le
+
+The pixsystem parameter is only used if no database solution is specified.
+Otherwise pixsystem is read from the database file.
+.le
+.ls verbose = yes
+Print detailed messages about the progress of the task on the standard output ?
+.le
+
+.ih
+DESCRIPTION
+
+CCSETWCS creates an image world coordinate system from the plate solution
+computed by the CCMAP task or supplied by the user, and writes it to the
+headers of the input images \fIimages\fR if the \fIupdate\fR parameter is yes.
+
+The plate solution can either be read from record \fIsolutions\fR in the
+database file \fIdatabase\fR written by CCMAP, or specified by the user
+via the \fIxref\fR, \fIyref\fR, \fIxmag\fR, \fIymag\fR, \fIxrotation\fR,
+\fIyrotation\fR, \fIlngref\fR, \fIlatref\fR, \fIlngunits\fR, \fIlatunits\fR,
+\fItranspose\fR, \fIprojection\fR, \fIcoosystem\fR and \fIpixsystem\fR
+parameters.
+
+The plate solution computed by CCMAP has the following form where x and y
+are the image pixel coordinates and xi and eta are the corresponding standard
+coordinates in arcseconds per pixel. The standard coordinates are computed
+by applying the appropriate sky projection to the celestial coordinates.
+
+
+.nf
+ xi = f (x, y)
+ eta = g (x, y)
+.fi
+
+The functions f and g are either power series, Legendre, or Chebyshev
+polynomials whose order and region of validity were set by the user when
+CCMAP was run. The computed plate solution is somewhat arbitrary and does
+not correspond to any physically meaningful model. However the linear
+component of the plate solution can be given the simple geometrical
+interpretation shown below.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = ymag * sin (yrotation)
+ e = -xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * xref - c * yref = xshift
+ d = eta0 - e * xref - f * yref = yshift
+ xi0 = 0.0
+ eta0 = 0.0
+.fi
+
+xref, yref, xi0, and eta0 are the origins of the pixel and standard
+coordinate systems respectively. xmag and ymag are the x and y scale factors
+in " / pixel and xrotation and yrotation are the rotation angles measured
+counter-clockwise of the x and y axes.
+
+If the CCMAP database is undefined then CCSETWCS computes a linear plate
+solution using the parameters \fIxref\fR, \fIyref\fR, \fIxmag\fR,
+\fIymag\fR, \fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+\fIlngunits\fR, \fIlatunits\fR, \fItranspose\fR, and
+\fIprojection\fR as shown below. Note that in this case
+xrotation and yrotation are interpreted as the rotation of the coordinates
+themselves not the coordinate axes.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = -ymag * sin (yrotation)
+ e = xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * xref - c * yref = xshift
+ d = eta0 - e * xref - f * yref = yshift
+ xi0 = 0.0
+ eta0 = 0.0
+.fi
+
+The \fItranspose\fR parameter can be used to transpose the newly created
+image wcs.
+
+If the \fIupdate\fR switch is "yes" and an input image is specified,
+a new image wcs is derived from the linear component of the computed plate
+solution and written to the image header. The numerical components of
+the new image wcs are written to the standards FITS keywords, CRPIX, CRVAL,
+and CD, with the actual values depending on the pixel coordinate system
+\fIpixsystem\fR read from the database or set by the user. The FITS keywords
+which define the image celestial coordinate system CTYPE, RADECSYS, EQUINOX,
+and MJD-WCS are set by the \fIcoosystem\fR and \fIprojection\fR parameters.
+
+The first four characters of the values of the ra / longitude and dec / latitude
+axis CTYPE keywords specify the celestial coordinate system. They are set to
+RA-- / DEC- for equatorial coordinate systems, ELON / ELAT for the ecliptic
+coordinate system, GLON / GLAT for the galactic coordinate system, and
+SLON / SLAT for the supergalactic coordinate system.
+
+The second four characters of the values of the ra / longitude and dec /
+latitude axis CTYPE keywords specify the sky projection geometry.
+The second four characters of the values of the ra / longitude and dec /
+latitude axis CTYPE keywords specify the sky projection geometry. IRAF
+currently supports the TAN, SIN, ARC, AIT, CAR, CSC, GLS, MER, MOL, PAR, PCO,
+QSC, STG, TSC, and ZEA standard projections, in which case the second 4
+characters of CTYPE are set to -TAN, -ARC, -SIN, etc.
+
+If the input celestial coordinate system is equatorial, the value of the
+RADECSYS keyword specifies the fundamental equatorial system, EQUINOX
+specifies the epoch of the mean place, and MJD-WCS specifies the epoch
+for which the mean place is correct. The permitted values of
+RADECSYS are FK4, FK4-NO-E, FK5, ICRS, and GAPPT. EQUINOX is entered in years
+and interpreted as a Besselian epoch for the FK4 system, a Julian epoch
+for the FK5 and ICRS system. The epoch of the wcs MJD-WCS is entered as
+a modified Julian date. Only those keywords necessary to defined the
+new wcs are written. Any existing keywords which are not required to
+define the wcs or are redundant are removed, with the exception of
+DATE-OBS and EPOCH, which are left unchanged for obvious (DATE-OBS) and
+historical (use of EPOCH keyword at NOAO) reasons.
+
+If \fIverbose\fR is "yes", various pieces of useful information are
+printed to the terminal as the task proceeds.
+
+.ih
+REFERENCES
+
+Additional information on the IRAF 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".
+
+Details of the FITS header world coordinate system interface can
+be found in the draft paper "World Coordinate Systems Representations Within the
+FITS Format" by Hanisch and Wells, available from the iraf anonymous ftp
+archive and the draft paper which supersedes it "Representations of Celestial
+Coordinates in FITS" by Greisen and Calabretta available from the NRAO
+anonymous ftp archives.
+
+The spherical astronomy routines employed here are derived from the Starlink
+SLALIB library provided courtesy of Patrick Wallace. These routines
+are very well documented internally with extensive references provided
+where appropriate. Interested users are encouraged to examine the routines
+for this information. Type "help slalib" to get a listing of the SLALIB
+routines, "help slalib opt=sys" to get a concise summary of the library,
+and "help <routine>" to get a description of each routine's calling sequence,
+required input and output, etc. An overview of the library can be found in the
+paper "SLALIB - A Library of Subprograms", Starlink User Note 67.7
+by P.T. Wallace, available from the Starlink archives.
+
+
+
+.ih
+EXAMPLES
+
+1. Compute the plate solution for an image with the ccmap task and then
+use the ccsetwcs task to create the image wcs. Check the results with the
+imheader and skyctran tasks.
+
+.nf
+cl> type coords
+13:29:47.297 47:13:37.52 327.50 410.38
+13:29:37.406 47:09:09.18 465.50 62.10
+13:29:38.700 47:13:36.23 442.01 409.65
+13:29:55.424 47:10:05.15 224.35 131.20
+13:30:01.816 47:12:58.79 134.37 356.33
+
+
+cl> ccmap coords coords.db image=pix xcol=3 ycol=4 lngcol=1 latcol=2 \
+inter-
+Coords File: coords Image: pix
+ Database: coords.db Record: pix
+Refsystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Coordinate mapping status
+ Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:48.129 47:11:53.37 (hours degrees)
+ Reference point: 318.735 273.900 (pixels pixels)
+ X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+ X and Y axis rotation: 179.110 358.958 (degrees degrees)
+Wcs mapping status
+ Ra/Dec or Long/Lat wcs rms: 0.229 0.241 (arcsec arcsec)
+
+cl> type coords.db
+# Mon 15:10:37 13-May-96
+begin coords
+ xrefmean 318.7460000000001
+ yrefmean 273.9320000000001
+ lngmean 13.49670238888889
+ latmean 47.19815944444444
+ coosystem j2000
+ projection tan
+ lngref 13.49670238888889
+ latref 47.19815944444444
+ lngunits hours
+ latunits degrees
+ xpixref 318.7352667484295
+ ypixref 273.9002619912411
+ geometry general
+ function polynomial
+ xishift 247.3577084680361
+ etashift -206.1795977453246
+ xmag 0.7641733802338992
+ ymag 0.7666917500560622
+ xrotation 179.1101291109185
+ yrotation 358.9582148846163
+ wcsxirms 0.2288984454992771
+ wcsetarms 0.2411034140453112
+ xirms 0.2288984454992771
+ etarms 0.2411034140453112
+ surface1 11
+ 3. 3.
+ 2. 2.
+ 2. 2.
+ 0. 0.
+ 134.3700000000001 134.3700000000001
+ 465.5000000000002 465.5000000000002
+ 62.1 62.1
+ 410.3800000000001 410.3800000000001
+ 247.3577084680361 -206.1795977453246
+ -0.7640812161068504 -0.011868034832272
+ -0.01393966623835092 0.7665650170136847
+ surface2 0
+
+
+
+cl> imheader pix l+
+...
+DATE-OBS= '05/04/87' / DATE DD/MM/YY
+RA = '13:29:24.00' / RIGHT ASCENSION
+DEC = '47:15:34.00' / DECLINATION
+EPOCH = 1987.26 / EPOCH OF RA AND DEC
+...
+
+
+cl> ccsetwcs pix coords.db pix
+Image: pix Database: coords.db Record: pix
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:48.129 47:11:53.37 (hours degrees)
+ Ra/Dec logical image axes: 1 2
+ Reference point: 318.735 273.900 (pixels pixels)
+ X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+ X and Y coordinate rotation: 179.110 358.958 (degrees degrees)
+Updating image header wcs
+
+cl> imheader pix l+
+...
+DATE-OBS= '05/04/87' / DATE DD/MM/YY
+RA = '13:29:24.00' / RIGHT ASCENSION
+DEC = '47:15:34.00' / DECLINATION
+EPOCH = 1987.26 / EPOCH OF RA AND DEC
+...
+RADECSYS= 'FK5 '
+EQUINOX = 2000.
+MJD-WCS = 51544.5
+WCSDIM = 2
+CTYPE1 = 'RA---TAN'
+CTYPE2 = 'DEC--TAN'
+CRVAL1 = 202.450535833334
+CRVAL2 = 47.1981594444445
+CRPIX1 = 318.735266748429
+CRPIX2 = 273.900261991241
+CD1_1 = -2.1224478225190E-4
+CD1_2 = -3.8721295106530E-6
+CD2_1 = -3.2966763422978E-6
+CD2_2 = 2.12934726948246E-4
+LTM1_1 = 1.
+LTM2_2 = 1.
+WAT0_001= 'system=image'
+WAT1_001= 'wtype=tan axtype=ra'
+WAT2_001= 'wtype=tan axtype=dec'
+
+cl> skyctran coords STDOUT "pix log" "pix world" lngcol=3 latcol=4 trans+
+
+# Insystem: pix logical Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK5 Equinox: J2000.000
+# Epoch: J2000.00000000 MJD: 51544.50000
+# Outsystem: pix world Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK5 Equinox: J2000.000
+# Epoch: J2000.00000000 MJD: 51544.50000
+
+# Input file: incoords Output file: STDOUT
+
+13:29:47.297 47:13:37.52 13:29:47.284 47:13:37.89
+13:29:37.406 47:09:09.18 13:29:37.425 47:09:09.24
+13:29:38.700 47:13:36.23 13:29:38.696 47:13:35.95
+13:29:55.424 47:10:05.15 13:29:55.396 47:10:05.09
+13:30:01.816 47:12:58.79 13:30:01.842 47:12:58.70
+.fi
+
+The skyctran task is used to test that the input image wcs is indeed correct.
+Columns 1 and 2 contain the original ra and dec values and columns 3 and 4
+contain the transformed values. The second imheader listing shows what the
+image wcs looks like.
+
+
+2. Repeat the previous example but enter the plate solution parameters by
+hand.
+
+.nf
+cl> ccsetwcs pix "" xref=318.735 yref=273.900 lngref=13:29:48.129 \
+latref=47:11:53.37 xmag=.764 ymag=.767 xrot=180.890 yrot=1.042
+Image: pix
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:48.129 47:11:53.37 (hours degrees)
+ Ra/Dec logical image axes: 1 2
+ Reference point: 318.735 273.900 (pixels pixels)
+ X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+ X and Y coordinate rotation: 180.890 1.042 (degrees degrees)
+Updating image header wcs
+
+
+cl> skyctran coords STDOUT "pix log" "pix world" lngcol=3 latcol=4 trans+
+
+# Insystem: pix logical Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK5 Equinox: J2000.000
+# Epoch: J2000.00000000 MJD: 51544.50000
+# Outsystem: pix world Projection: TAN Ra/Dec axes: 1/2
+# Coordinates: equatorial FK5 Equinox: J2000.000
+# Epoch: J2000.00000000 MJD: 51544.50000
+
+# Input file: incoords Output file: STDOUT
+
+13:29:47.297 47:13:37.52 13:29:47.285 47:13:37.93
+13:29:37.406 47:09:09.18 13:29:37.428 47:09:09.17
+13:29:38.700 47:13:36.23 13:29:38.698 47:13:35.99
+13:29:55.424 47:10:05.15 13:29:55.395 47:10:05.04
+13:30:01.816 47:12:58.79 13:30:01.839 47:12:58.72
+.fi
+
+Note that there are minor differences between the results of examples 1
+and 2 due to precision differences in the input. Note also the difference
+in the way the xrotation and yrotation angles are defined between examples
+1 and 2. In example 2 the rotations are defined as coordinate rotations,
+whereas in example one they are described as axis rotations.
+
+.ih
+BUGS
+
+.ih
+SEE ALSO
+ccmap, cctran, skyctran, imctran
+.endhelp
diff --git a/pkg/images/imcoords/doc/ccstd.hlp b/pkg/images/imcoords/doc/ccstd.hlp
new file mode 100644
index 00000000..b24def49
--- /dev/null
+++ b/pkg/images/imcoords/doc/ccstd.hlp
@@ -0,0 +1,480 @@
+.help ccstd Oct00 images.imcoords
+.ih
+NAME
+ccstd -- transform pixel and celestial coordinates to standard coordinates
+and vice versa
+.ih
+USAGE
+ccstd input output database solutions
+.ih
+PARAMETERS
+.ls input
+The input coordinate files. Coordinates may be entered by hand by setting input
+to "STDIN".
+.le
+.ls output
+The output coordinate files. The number of output files must be one or equal
+to the number of input files. Results may be printed on the terminal by
+setting output to "STDOUT".
+.le
+.ls database
+The text database file written by the ccmap task which contains the
+desired plate solutions. If database is undefined ccstd computes the
+standard coordinates or pixel and celestial coordinates using the current
+values of the xref, yref, xmag ymag, xrotation, yrotation, lngref, latref,
+and projection parameters.
+.le
+.ls solutions
+The database record containing the desired plate solution.
+The number of records must be one or equal to the number of input coordinate
+files. Solutions is either the user name supplied to ccmap, the name of the
+image input to ccmap for which the plate solution is valid, or the name of the
+coordinate file that the ccmap task used to compute the plate solution.
+The quantities stored in solutions always supersede the values of the
+parameters xref, yref, xmag, ymag, xrotation, yrotation, lngref, latref,
+and projection.
+.le
+.ls geometry = "geometric"
+The type of geometric transformation. The geometry parameter is
+only requested if database is defined. The options are:
+.ls linear
+Transform the pixel coordinates to standard coordinates or vice versa
+using the linear part of the plate solution.
+only.
+.le
+.ls geometric
+Transform the pixel coordinates to standard coordinates or vice versa
+using the full plate solution.
+.le
+.le
+.ls forward = yes
+Transform from pixel and celestial coordinates to standard coordinates ? If
+forward is "no" then the plate solution is inverted and standard coordinates
+are transformed to pixel and celestial coordinates.
+.le
+.ls polar = no
+Convert to and from polar standard coordinates instead of Cartesian standard
+coordinates?
+.le
+.ls xref = INDEF, yref = INDEF
+The pixel coordinates of the reference point. If database is undefined
+then xref and yref default to 0.0 and 0.0, otherwise these parameters are
+ignored.
+.le
+.ls xmag = INDEF, ymag = INDEF
+The x and y scale factors in arcseconds per pixel. If database is undefined
+xmag and ymag default to 1.0 and 1.0 arcseconds per pixel, otherwise these
+parameters are ignored.
+.le
+.ls xrotation = INDEF, yrotation = INDEF
+The x and y rotation angles in degrees measured counter-clockwise with
+respect to the x and y axes. If database is undefined then xrotation and
+yrotation are interpreted as the rotation of the coordinates with respect
+to the x and y axes and default to 0.0 and 0.0 degrees. For example xrotation
+and yrotation values of 30.0 and 30.0 degrees will rotate a point 30 degrees
+counter-clockwise with respect to the x and y axes. To flip the x axis
+coordinates in this case either set the angles to 210.0 and 30.0 degrees
+or leave the angles at 30.0 and 30.0 and set the xmag parameter to a negative
+value. If database is defined these parameters are ignored. The ccmap task
+computes the x and y rotation angles of the x and y axes, not the rotation
+angle of the coordinates. An celestial coordinate system rotated 30 degrees
+counter-clockwise with respect to the pixel coordinate system will produce
+xrotation and yrotation values o 330.0 and 330.0 or equivalently -30.0 and
+-30.0 degrees in the database file not 30.0 and 30.0.
+.le
+.ls lngref = INDEF, latref = INDEF
+The celestial coordinates of the reference point, e.g. the ra and dec
+of the reference point for equatorial systems, galactic longitude and
+latitude of the reference for galactic systems. If database is undefined
+lngref and latref default to 0.0 and 0.0, otherwise these parameters are
+ignored.
+.le
+.ls lngunits = "", latunits = ""
+The units of the input or output ra / longitude and dec / latitude coordinates.
+The options are "hours", "degrees", "radians" for ra / longitude coordinates,
+and "degrees" and "radians" for dec / latitude systems. If lngunits and
+latunits are undefined they default to the values in the database records.
+If database is undefined then lngunits and latunits default to "hours" and
+"degrees" respectively.
+.le
+.ls projection = "tan"
+The sky projection geometry. The options are "tan", "sin", "arc" and
+"lin". If database is undefined then the value of the projection parameter
+is used, otherwise this parameter is ignored.
+.le
+.ls xcolumn = 1, ycolumn = 2
+The columns in the input coordinate file containing the x and y coordinates
+if the \fIforward\fR parameter is "yes", or the corresponding standard
+coordinates xi and eta if the forward parameter is "no".
+.le
+.ls lngcolumn = 3, latcolumn = 4
+The columns in the input coordinate file containing the celestial coordinates
+if the \fIforward\fR parameter is "yes", or the corresponding standard
+coordinates xi and eta if the forward parameter is "no".
+.le
+.ls lngformat = "", latformat = ""
+The default output format of the transformed coordinates in lngcolumn and
+latcolumn. If forward = yes then the default output format is "%10.3f".
+Otherwise the defaults are "%12.2h" for output coordinates in hours, "%11.1h"
+for output coordinates in degrees, and "%13.7g" for output coordinates in
+radians.
+.le
+.ls xformat = "", yformat = ""
+The default output format of the transformed coordinates in xcolumn and
+ycolumn. The default is "%10.3f".
+.le
+.ls min_sigdigits = 7
+The minimum precision of the output coordinates.
+.le
+
+.ih
+DESCRIPTION
+
+CCSTD transforms the list of input coordinates in the
+text file \fIinput\fR and writes the transformed
+coordinates to the text file \fIoutput\fR. The input coordinates
+are read from and the output coordinates written to, the columns
+\fIxcolumn\fR, \fIycolumn\fR, \fIlngcolumn\fR, and \fIlatcolumn\fR
+in the input and output
+files. The format of the output coordinates can be specified using the
+\fIxformat\fR, \fIyformat\fR, \fIlngformat\fR and \fIlatformat\fR parameters.
+If the output formats are unspecified the coordinates are written out with
+reasonable default formats, e.g. "%10.3f" for standard coordinates,
+"%12.2h" and "11.1h" for celestial coordinates in hours or degrees,
+and "%13.7g" for celestial coordinates in radians. All the remaining
+fields in the
+input file are copied to the output file without modification. Blank lines
+and comment lines are also passed to the output file unaltered.
+
+The plate solution can either be read from record \fIsolutions\fR
+in the database file \fIdatabase\fR written by CCMAP, or specified
+by the user via the \fIxref\fR, \fIyref\fR, \fIxmag\fR, \fIymag\fR,
+\fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+and \fIprojection\fR parameters. \fIlngunits\fR and \fIlatunits\fR
+define the units of the input celestial coordinates. If
+undefined they default to the values in the database or to
+the quantities "hours" and "degrees" respectively. The standard coordinates
+are always written and read in units of arcseconds.
+
+If the \fIforward\fR
+parameter is "yes", the input coordinates are assumed to be pixel coordinates
+and celestial coordinates. The pixel coordinates are transformed to standard
+coordinates using the plate solution, and celestial coordinates are
+transformed to standard coordinates using the position of the reference
+point \fIlngref\fR, \fIlatref\fR, and the projection specified by
+\fIprojection\fR. If \fIforward\fR is "no", then
+the input coordinates are assumed to be standard coordinates and
+those in \fIxcolumn\fR and \fIycolumn\fR are transformed to pixel
+coordinates by inverting the plate solution, and those in \fIlngcolumn\fR
+and \fIlatcolumn\fR are transformed to celestial coordinates using the
+position of the reference point and the specified projection.
+
+The plate solution computed by CCMAP has the following form where x and y
+are the pixel coordinates and xi and eta are the corresponding fitted standard
+coordinates in arcseconds per pixel. The observed standard coordinates are
+computed by applying the appropriate sky projection to the celestial
+coordinates.
+
+
+.nf
+ xi = f (x, y)
+ eta = g (x, y)
+.fi
+
+The functions f and g are either power series, Legendre, or Chebyshev
+polynomials whose order and region of validity were set by the user when
+CCMAP was run. The plate solution is arbitrary and does not correspond to
+any physically meaningful model. However the first order terms can be given
+the simple geometrical interpretation shown below.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = ymag * sin (yrotation)
+ e = -xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * xref - c * yref = xshift
+ d = eta0 - e * xref - f * yref = yshift
+ xi0 = 0.0
+ eta0 = 0.0
+.fi
+
+xref, yref, xi0, and eta0 are the origins of the reference and output
+coordinate systems respectively. xi0 and eta0 are both 0.0 by default.
+xmag and ymag are the x and y scales in " / pixel, and xrotation and yrotation
+are the x and y axes rotation angles measured counter-clockwise from original
+x and y axes.
+
+If the CCMAP database is undefined then CCSTD computes a linear plate
+solution using the parameters \fIxref\fR, \fIyref\fR, \fIxmag\fR,
+\fIymag\fR, \fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+\fIlngunits\fR, \fIlatunits\fR and \fIprojection\fR as shown below. Note
+that in this case xrotation and yrotation are interpreted as the rotation
+of the coordinates not the rotation of the coordinate axes.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = -ymag * sin (yrotation)
+ e = xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * xref - c * yref = xshift
+ d = eta0 - e * xref - f * yref = yshift
+ xi0 = 0.0
+ eta0 = 0.0
+.fi
+
+Linear plate solutions are evaluated in the forward and reverse sense
+using the appropriate IRAF mwcs system routines. Higher order plate
+solutions are evaluated in the forward sense using straight-forward
+evaluation of the polynomial terms, in the reverse sense by applying
+Newton's method to the plate solution.
+
+
+.ih
+FORMATS
+
+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:
+
+.nf
+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
+.fi
+
+.ih
+EXAMPLES
+
+.nf
+1. Compute the standard coordinates in arcseconds per pixel given a list of
+pixel and equatorial coordinates and the position of the reference point in
+pixel and equatorial coordinates.
+
+cl> type coords
+13:29:47.297 47:13:37.52 327.50 410.38
+13:29:37.406 47:09:09.18 465.50 62.10
+13:29:38.700 47:13:36.23 442.01 409.65
+13:29:55.424 47:10:05.15 224.35 131.20
+13:30:01.816 47:12:58.79 134.37 356.33
+
+cl> ccstd coords STDOUT "" xref=256.5 yref=256.5 lngref=13:29:48.1 \
+latref = 47:11:53.4 xcol=3 ycol=4 lngcol=1 latcol=2
+ -8.180 104.120 71.000 153.880
+-109.087 -164.189 209.000 -194.400
+ -95.753 102.854 185.510 153.150
+ 74.688 -108.235 -32.150 -125.300
+ 139.745 65.441 -122.130 99.830
+
+2. Repeat the previous example but output the results in polar coordinates.
+The first and third columns contain the radius coordinate in arcseconds,
+the second and fourth columns contain the position angle in degrees measured
+counter-clockwise with respect to the standard coordinates.
+
+cl> ccstd coords STDOUT "" xref=256.5 yref=256.5 lngref=13:29:48.1 \
+latref = 47:11:53.4 xcol=3 ycol=4 lngcol=1 latcol=2 polar+
+104.441 94.492 169.470 65.231
+197.124 236.400 285.434 317.073
+140.526 132.952 240.560 39.542
+131.504 304.608 129.359 255.609
+154.309 25.093 157.740 140.737
+
+
+3. Compute the plate solution and use it to evaluate the Cartesian and
+polar standard coordinates for the input coordinate list used in example 1.
+
+cl> ccmap coords coords.db xcol=3 ycol=4 lngcol=1 latcol=2 inter-
+Coords File: coords Image:
+ Database: coords.db Record: coords
+Refsystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Coordinate mapping status
+ Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:48.129 47:11:53.37 (hours degrees)
+ Reference point: 318.735 273.900 (pixels pixels)
+ X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+ X and Y axis rotation: 179.110 358.958 (degrees degrees)
+
+
+cl> type coords.db
+# Mon 10:29:13 24-Nov-97
+begin coords
+ xrefmean 318.7460000000001
+ yrefmean 273.9320000000001
+ lngmean 13.49670238888889
+ latmean 47.19815944444444
+ coosystem j2000
+ projection tan
+ lngref 13.49670238888889
+ latref 47.19815944444444
+ lngunits hours
+ latunits degrees
+ xpixref 318.7352667484295
+ ypixref 273.9002619912411
+ geometry general
+ function polynomial
+ xishift 247.3577084680361
+ etashift -206.1795977453246
+ xmag 0.7641733802338992
+ ymag 0.7666917500560622
+ xrotation 179.1101291109185
+ yrotation 358.9582148846163
+ wcsxirms 0.2288984454992771
+ wcsetarms 0.2411034140453112
+ xirms 0.2288984454992771
+ etarms 0.2411034140453112
+ surface1 11
+ 3. 3.
+ 2. 2.
+ 2. 2.
+ 0. 0.
+ 134.3700000000001 134.3700000000001
+ 465.5000000000002 465.5000000000002
+ 62.1 62.1
+ 410.3800000000001 410.3800000000001
+ 247.3577084680361 -206.1795977453246
+ -0.7640812161068504 -0.011868034832272
+ -0.01393966623835092 0.7665650170136847
+ surface2 0
+
+
+cl> ccstd coords STDOUT coords.db coords xcol=3 ycol=4 lngcol=1 latcol=2
+ -8.471 104.146 -8.599 104.517
+-109.378 -164.163 -109.188 -164.100
+ -96.044 102.880 -96.084 102.598
+ 74.397 -108.210 74.107 -108.269
+ 139.454 65.467 139.721 65.376
+
+cl> ccstd coords STDOUT coords.db coords xcol=3 ycol=4 lngcol=1 latcol=2 \
+polar+
+104.490 94.650 104.870 94.704
+197.264 236.325 197.106 236.361
+140.744 133.032 140.565 133.122
+131.317 304.509 131.202 304.391
+154.056 25.148 154.259 25.075
+
+4. Use the previous plate solution to transform the pixel and equatorial
+coordinates to standard coordinates but enter the plate solution by hand.
+
+cl> ccstd coords STDOUT "" xref=318.735 yref=273.900 lngref=13:29:48.129 \
+latref=47:11:53.37 xmag=.764 ymag=.767 xrot=180.890 yrot=1.042 xcol=3 \
+ycol=4 lngcol=1 latcol=2
+ -8.475 104.150 -8.599 104.559
+-109.382 -164.159 -109.161 -164.165
+ -96.048 102.884 -96.064 102.640
+ 74.393 -108.206 74.092 -108.313
+ 139.450 65.471 139.688 65.401
+
+cl> ccstd coords STDOUT "" xref=318.735 yref=273.900 lngref=13:29:48.129 \
+latref=47:11:53.37 xmag=.764 ymag=.767 xrot=180.890 yrot=1.042 xcol=3 \
+ycol=4 lngcol=1 latcol=2 polar+
+104.494 94.652 104.912 94.702
+197.263 236.324 197.145 236.378
+140.750 133.032 140.582 133.105
+131.311 304.509 131.230 304.374
+154.054 25.150 154.240 25.089
+
+Note that there are minor differences between the results of examples 3 and
+4 due to precision differences in the input, and that the angles input
+to ccstd in example 4 are the coordinate rotation angles not the axes
+rotation angles as printed by ccmap. The difference is exactly 180 degrees
+in both cases.
+
+5. Use the plate solution computed in example 3 to convert a list
+of standard coordinates into the equivalent pixel and celestial coordinates.
+
+cl> type stdcoords
+ -8.471 104.146 -8.599 104.517
+-109.378 -164.163 -109.188 -164.100
+ -96.044 102.880 -96.084 102.598
+ 74.397 -108.210 74.107 -108.269
+ 139.454 65.467 139.721 65.376
+
+cl> ccstd stdcoords STDOUT coords.db coords xcol=3 ycol=4 lngcol=1 latcol=2 \
+forward-
+
+13:29:47.30 47:13:37.5 327.499 410.381
+13:29:37.41 47:09:09.2 465.500 62.101
+13:29:38.70 47:13:36.2 442.010 409.650
+13:29:55.42 47:10:05.1 224.350 131.200
+13:30:01.82 47:12:58.8 134.370 356.330
+.fi
+
+.ih
+BUGS
+
+.ih
+SEE ALSO
+ccmap, ccsetwcs, cctran, finder.tastrom, skyctran
+.endhelp
diff --git a/pkg/images/imcoords/doc/cctran.hlp b/pkg/images/imcoords/doc/cctran.hlp
new file mode 100644
index 00000000..202598f6
--- /dev/null
+++ b/pkg/images/imcoords/doc/cctran.hlp
@@ -0,0 +1,412 @@
+.help cctran Dec96 images.imcoords
+.ih
+NAME
+cctran -- transform from pixel to celestial coordinates and vice versa
+using the computed plate solution
+.ih
+USAGE
+cctran input output database solutions
+.ih
+PARAMETERS
+.ls input
+The coordinate files to be transformed.
+.le
+.ls output
+The output coordinate files. The number of output files must
+be one or equal to the number of input files.
+.le
+.ls database
+The text database file written by the ccmap task containing the
+desired plate solution. If database is undefined cctran computes
+a linear plate solution using the current values of the xref, yref, xmag
+ymag, xrotation, yrotation, lngref, latref, and projection parameters.
+.le
+.ls solutions
+The database record containing the desired plate solution.
+The number of records must be one or equal to the number of input coordinate
+files. Solutions is either a user name supplied to ccmap, the name of the
+ccmap task
+input image for which the plate solution is valid, or the name of the
+coordinate file that the ccmap task used to compute the plate solution.
+The quantities stored in
+solutions always supersede the values of xref, yref, xmag, ymag,
+xrotation, yrotation, lngref, latref, and projection.
+.le
+.ls geometry = "geometric"
+The type of geometric transformation. The geometry parameter is
+only requested if database is defined. The options are:
+.ls linear
+Transform the coordinates using only the linear part of the plate solution.
+.le
+.ls geometric
+Transform the coordinates using the full plate solution.
+.le
+.le
+.ls forward = yes
+Transform from pixel to celestial coordinates ? If forward is "no" then
+the plate solution is inverted and celestial coordinates are transformed
+to pixel coordinates.
+.le
+.ls xref = INDEF, yref = INDEF
+The x and y pixel coordinates of the reference point. If database is undefined
+then xref and yref default to 0.0 and 0.0, otherwise these parameters are
+ignored.
+.le
+.ls xmag = INDEF, ymag = INDEF
+The x and y scale factors in arcseconds per pixel. If database is undefined
+xmag and ymag default to 1.0 and 1.0 arcseconds per pixel, otherwise these
+parameters are ignored.
+.le
+.ls xrotation = INDEF, yrotation = INDEF
+The x and y rotation angles in degrees measured counter-clockwise with
+respect to the x and y axes. Xrotation and yrotation are interpreted as the
+rotation of the coordinates with respect to the x and y axes and default to
+0.0 and 0.0 degrees. For example xrotation and yrotation values of 30.0 and
+30.0 degrees will rotate a point 30 degrees counter-clockwise with respect to
+the x and y axes. To flip the x axis coordinates in this case either set the
+angles to 210.0 and 30.0 degrees or leave the angles at 30.0 and 30.0 and set
+the xmag parameter to a negative value. To set east to the up, down, left, and
+right directions, set xrotation to 90, 270, 180, and 0 respectively. To set
+north to the up, down, left, and right directions, set yrotation to 0, 180,
+90, and 270 degrees respectively. Any global rotation must be added to both the
+xrotation and yrotation values.
+.le
+.ls lngref = INDEF, latref = INDEF
+The celestial coordinates of the reference point, e.g. the ra and dec
+of the reference point for equatorial systems, galactic longitude and
+latitude for galactic systems. If database is undefined
+lngref and latred default to 0.0 and 0.0, otherwise these parameters are
+ignored.
+.le
+.ls lngunits = "", latunits = ""
+The units of the input or output ra / longitude and dec / latitude coordinates.
+The options are "hours", "degrees", "radians" for ra / longitude coordinates,
+and "degrees" and "radians" for dec / latitude systems. If lngunits and
+latunits are undefined they default to the values in the database records.
+If database is undefined then lngunits and latunits default to "hours" and
+"degrees" respectively.
+.le
+.ls projection = "tan"
+The sky projection geometry. The most commonly used projections in
+astronomy are "tan", "arc", "sin", and "lin". Other supported projections
+are "ait", "car", "csc", "gls", "mer", "mol", "par", "pco", "qsc", "stg",
+"tsc", and "zea".
+.le
+.ls xcolumn = 1, ycolumn = 2
+The columns in the input coordinate file containing the x and y coordinates
+if the \fIforward\fR parameter is "yes", the celestial ra / longitude and
+dec / latitude if the forward parameter is "no".
+.le
+.ls lngformat = "", latformat = ""
+The format of the output coordinates. The defaults are "%10.3f" for
+output coordinates in pixels, "%12.2h" for coordinates in hours,
+"%11.1h" for coordinates in degrees,
+and "%13.7g" for coordinates in radians.
+.le
+.ls min_sigdigits = 7
+The minimum precision of the output coordinates.
+.le
+
+.ih
+DESCRIPTION
+
+CCTRAN applies the plate solution to a list of pixel or celestial
+coordinates in the text file \fIinput\fR and writes the transformed
+coordinates to the text file \fIoutput\fR. The input coordinates
+are read from and the output coordinates written to, the columns
+\fIxcolumn\fR and \fIycolumn\fR in the input and output
+files. The format of the output coordinates can be specified using the
+\fIlngformat\fR and \fIlatformat\fR parameters. If the output formats
+are unspecified the coordinates are written out with reasonable
+default precisions, e.g. "%10.3f" for pixel coordinates, "%12.2h" and "11.1h"
+for coordinates in hours or degrees,
+and "%13.7g" for coordinates in radians. All the remaining fields in the
+input file are copied to the output file without modification. Blank lines
+and comment lines are also passed to the output file unaltered.
+
+The plate solution is either read from record \fIsolutions\fR
+in the database file \fIdatabase\fR written by CCMAP, or specified
+by the user via the \fIxref\fR, \fIyref\fR, \fIxmag\fR, \fIymag\fR,
+\fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+and \fIprojection\fR parameters. If \fILngunits\fR and \fIlatunits\fR
+are undefined they default to the values in the database or to
+the quantities "hours" and "degrees" respectively.
+If the \fIforward\fR
+parameter is "yes", the input coordinates are assumed to be pixel coordinates
+and are transformed to celestial coordinates. If \fIforward\fR is "no", then
+the input coordinates are assumed to be celestial coordinates and are
+transformed to pixel coordinates.
+
+The transformation computed by CCMAP has the following form where x and y
+are the pixel coordinates and xi and eta are the corresponding standard
+coordinates in arcseconds per pixel. The standard coordinates are computed
+by applying the appropriate sky projection to the celestial coordinates.
+
+
+.nf
+ xi = f (x, y)
+ eta = g (x, y)
+.fi
+
+The functions f and g are either power series, Legendre, or Chebyshev
+polynomials whose order and region of validity were set by the user when
+CCMAP was run. The plate solution is arbitrary and does not correspond to
+any physically meaningful model. However the first order terms can be given
+the simple geometrical interpretation shown below.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = ymag * sin (yrotation)
+ e = -xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * xref - c * yref = xshift
+ d = eta0 - e * xref - f * yref = yshift
+ xi0 = 0.0
+ eta0 = 0.0
+.fi
+
+xref, yref, xi0, and eta0 are the origins of the reference and output
+coordinate systems respectively. xi0 and eta0 are both 0.0 by default.
+xmag and ymag are the x and y scales in " / pixel, and xrotation and yrotation
+are the x and y axes rotation angles measured counter-clockwise from original
+x and y axes.
+
+If the CCMAP database is undefined then CCTRAN computes a linear plate
+solution using the parameters \fIxref\fR, \fIyref\fR, \fIxmag\fR,
+\fIymag\fR, \fIxrotation\fR, \fIyrotation\fR, \fIlngref\fR, \fIlatref\fR,
+\fIlngunits\fR, \fIlatunits\fR and \fIprojection\fR as shown below. Note
+that in this case xrotation and yrotation are interpreted as the rotation
+of the coordinates not the rotation of the coordinate axes.
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+ b = xmag * cos (xrotation)
+ c = -ymag * sin (yrotation)
+ e = xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = xi0 - b * xref - c * yref = xshift
+ d = eta0 - e * xref - f * yref = yshift
+ xi0 = 0.0
+ eta0 = 0.0
+.fi
+
+Linear plate solutions are evaluated in the forward and reverse sense
+using the appropriate IRAF mwcs system routines. Higher order plate
+solutions are evaluated in the forward sense using straight-forward
+evaluation of the polynomial terms, in the reverse sense by applying
+Newton's method to the plate solution.
+
+
+.ih
+FORMATS
+
+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:
+
+.nf
+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
+.fi
+
+.ih
+EXAMPLES
+
+1. Compute the plate solution and evaluate the forward transformation for
+the following input coordinate list.
+
+.nf
+cl> type coords
+13:29:47.297 47:13:37.52 327.50 410.38
+13:29:37.406 47:09:09.18 465.50 62.10
+13:29:38.700 47:13:36.23 442.01 409.65
+13:29:55.424 47:10:05.15 224.35 131.20
+13:30:01.816 47:12:58.79 134.37 356.33
+
+
+cl> ccmap coords coords.db xcol=3 ycol=4 lngcol=1 latcol=2 inter-
+Coords File: coords Image:
+ Database: coords.db Record: coords
+Refsystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+Coordinate mapping status
+ Ra/Dec or Long/Lat fit rms: 0.229 0.241 (arcsec arcsec)
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:48.129 47:11:53.37 (hours degrees)
+ Reference point: 318.735 273.900 (pixels pixels)
+ X and Y scale: 0.764 0.767 (arcsec/pixel arcsec/pixel)
+ X and Y axis rotation: 179.110 358.958 (degrees degrees)
+
+
+cl> type coords.db
+# Mon 15:10:37 13-May-96
+begin coords
+ xrefmean 318.7460000000001
+ yrefmean 273.9320000000001
+ lngmean 13.49670238888889
+ latmean 47.19815944444444
+ coosystem j2000
+ projection tan
+ lngref 13.49670238888889
+ latref 47.19815944444444
+ lngunits hours
+ latunits degrees
+ xpixref 318.7352667484295
+ ypixref 273.9002619912411
+ geometry general
+ function polynomial
+ xishift 247.3577084680361
+ etashift -206.1795977453246
+ xmag 0.7641733802338992
+ ymag 0.7666917500560622
+ xrotation 179.1101291109185
+ yrotation 358.9582148846163
+ wcsxirms 0.2288984454992771
+ wcsetarms 0.2411034140453112
+ xirms 0.2288984454992771
+ etarms 0.2411034140453112
+ surface1 11
+ 3. 3.
+ 2. 2.
+ 2. 2.
+ 0. 0.
+ 134.3700000000001 134.3700000000001
+ 465.5000000000002 465.5000000000002
+ 62.1 62.1
+ 410.3800000000001 410.3800000000001
+ 247.3577084680361 -206.1795977453246
+ -0.7640812161068504 -0.011868034832272
+ -0.01393966623835092 0.7665650170136847
+ surface2 0
+
+
+
+cl> cctran coords STDOUT coords.db coords xcol=3 ycol=4 lngformat=%0.3h \
+latformat=%0.2h
+13:29:47.297 47:13:37.52 13:29:47.284 47:13:37.89
+13:29:37.406 47:09:09.18 13:29:37.425 47:09:09.24
+13:29:38.700 47:13:36.23 13:29:38.696 47:13:35.95
+13:29:55.424 47:10:05.15 13:29:55.396 47:10:05.09
+13:30:01.816 47:12:58.79 13:30:01.842 47:12:58.70
+
+cl> cctran coords STDOUT coords.db coords xcol=1 ycol=2 forward-
+327.341 409.894 327.50 410.38
+465.751 62.023 465.50 62.10
+441.951 410.017 442.01 409.65
+223.970 131.272 224.35 131.20
+134.717 356.454 134.37 356.33
+.fi
+
+Note that for the forward transformation the original ras and decs are in
+columns 1 and 2 and the computed ras and decs are in columns 3 and 4, but
+for the reverse transformation the original x and y values are in columns
+3 and 4 and the computed values are in columns 1 and 2.
+
+
+2. Use the previous plate solution to transform x and y values to
+ra and dec values and vice versa but enter the plate solution by hand.
+
+.nf
+cl> cctran coords STDOUT "" xcol=3 ycol=4 lngformat=%0.3h latformat=%0.2h \
+xref=318.735 yref=273.900 lngref=13:29:48.129 latref=47:11:53.37 \
+xmag=.764 ymag=.767 xrot=180.890 yrot=1.042
+13:29:47.297 47:13:37.52 13:29:47.285 47:13:37.93
+13:29:37.406 47:09:09.18 13:29:37.428 47:09:09.17
+13:29:38.700 47:13:36.23 13:29:38.698 47:13:35.99
+13:29:55.424 47:10:05.15 13:29:55.395 47:10:05.04
+13:30:01.816 47:12:58.79 13:30:01.839 47:12:58.72
+
+cl> cctran coords STDOUT "" xcol=1 ycol=2 xref=318.735 yref=273.900 \
+lngref=13:29:48.129 latref=47:11:53.37 xmag=.764 ymag=.767 \
+xrot=180.890 yrot=1.042 forward-
+327.347 409.845 327.50 410.38
+465.790 62.113 465.50 62.10
+441.983 409.968 442.01 409.65
+223.954 131.334 224.35 131.20
+134.680 356.426 134.37 356.33
+
+.fi
+
+Note that there are minor differences between examples 1 and 2 due to
+precision differences in the input, and that the angles input to cctran
+in example 2 are the coordinate rotation angles not the axes rotation angles
+as printed by ccmap. The different is exactly 180 degrees in both cases.
+
+.ih
+BUGS
+
+.ih
+SEE ALSO
+ccmap, ccsetwcs, finder.tastrom, skyctran
+.endhelp
diff --git a/pkg/images/imcoords/doc/ccxymatch.hlp b/pkg/images/imcoords/doc/ccxymatch.hlp
new file mode 100644
index 00000000..6987a437
--- /dev/null
+++ b/pkg/images/imcoords/doc/ccxymatch.hlp
@@ -0,0 +1,781 @@
+.help ccxymatch Oct96 images.imcoords
+.ih
+NAME
+ccxymatch -- Match celestial and pixel coordinate lists using various methods
+.ih
+USAGE
+ccxymatch input reference output tolerance [ptolerance]
+.ih
+PARAMETERS
+.ls input
+The list of input pixel coordinate files.
+.le
+.ls reference
+The list of input celestial coordinate files. The number of celestial coordinate
+files must be one or equal to the number of pixel coordinate files.
+.le
+.ls output
+The output matched coordinate files containing: 1) the celestial coordinates
+of the matched objects in columns 1 and 2, 2) the pixel coordinates of the
+matched objects in columns 3 and 4, and 3) the line numbers of the matched
+objects in the celestial coordinate and pixel lists in columns 5 and 6.
+.le
+.ls tolerance
+The matching tolerance in arcseconds.
+.le
+.ls ptolerance
+The matching tolerance in pixels. The ptolerance parameter is required
+by the "triangles" matching algorithm but not by the "tolerance" matching
+algorithm.
+.le
+.ls refpoints = ""
+A file of tie points used to compute the linear transformation
+from the pixel coordinate system to the celestial coordinate system. Refpoints
+is a text file containing the celestial coordinates of 1-3 tie points
+in the first line, followed by the pixel coordinates of the same 1-3 tie points
+in succeeding lines. The celestial coordinates are assumed to be
+in the units specified by \fIlngunits\fR and \fIlatunits\fR.
+If refpoints is undefined then the parameters \fIxin\fR, \fIyin\fR,
+\fIxmag\fR, \fIymag\fR, \fIxrotation\fR, \fIyrotation\fR, \fIprojection\fR,
+\fIlngref\fR, and \fIlatref\fR are used to compute the linear transformation.
+.le
+.ls xin = INDEF, yin = INDEF
+The x and y origin of the pixel coordinate system. Xin and yin default to
+0.0 and 0.0 respectively.
+.le
+.ls xmag = INDEF, ymag = INDEF
+The x and y scale factors in arcseconds per pixel. Xmag and
+ymag default to 1.0 and 1.0 respectively.
+.le
+.ls xrotation = INDEF, yrotation = INDEF
+The x and y rotation angles measured in degrees counter-clockwise. Xrotation
+and yrotation default to 0.0 and 0.0 degrees respectively. To set east to the
+up, down, left, and right directions, set xrotation to 90, 270, 180, and 0
+respectively. To set north to the up, down, left, and right directions, set
+yrotation to 0, 180, 90, and 270 degrees respectively. Any global rotation
+must be added to both the xrotation and yrotation values.
+.le
+.ls projection = "tan"
+The sky projection geometry. The most commonly used projections in
+astronomy are "tan", "arc", "sin", and "lin". Other supported projections
+are "ait", "car", "csc", "gls", "mer", "mol", "par", "pco", "qsc", "stg",
+"tsc", and "zea".
+.le
+.ls lngref = INDEF, latref = INDEF
+The origin of the celestial coordinate system. Lngref and latref define the
+reference point of the sky projection \fIprojection\fR, and default to the
+mean of the ra / longitude and dec / latitude coordinates respectively. Lngref
+and latref are assumed to be in units of \fIlngunits\fR and \fIlatunits\fR.
+.le
+.ls lngcolumn = 1, latcolumn = 2
+The columns in the celestial coordinate list containing the ra / longitude
+and dec / latitude coordinate values.
+.le
+.ls xcolumn = 1, ycolumn = 2
+The columns in the pixel coordinate list containing the x and y coordinate
+values.
+.le
+.ls lngunits = "hours", latunits = "degrees"
+The units of the celestial coordinates. The options are "hours", "degrees",
+and "radians" for lngunits, and "degrees" and "radians" for latunits.
+.le
+.ls separation = 3.0
+The minimum separation in arcseconds for objects in the celestial coordinate
+lists. Objects closer together than separation arcseconds
+are removed from the celestial coordinate lists prior to matching.
+.le
+.ls pseparation = 9.0
+The minimum separation in pixels for objects in the pixel coordinate
+lists. Objects closer together than pseparation pixels
+are removed from the pixel coordinate lists prior to matching.
+.le
+.ls matching = "triangles"
+The matching algorithm. The choices are:
+.ls tolerance
+A linear transformation is applied to the pixel coordinates,
+the appropriate projection is applied to the celestial coordinates,
+the transformed pixel and celestial coordinates are sorted,
+points which are too close together are removed, and the pixel coordinates
+which most closely match the celestial coordinates to within the
+user specified tolerance are determined. The tolerance algorithm requires
+an initial estimate for the linear transformation. This estimate can be
+derived by supplying the coordinates of tie points via the
+\fIrefpoints\fR file, or by setting the linear transformation parameters
+\fIxin\fR, \fIyin\fR, \fIxmag\fR, \fIymag\fR, \fIxrotation\fR,
+\fIyrotation\fR, \fIprojection\fR, \fIlngref\fR, and \fIlatref\fR. Assuming that
+a good initial estimate for the required linear transformation is supplied,
+the tolerance algorithm functions well in the presence of shifts, axis
+flips, x and y scale changes, rotations, and axis skew between the two
+coordinate systems. The algorithm is sensitive to higher order distortion terms
+in the coordinate transformation.
+.le
+.ls triangles
+A linear transformation is applied to the pixel coordinates,
+the appropriate projection is applied to the celestial coordinates,
+the transformed pixel and celestial coordinates are sorted, points
+which are too close together are removed, and the pixel coordinates
+are matched to the celestial coordinates using a triangle pattern
+matching algorithm and user specified tolerance parameters.
+The triangles pattern matching algorithm does not require prior knowledge
+of the linear transformation, although it will use a transformation if one
+is supplied. The algorithm functions well in the presence of
+shifts, axis flips, magnification, and rotation between the two coordinate
+systems, as long as both lists have a reasonable number of objects
+in common and the errors in the computed coordinates are small.
+However as the algorithm depends on comparisons of similar triangles, it
+is sensitive to differences in the x and y coordinate scales,
+skew between the x and y axes, and higher order distortion terms
+in the coordinate transformation.
+.le
+.le
+.ls nmatch = 30
+The maximum number of celestial and pixel coordinates used
+by the "triangles" pattern matching algorithm. If either list contains
+more coordinates than nmatch, the lists are subsampled. Nmatch should be
+kept small as the computation and memory requirements of the "triangles"
+algorithm depend on a high power of the lengths of the respective lists.
+.le
+.ls ratio = 10.0
+The maximum ratio of the longest to shortest side of the
+triangles generated by the "triangles" pattern matching algorithm.
+Triangles with computed longest to shortest side ratios > ratio
+are rejected from the pattern matching algorithm. Ratio should never
+be set higher than 10.0 but may be set as low as 5.0.
+.le
+.ls nreject = 10
+The maximum number of rejection iterations for the "triangles" pattern
+matching algorithm.
+.le
+.ls lngformat = "", latformat = ""
+The format of the output celestial coordinates. The default formats are
+"%13.3h", "%13.3h", and "%13.7g" for units of "hours", "degrees", and
+"radians" respectively.
+.le
+.ls xformat = "%13.3f", yformat = "%13.3f"
+The format of the output pixel coordinates.
+By default the coordinates are output right justified in a field of
+13 characters with 3 places following the decimal point.
+.le
+.ls verbose = yes
+Print messages about the progress of the task ?
+.le
+
+.ih
+DESCRIPTION
+
+CCXYMATCH matches ra / dec or longitude / latitude coordinates in the
+celestial coordinate list \fIreference\fR to their corresponding x and y
+coordinates in the pixel coordinate list \fIinput\fR using user specified
+tolerances in arcseconds \fItolerance\fR and pixels \fIptolerance\fR, and
+writes the matched coordinates to the output file \fIoutput\fR. The output
+file is suitable for input to the plate solution computation task CCMAP.
+
+CCXYMATCH matches the coordinate lists by: 1) projecting the celestial
+coordinates onto a plane using the sky projection geometry \fIprojection\fR
+and the reference point \fIlngref\fR and \fIlatref\fR,
+2) computing an initial guess for the linear transformation required to
+match the pixel coordinate system to the projected celestial coordinate system,
+3) applying the computed transformation to the pixel coordinates, 4) sorting
+the projected celestial and pixel coordinates lists, 5) removing points with a
+minimum separation specified by the parameters \fIseparation\fR and
+\fIpseparation\fR from both lists, 6) matching the two lists using either
+the "triangles" or "tolerance" matching algorithms, and 7) writing the matched
+list to the output file.
+
+An initial estimate for the linear transformation is computed in one of
+two ways. If \fIrefpoints\fR is defined, the celestial and pixel coordinates
+of up to three tie points are read from succeeding lines in the refpoints file,
+and used to compute the linear transformation. The coordinates of the tie
+points can be typed in by hand if \fIrefpoints\fR is "STDIN". The formats of
+two sample refpoints files are shown below.
+
+.nf
+# First sample refpoints file (1 reference file and N input files)
+
+ra1 dec1 [ra2 dec2 [ra3 dec3]] # tie points for reference coordinate file
+ x1 y1 [ x2 y2 [ x3 y3]] # tie points for input coordinate file 1
+ x1 y1 [ x2 y2 [ x3 y3]] # tie points for input coordinate file 2
+.. .. [ .. .. [ .. ..]
+ x1 y1 [ x2 y2 [ x3 y3]] # tie points for input coordinate file N
+
+
+# Second sample refpoints file (N reference files and N input files)
+
+ra1 dec1 [ra2 dec2 [ra3 dec3]] # tie points for reference coordinate file 1
+ x1 y1 [ x2 y2 [ x3 y3]] # tie points for input coordinate file 1
+ra1 dec1 [ra2 dec2 [ra3 dec3]] # tie points for reference coordinate file 2
+ x1 y1 [ x2 y2 [ x3 y3]] # tie points for input coordinate file 2
+ .. .. [ .. .. [ .. ..]]
+ra1 dec1 [ra2 dec2 [ra3 dec3]] # tie points for reference coordinate file N
+ x1 y1 [ x2 y2 [ x3 y3]] # tie points for input coordinate file N
+
+.fi
+
+If the refpoints file is undefined the parameters \fIxin\fR, \fIxin\fR,
+\fIxmag\fR, \fIymag\fR, \fIxrotation\fR, \fIxrotation\fR are used
+to compute a linear transformation from the pixel coordinates to the
+standard coordinates xi and eta as shown below. Orientation and skew
+are the orientation of the x and y axes and their deviation from
+perpendicularity respectively.
+
+
+.nf
+ xi = a + b * x + c * y
+ eta = d + e * x + f * y
+
+ xrotation = orientation - skew / 2
+ yrotation = orientation + skew / 2
+ b = xmag * cos (xrotation)
+ c = -ymag * sin (yrotation)
+ e = xmag * sin (xrotation)
+ f = ymag * cos (yrotation)
+ a = 0.0 - b * xin - c * yin = xshift
+ d = 0.0 - e * xin - f * yin = yshift
+.fi
+
+Both methods of computing the initial linear transformation compute the
+standard coordinates xi and eta by projecting the celestial coordinates
+onto a plane using the sky projection geometry \fIprojection\fR and the
+reference point \fIlngref\fR and \fIlatref\fR. The celestial coordinates
+are assumed to be in units of \fIlngunits\fR and \fIlatunits\fR and the
+standard coordinates are in arcseconds. The linear transformation and its
+geometric interpretation are shown below.
+
+The celestial and pixel coordinates are read from columns \fIlngcolumn\fR and
+\fIlatcolumn\fR in the celestial coordinate list, and \fIxcolumn\fR, and
+\fIycolumn\fR in the pixel coordinate list respectively. The pixel
+coordinates are transformed using the linear transformation described above,
+the celestial coordinate in units of \fIlngunits\fR and \fIlatunits\fR
+are projected to standard coordinates in arcseconds, and stars closer together
+than \fIseparation\fR arcseconds and \fIpseparation\fR pixels are removed
+from the celestial and pixel coordinate lists respectively.
+
+The coordinate lists are matched using the matching algorithm specified by
+\fImatching\fR. If matching is "tolerance", CCXYMATCH searches the transformed
+sorted pixel coordinate list for the coordinates that are within the matching
+tolerance \fItolerance\fR and closest to the current standard coordinates.
+The major advantage of the "tolerance" algorithm is that it can handle x and y
+scale differences and axis skew in the coordinate transformation. The major
+disadvantage of the "tolerance" algorithm is that the user must supply
+tie point information in all but the simplest case of small x and y
+shifts between the pixel and celestial coordinate systems.
+
+If matching is "triangles", CCXYMATCH constructs a list of triangles
+using up to \fInmatch\fR celestial coordinates and transformed pixel
+coordinates and performs a pattern matching operation on the resulting
+triangle lists. If the number of coordinates in both lists is less than
+\fInmatch\fR the entire list is matched using the "triangles" algorithm
+directly, otherwise the "triangles" algorithm is used to estimate a new
+linear transformation, the input coordinate list is transformed using
+the new transformation, and the entire list is matched using the "tolerance"
+algorithm. The major advantage of the "triangles" algorithm is that it
+requires no tie point information from the user. The major disadvantages of the
+algorithm are that, it is sensitive to x and y scale differences and axis
+skew between the celestial and pixel coordinate systems, and can be
+computationally expensive.
+
+The matched celestial and pixel coordinates are written to columns 1, 2, 3,
+and 4 of the output file, in the formats specified by the \fIlngformat\fR,
+\fIlatformat\fR, \fIxformat\fR and \fIyformat\fR parameters. The original
+line numbers in the celestial and pixels coordinate files are written to
+columns 5 and 6.
+
+If \fIverbose\fR is yes, detailed messages about actions taken by the
+task are written to the terminal as the task executes.
+
+.ih
+ALGORITHMS
+
+The "triangles" algorithm uses a sophisticated pattern matching
+technique which requires no tie point information from the user.
+It is expensive computationally and is therefore restricted to a maximum
+of \fInmatch\fR objects from the celestial and pixel coordinate lists.
+
+The "triangles" algorithm first generates a list
+of all the possible triangles that can be formed from the points in each list.
+For a list of nmatch points this number is the combinatorial factor
+nmatch! / [(nmatch-3)! * 3!] or nmatch * (nmatch-1) * (nmatch-2) / 6.
+The length of the perimeter, ratio of longest to shortest side, cosine
+of the angle between the longest and shortest side, the tolerances in
+the latter two quantities and the direction of the arrangement of the vertices
+of each triangle are computed and stored in a table.
+Triangles with vertices closer together than \fItolerance\fR and
+\fIptolerance\fR, or
+with a ratio of the longest to shortest side greater than \fIratio\fR
+are discarded. The remaining triangles are sorted in order of increasing
+ratio. A sort merge algorithm is used to match the triangles using the
+ratio and cosine information, the tolerances in these quantities, and
+the maximum tolerances for both lists. The ratios of the
+perimeters of the matched triangles are compared to the most common ratio
+for the entire list, and triangles which deviate too widely from this number
+are discarded. The number of triangles remaining are divided into
+the number which match in the clockwise sense and the number which match
+int the counter-clockwise sense. Those in the minority category
+are eliminated.
+The rejection step can be repeated up to \fInreject\fR times or until
+no more rejections occur, whichever comes first.
+The last step in the algorithm is a voting procedure in which each remaining
+matched triangle casts three votes, one for each matched pair of vertices.
+Points which have fewer than half the maximum number of
+votes are discarded. The final set of matches are written to the output file.
+
+The "triangles" algorithm functions well when the celestial and
+pixel coordinate lists have a sufficient number of objects (50%,
+in some cases as low as 25%) of their objects in common, any distortions
+including x and y scale differences and skew between the two systems are small,
+and the random errors in the coordinates are small. Increasing the value of
+the \fItolerance\fR parameter will increase the ability to deal with
+distortions but will also produce more false matches which after some point
+will swamp the true matches.
+
+.ih
+FORMATS
+
+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:
+
+.nf
+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
+.fi
+
+.ih
+REFERENCES
+
+A detailed description of the "triangles" pattern matching algorithm used here
+can be found in the article "A Pattern-Matching Algorithm for Two-
+Dimensional Coordinate Lists" by E.J. Groth, A.J. 91, 1244 (1986).
+
+.ih
+EXAMPLES
+
+1. Compute the plate solution for a 1528 by 2288 B band image of M51 by
+matching a list of reference stars extracted from the Guide Star Catalog
+with the regions task against a list of bright stars detected with the daofind
+task. The approximate image center is RA = 13:29:52.8 and DEC = +47:11:41
+(J2000) and the image scale is 0.43 arcseconds / pixel.
+
+.nf
+... Get the guide stars (see stsdas.analysis.gasp package).
+cl> regions 13:29:52.8 47:11:41 0.27 m51b.gsc.tab
+
+... Convert the binary table to a text file (see package tables.ttools).
+cl> tprint m51b.gsc.tab > m51b.gsc
+
+... Examine the guide star list.
+cl> type m51b.gsc
+
+# Table m51b.gsc.tab Tue 10:39:55 22-Oct-96
+
+# row RA_HRS RA_DEG DEC_DEG MAG
+# hours degrees degrees magnitudes
+
+ 1 13:29:13.33 202:18:19.9 47:14:16.3 12.3
+ 2 13:29:05.51 202:16:22.6 47:10:44.7 14.8
+ 3 13:29:48.60 202:27:09.0 47:07:42.5 15.0
+ 4 13:29:47.30 202:26:49.4 47:13:37.5 10.9
+ 5 13:29:31.65 202:22:54.7 47:18:54.7 15.0
+ 6 13:29:06.16 202:16:32.4 47:04:53.1 14.9
+ 7 13:29:37.40 202:24:21.1 47:09:09.2 15.1
+ 8 13:29:38.70 202:24:40.5 47:13:36.2 15.0
+ 9 13:29:55.42 202:28:51.3 47:10:05.2 15.4
+ 10 13:29:06.91 202:16:43.7 47:04:07.9 12.4
+ 11 13:29:29.73 202:22:25.9 47:12:04.1 15.1
+ 12 13:30:07.96 202:31:59.4 47:05:18.3 14.7
+ 13 13:30:01.82 202:30:27.2 47:12:58.8 11.8
+ 14 13:30:36.75 202:39:11.2 47:04:05.9 14.9
+ 15 13:30:34.04 202:38:30.6 47:16:44.8 13.2
+ 16 13:30:14.95 202:33:44.3 47:10:27.6 13.4
+
+... Locate bright stars in the image (see noao.digiphot.daophot package).
+... Suitable values for fwhmpsf, sigma, ... and threshold can be determined
+... using the imstatistics and imexamine tasks. Some experimentation may be
+... necessary to determine optimal values.
+cl> daofind m51b "default" fwhmpsf=4.0 sigma=5.0 threshold=20.0
+
+... Examine the star list.
+cl> type m51b.coo.1
+
+ ...
+#N XCENTER YCENTER MAG SHARPNESS SROUND GROUND ID
+ ...
+ 401.034 147.262 -2.315 0.473 -0.075 -0.170 1
+ 261.137 453.696 -1.180 0.481 -0.373 -0.135 2
+ 860.002 480.061 -1.397 0.373 -0.218 -0.178 3
+ 69.342 675.895 -0.955 0.368 -0.294 -0.133 4
+ 1127.791 680.033 -1.166 0.449 -0.515 -0.326 5
+ 972.435 691.544 -1.722 0.449 -0.327 -0.060 6
+ 1348.891 715.084 -1.069 0.389 -0.242 -0.145 7
+ 946.114 797.067 -0.543 0.406 -0.198 -0.069 8
+ 698.455 811.407 -1.620 0.437 -0.038 -0.028 9
+ 964.566 853.201 -0.317 0.382 0.031 -0.086 10
+ 236.088 864.817 -3.515 0.429 -0.164 -0.035 11
+ 919.703 909.835 -3.775 0.447 0.051 0.007 12
+ 406.592 985.807 -0.715 0.424 -0.307 -0.068 13
+ 920.790 986.083 -0.600 0.364 -0.047 0.021 14
+ 761.403 1037.795 -1.944 0.383 -0.023 0.120 15
+ 692.012 1050.603 -0.508 0.339 -0.365 -0.164 16
+ 1023.330 1060.144 -1.897 0.381 -0.246 -0.288 17
+ 681.864 1066.937 -0.059 0.467 -0.175 0.135 18
+ 1307.802 1085.564 -1.173 0.435 0.032 -0.207 19
+ 716.494 1094.800 -0.389 0.421 -0.412 -0.032 20
+ 715.935 1106.616 -3.747 0.649 0.271 0.245 21
+ 1093.813 1300.189 -1.557 0.377 -0.309 -0.078 22
+ 596.406 1353.798 -0.461 0.383 0.029 -0.103 23
+ 1212.117 1362.636 -0.362 0.369 -0.180 0.043 24
+ 251.355 1488.048 -0.909 0.357 -0.390 0.077 25
+ 600.659 1630.261 -1.392 0.423 0.013 -0.312 26
+ 329.448 2179.233 -0.824 0.442 -0.463 0.325 27
+
+... Match the two lists using the "triangles" algorithm and tolerances of
+... 1.0 arcseconds and 3.0 pixels respectively.
+cl> ccxymatch m51b.coo.1 m51b.gsc m51b.mat.1 1.0 3.0 lngcolumn=2 latcolumn=4
+
+... Examine the matched file.
+cl> type m51b.mat.1
+
+# Input: m51b.coo.1 Reference: m51b.gsc Number of tie points: 0
+# Initial linear transformation
+# xref[tie] = 0. + 1. * x[tie] + 0. * y[tie]
+# yref[tie] = 0. + 0. * x[tie] + 1. * y[tie]
+# dx: 0.00 dy: 0.00 xmag: 1.000 ymag: 1.000 xrot: 0.0 yrot: 0.0
+#
+# Column definitions
+# Column 1: Reference Ra / Longitude coordinate
+# Column 2: Reference Dec / Latitude coordinate
+# Column 3: Input X coordinate
+# Column 4: Input Y coordinate
+# Column 5: Reference line number
+# Column 6: Input line number
+
+ 13:29:48.600 47:07:42.50 860.002 480.061 8 44
+ 13:29:38.700 47:13:36.20 1093.813 1300.189 13 63
+ 13:29:55.420 47:10:05.20 698.455 811.407 14 50
+ 13:29:29.730 47:12:04.10 1307.802 1085.564 16 60
+ 13:30:07.960 47:05:18.30 401.034 147.262 17 42
+ 13:30:14.950 47:10:27.60 236.088 864.817 21 52
+
+... Compute the plate solution.
+cl> ccmap m51b.mat.1 ccmap.db results=STDOUT xcolumn=3 ycolumn=4 lngcolumn=1 \
+latcolumn=2 refpoint=user lngref=13:29:52.8 latref=47:11:41 interactive=no
+
+Coords File: m51b.mat.1 Image:
+ Database: ccmap.db Record: m51b.mat.1
+Refsystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.000 MJD: 51544.50000
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.000 MJD: 51544.50000
+Coordinate mapping status
+ XI fit ok. ETA fit ok.
+ Ra/Dec or Long/Lat fit rms: 0.206 0.103 (arcsec arcsec)
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:52.800 47:11:41.00 (hours degrees)
+ Reference point: 760.656 1033.450 (pixels pixels)
+ X and Y scale: 0.430 0.431 (arcsec/pixel arcsec/pixel)
+ X and Y axis rotation: 180.158 359.991 (degrees degrees)
+
+ Input Coordinate Listing
+ X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+
+ 860.0 480.1 13:29:48.60 47:07:42.5 13:29:48.62 47:07:42.5 -0.153 0.017
+1093.8 1300.2 13:29:38.70 47:13:36.2 13:29:38.73 47:13:36.4 -0.258 -0.164
+ 698.5 811.4 13:29:55.42 47:10:05.2 13:29:55.43 47:10:05.2 -0.062 0.024
+1307.8 1085.6 13:29:29.73 47:12:04.1 13:29:29.70 47:12:04.0 0.318 0.123
+ 401.0 147.3 13:30:07.96 47:05:18.3 13:30:07.96 47:05:18.4 0.028 -0.073
+ 236.1 864.8 13:30:14.95 47:10:27.6 13:30:14.94 47:10:27.5 0.127 0.073
+.fi
+
+
+
+2. Repeat example 1 but replace the daofind pixel list with one generated
+using the center task and a finder chart created with the skymap task.
+
+.nf
+... Get the guide stars. (see stsdas.analysis.gasp package)
+cl> regions 13:29:52.8 47:11:41 0.27 m51b.gsc.tab
+
+... Create the finder chart (see stsdas.analysis.gasp package)
+cl> gasp.skymap m51b.gsc.tab 13:29:52.8 47:11:41 INDEF 0.27 \
+objstyle=square racol=RA_HRS deccol=DEC_DEG magcol=MAG interactive- \
+dev=stdplot
+
+... Convert the binary table to a text file. (see tables.ttools package)
+cl> tprint m51b.gsc.tab > m51b.gsc
+
+... Mark and center the guide stars on the image display using the finder
+... chart produced by the skymap task and the center task (see the
+... digiphot.apphot package).
+cl> display m51b 1 fi+
+cl> center m51b cbox=7.0 ...
+cl> pdump m51b.ctr.1 xcenter,ycenter yes > m51b.pix
+
+... Display the pixel coordinate list.
+cl> type m51b.pix
+
+401.022 147.183
+236.044 864.882
+698.368 811.329
+860.003 480.051
+1127.754 680.020
+1307.819 1085.615
+1093.464 1289.595
+1212.001 1362.594
+1348.963 715.085
+
+... Match the two lists using the "triangles" algorithm and tolerances of
+... 1.0 arcseconds and 3.0 pixels respectively.
+cl> ccxymatch m51b.pix m51b.gsc m51b.mat.2 1.0 3.0 lngcolumn=2 latcolumn=4
+
+... Examine the matched file.
+cl> type m51b.mat.2
+
+# Input: m51b.pix Reference: m51b.gsc Number of tie points: 0
+# Initial linear transformation
+# xi[tie] = 0. + 1. * x[tie] + 0. * y[tie]
+# eta[tie] = 0. + 0. * x[tie] + 1. * y[tie]
+# dx: 0.00 dy: 0.00 xmag: 1.000 ymag: 1.000 xrot: 0.0 yrot: 0.0
+#
+# Column definitions
+# Column 1: Reference Ra / Longitude coordinate
+# Column 2: Reference Dec / Latitude coordinate
+# Column 3: Input X coordinate
+# Column 4: Input Y coordinate
+# Column 5: Reference line number
+# Column 6: Input line number
+
+ 13:29:48.600 47:07:42.50 860.003 480.051 8 4
+ 13:29:37.400 47:09:09.20 1127.754 680.020 12 5
+ 13:29:55.420 47:10:05.20 698.368 811.329 14 3
+ 13:29:29.730 47:12:04.10 1307.819 1085.615 16 6
+ 13:30:07.960 47:05:18.30 401.022 147.183 17 1
+ 13:30:14.950 47:10:27.60 236.044 864.882 21 2
+
+... Compute the plate solution.
+cl> ccmap m51b.mat.2 ccmap.db results=STDOUT xcolumn=3 ycolumn=4 lngcolumn=1 \
+latcolumn=2 refpoint=user lngref=13:29:52.8 latref=47:11:41 interactive=no
+
+Coords File: m51b.mat.2 Image:
+ Database: junk.db Record: m51b.mat.2
+Refsystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.000 MJD: 51544.50000
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.000 MJD: 51544.50000
+Coordinate mapping status
+ XI fit ok. ETA fit ok.
+ Ra/Dec or Long/Lat fit rms: 0.312 0.0664 (arcsec arcsec)
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:52.800 47:11:41.00 (hours degrees)
+ Reference point: 761.093 1033.230 (pixels pixels)
+ X and Y scale: 0.430 0.431 (arcsec/pixel arcsec/pixel)
+ X and Y axis rotation: 180.175 359.998 (degrees degrees)
+
+ Input Coordinate Listing
+ X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+.fi
+
+
+3. Repeat example 1 but use the "tolerance" matching algorithm and apriori
+knowledge of the celestial and pixel coordinates of the nucleus of M51,
+the x and y image scales, and the orientation of the detector on the telescope
+to match the two lists.
+
+.nf
+... Match the two lists using the ccxymatch "tolerance" algorithm and
+... a matching tolerance of 2.0 arcseconds. Note the negative and positive
+... signs on the xmag and ymag parameters and lack of any rotation,
+... indicating that north is up and east is to the left.
+cl> ccxymatch m51b.coo.1 m51b.gsc m51b.mat.3 2.0 lngcolumn=2 latcolumn=4 \
+matching=tolerance xin=761.40 yin=1037.80 xmag=-0.43 ymag=0.43 xrot=0.0 \
+yrot=0.0 lngref=13:29:52.80 latref=47:11:42.9
+
+... Examine the matched file.
+cl> type m51b.mat.3
+
+# Input: m51b.coo.1 Reference: m51b.gsc Number of tie points: 0
+# Initial linear transformation
+# xref[tie] = 327.402 + -0.43 * x[tie] + 0. * y[tie]
+# yref[tie] = -446.254 + 0. * x[tie] + 0.43 * y[tie]
+# dx: 327.40 dy: -446.25 xmag: 0.430 ymag: 0.430 xrot: 180.0 yrot: 0.0
+#
+# Column definitions
+# Column 1: Reference Ra / Longitude coordinate
+# Column 2: Reference Dec / Latitude coordinate
+# Column 3: Input X coordinate
+# Column 4: Input Y coordinate
+# Column 5: Reference line number
+# Column 6: Input line number
+
+ 13:30:07.960 47:05:18.30 401.034 147.262 17 42
+ 13:29:48.600 47:07:42.50 860.002 480.061 8 44
+ 13:29:37.400 47:09:09.20 1127.791 680.033 12 46
+ 13:29:55.420 47:10:05.20 698.455 811.407 14 50
+ 13:30:14.950 47:10:27.60 236.088 864.817 21 52
+ 13:29:29.730 47:12:04.10 1307.802 1085.564 16 60
+ 13:29:38.700 47:13:36.20 1093.813 1300.189 13 63
+
+
+... Compute the plate solution.
+cl> ccmap m51b.mat.3 ccmap.db results=STDOUT xcolumn=3 ycolumn=4 lngcolumn=1 \
+latcolumn=2 refpoint=user lngref=13:29:52.8 latref=47:11:41 interactive=no
+
+Coords File: m51b.mat.3 Image:
+ Database: ccmap.db Record: m51.mat.3
+Refsystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.000 MJD: 51544.50000
+Insystem: j2000 Coordinates: equatorial FK5
+ Equinox: J2000.000 Epoch: J2000.000 MJD: 51544.50000
+Coordinate mapping status
+ XI fit ok. ETA fit ok.
+ Ra/Dec or Long/Lat fit rms: 0.342 0.121 (arcsec arcsec)
+Coordinate mapping parameters
+ Sky projection geometry: tan
+ Reference point: 13:29:52.800 47:11:41.00 (hours degrees)
+ Reference point: 760.687 1033.441 (pixels pixels)
+ X and Y scale: 0.430 0.431 (arcsec/pixel arcsec/pixel)
+ X and Y axis rotation: 180.174 359.949 (degrees degrees)
+
+ Input Coordinate Listing
+ X Y Ra Dec Ra(fit) Dec(fit) Dra Ddec
+
+ 401.0 147.3 13:30:07.96 47:05:18.3 13:30:07.97 47:05:18.4 -0.109 -0.109
+ 860.0 480.1 13:29:48.60 47:07:42.5 13:29:48.64 47:07:42.5 -0.385 -0.045
+1127.8 680.0 13:29:37.40 47:09:09.2 13:29:37.34 47:09:09.0 0.572 0.152
+ 698.5 811.4 13:29:55.42 47:10:05.2 13:29:55.43 47:10:05.2 -0.118 0.009
+ 236.1 864.8 13:30:14.95 47:10:27.6 13:30:14.92 47:10:27.5 0.290 0.116
+1307.8 1085.6 13:29:29.73 47:12:04.1 13:29:29.72 47:12:04.0 0.082 0.060
+1093.8 1300.2 13:29:38.70 47:13:36.2 13:29:38.73 47:13:36.4 -0.332 -0.184
+.fi
+
+
+
+4. Repeat example 3 but input the appropriate linear transformation via a list
+of tie points, rather than setting the transformation parameters directly.
+
+.nf
+... Display the tie points.
+cl> type refpts
+13:29:55.42 47:10:05.2 13:29:38.70 47:13:36.2 13:30:14.95 47:10:27.6
+ 698.5 811.4 1093.8 1300.2 236.1 864.8
+
+... Match the lists using the ccxymatch "tolerance" algorithm and a matching
+... tolerance of 2.0 arcseconds. Note the negative and positive signs on the
+... xmag and ymag parameters and lack of any rotation, indicating that north
+... is up and east is to the left.
+cl> ccxymatch m51b.coo.1 m51b.gsc m51b.mat.4 2.0 refpoints=refpts \
+lngcolumn=2 latcolumn=4 matching=tolerance lngref=13:29:52.80 \
+latref=47:11:42.9
+
+... Examine the matched list.
+cl> type m51b.mat.4
+
+# Input: m51b.coo.1 Reference: m51b.gsc Number of tie points: 3
+# tie point: 1 ref: 26.718 -97.698 input: 698.500 811.400
+# tie point: 2 ref: -143.629 113.354 input: 1093.800 1300.200
+# tie point: 3 ref: 225.854 -75.167 input: 236.100 864.800
+#
+# Initial linear transformation
+# xi[tie] = 327.7137 + -0.4306799 * x[tie] + -2.0406E-4 * y[tie]
+# eta[tie] = -448.0854 + 0.00103896 * x[tie] + 0.430936 * y[tie]
+# dx: 327.71 dy: -448.09 xmag: 0.431 ymag: 0.431 xrot: 179.9 yrot: 0.0
+#
+# Column definitions
+# Column 1: Reference Ra / Longitude coordinate
+# Column 2: Reference Dec / Latitude coordinate
+# Column 3: Input X coordinate
+# Column 4: Input Y coordinate
+# Column 5: Reference line number
+# Column 6: Input line number
+
+
+ 13:30:07.960 47:05:18.30 401.034 147.262 17 42
+ 13:29:48.600 47:07:42.50 860.002 480.061 8 44
+ 13:29:37.400 47:09:09.20 1127.791 680.033 12 46
+ 13:29:55.420 47:10:05.20 698.455 811.407 14 50
+ 13:30:14.950 47:10:27.60 236.088 864.817 21 52
+ 13:29:29.730 47:12:04.10 1307.802 1085.564 16 60
+ 13:29:38.700 47:13:36.20 1093.813 1300.189 13 63
+
+
+... Compute the plate solution which is identical to the solution computed
+... in example 2.
+cl> ccmap m51b.mat.4 ccmap.db results=STDOUT xcolumn=3 ycolumn=4 lngcolumn=1 \
+latcolumn=2 refpoint=user lngref=13:29:52.8 latref=47:11:41 interactive=no
+.fi
+
+.ih
+TIME REQUIREMENTS
+.ih
+BUGS
+.ih
+SEE ALSO
+stsdas.gasp.regions,stsdas.gasp.skymap,tables.ttools.tprint,daophot.daofind,ccmap
+.endhelp
diff --git a/pkg/images/imcoords/doc/hpctran.hlp b/pkg/images/imcoords/doc/hpctran.hlp
new file mode 100644
index 00000000..16a550c3
--- /dev/null
+++ b/pkg/images/imcoords/doc/hpctran.hlp
@@ -0,0 +1,109 @@
+.help hpctran Jul09 imcoords
+.ih
+NAME
+hpctran -- Convert between HEALPix row and spherical coordinate
+.ih
+USAGE
+hpctran lng=xxx lat=xxx
+.br
+hpctran row=xxx
+.ih
+PARAMETERS
+.ls row
+HEALPix table row (1 indexed).
+This is used as input if the direction
+is "row2ang" or is used to store the value if the direction is
+"ang2row".
+.le
+.ls lng, lat
+Spherical coordinate consisting of a longitude and latitude.
+These are used as input if the direction
+is "ang2row" or is used to store the value if the direction is
+"row2ang". The units are interpreted as selected by the \fIcunits\fR
+parameter. The type of coordinates appropriate for a particular map
+is defined by the map provider.
+.le
+.ls nside = 512
+The number of pixels per face side.
+.le
+.ls cunits = "degrees" (degrees|hourdegree|radians)
+The units of the longitude and latitude. The "hourdegree" is for
+longitude in hours and latitude in degrees.
+.le
+.ls maptype = "nest" (nest|ring)
+The map pixelization type which may be "nest" or "ring".
+.le
+.ls direction = "ang2row" (ang2row|row2ang)
+The conversion direction. "ang2row" converts a spherical coordinate
+to a map row or pixel number. "row2ang" converts a map row or pixel
+number to a spherical coordinate.
+.le
+.ih
+DESCRIPTION
+HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelization
+of a sphere. See the reference section for a technical description of the
+pixelization and mathematics. As suggested in the name, this pixelization,
+or tiling, produces a subdivision of a spherical surface in which each
+"pixel" covers the same surface area as every other pixel. A HEALPix FITS
+"map" is a table where each row contains "pixel" data for a region on the
+sphere. It is a table because the pixels don't form a raster as in an
+image.
+
+The pixelization is defined by a resolution parameter which may be expressed
+in various ways. This task uses the number of pixels along a side of one of
+the 12 basic faces. The number of pixels/rows is 12 * nside * nside. The
+pixelization has two forms supported by this task. These are called
+"nested" and "ring".
+
+The HEALPix WCS task, \fBhpctran\fR, provides a translation between
+the table row number and a spherical coordinate. It is up to the
+creator of the table to choose the spherical coordinate system. This
+might be an equatorial, galactic, or super-galactic system. There may
+be a keyword specifying the system. This is the case with WMAP data.
+
+This task only provides the conversion. Access to the "pixel" data
+requires other tools. For binary tables the \fBtables\fR may be used.
+
+This task allows the spherical coordinates to be input and output in three
+forms, as hours and degrees (e.g. RA/DEC), as degrees (e.g. l/b), and as
+radians. On input one may use sexagesimal since IRAF automatically converts
+this to decimal. On output the values are produced in decimal form.
+
+The output is provide in two ways to provide flexibility in scripting. One
+is writing the results to the task parameters. Note that it is recommended
+that tasks which write to there parameter be "cached" with the \fBcache\fR
+command to avoid problems with background submission or multiple scripts
+running in parallel. The other output is printed to the standard output.
+Regardless of the direction of conversion the printed output is in the same
+order of row number, longitude, and latitude.
+
+.ih
+EXAMPLES
+A CMB WMAP file is obtained and one wants the temperature at a particular
+point on the sky. Note that the WMAP format is "nested" and
+coordinate system is galactic.
+
+.nf
+cl> hpctran lng=50.12 lat=-33.45
+2298092 50.12 -33.45000000000001
+cl> = hpctran.row
+2298092
+cl> tdump wmap_iqusmap_r9_5yr_K1_v3.fits col=TEMPERATURE row=2298092
+cl> tdump ("wmap_iqusmap_r9_5yr_K1_v3.fits", col="TEMPERATURE",
+>>> row=hpctran.row)
+.fi
+
+.ih
+REFERENCE
+\fIHEALPIX - a Framework for High Resolution Discretization, and Fast
+Analysis of Data Distributed on the Sphere\fR,
+by K.M. Gorski, Eric Hivon, A.J. Banday, B.D. Wandelt, F.K. Hansen, M.
+Reinecke, M. Bartelmann, 2005, ApJ 622, 759.
+.ih
+CREDIT
+Some code from the HEALPix distribution at http://healpix.jpl.nasa.gov
+was translated to SPP for use in this routine.
+.ih
+SEE ALSO
+ttools
+.endhelp
diff --git a/pkg/images/imcoords/doc/imcctran.hlp b/pkg/images/imcoords/doc/imcctran.hlp
new file mode 100644
index 00000000..760f3caf
--- /dev/null
+++ b/pkg/images/imcoords/doc/imcctran.hlp
@@ -0,0 +1,598 @@
+.help imcctran Oct00 images.imcoords
+.ih
+NAME
+imcctran -- convert between image celestial coordinate systems
+.ih
+USAGE
+imcctran image outsystem
+.ih
+PARAMETERS
+.ls image
+The list of images whose celestial coordinate systems are to be converted. The
+image celestial coordinate system must be one of the standard FITS celestial
+coordinate systems: equatorial (FK4, FK4-NO-E, FK5, ICRS, or GAPPT), ecliptic,
+galactic, or supergalactic.
+.le
+.ls outsystem
+The input and output celestial coordinate systems. The options are
+the following:
+.ls <imagename> [wcs]
+The celestial coordinate system is the world coordinate system of the image
+<imagename> and the input or output pixel coordinates may be in the
+"logical", "tv", "physical" or "world" coordinate systems. If wcs is not
+specified "logical" is assumed, unless the input coordinates are read from the
+image cursor, in which case "tv" is assumed. The image celestial coordinate
+system must be one of the valid FITS celestial coordinate systems:
+equatorial (FK4, FK4-NO-E, FK5, or GAPPT), ecliptic, galactic, or
+supergalactic.
+.le
+.ls equinox [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system if equinox is a
+Julian epoch, e.g. J2000.0 or 2000.0, or the equatorial mean place
+pre-IAU 1976 system (FK4) if equinox is a Besselian epoch, e.g. B1950.0
+or 1950.0. Julian equinoxes are prefixed by a J or j, Besselian equinoxes
+by a B or b. Equinoxes without the J / j or B / b prefix are treated as
+Besselian epochs if they are < 1984.0, Julian epochs if they are >= 1984.0.
+Epoch is the epoch of the observation and may be a Julian
+epoch, a Besselian epoch, or a Julian date. Julian epochs
+are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to the epoch type of
+equinox if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls icrs [equinox] [epoch]
+The International Celestial Reference System where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk5 [equinox] [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system where equinox is a
+Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0. Epoch
+is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls noefk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system but without the E-terms
+where equinox is a Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day. If undefined epoch defaults to equinox.
+.le
+.ls apparent epoch
+The equatorial geocentric apparent place post-IAU 1976 system where
+epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date.
+.le
+.ls ecliptic epoch
+The ecliptic coordinate system where epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch values < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day.
+.le
+.ls galactic [epoch]
+The IAU 1958 galactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+.ls supergalactic [epoch]
+The deVaucouleurs supergalactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+
+In all the above cases fields in [] are optional with the defaults as
+described. The epoch field for the fk5, icrs, galactic, and supergalactic
+coordinate systems is required only if the input coordinates are in the
+equatorial fk4, noefk4, fk5, or icrs systems and proper motions are defined.
+.le
+.ls nx = 10, ny = 10
+The dimensions of the coordinate grid used to compute the rotation angle and,
+optionally, the x and y magnification factors required to transform the input
+image celestial coordinate system to the output celestial coordinate system.
+.le
+.ls longpole = no
+If longpole = yes the zenithal projections ARC, SIN, STG, TAN, and ZEA
+will be transformed by updating the longpole and latpole parameters instead
+of rotating the CD matrix in the usual manner.
+.le
+.ls verbose = yes
+Print messages about actions taken by the task on the standard output ?
+.le
+.ls update = yes
+Update the image celestial coordinate system ?
+.le
+
+.ih
+DESCRIPTION
+
+IMCCTRAN converts the celestial coordinate system stored in the headers of the
+input images \fIimage\fR to the celestial coordinate system specified by
+\fIoutsystem\fR, and updates the input image header appropriately. The input
+and output celestial coordinate systems must be one of the following:
+equatorial, ecliptic, galactic, or supergalactic. The equatorial coordinate
+systems must be one of: 1) FK4, the mean place pre-IAU 1976 system, 2) FK4-NO-E,
+the same as FK4 but without the E-terms, 3) FK5, the mean place post-IAU 1976
+system, 4), ICRS, the International Celestial Reference System, 5) GAPPT,
+the geocentric apparent place in the post-IAU 1976 system.
+
+The input celestial coordinate system is read from the input image header.
+IMCCTRAN assumes that the celestial coordinate system is specified by the FITS
+keywords CTYPE, CRPIX, CRVAL, CD (or alternatively CDELT / CROTA), RADECSYS,
+EQUINOX (or EPOCH), MJD-WCS (or MJD-OBS, or DATE-OBS). USERS SHOULD TAKE NOTE
+THAT MJD-WCS IS CURRENTLY NEITHER A STANDARD OR A PROPOSED FITS STANDARD
+KEYWORD. HOWEVER IT OR SOMETHING SIMILAR, IS REQUIRED TO SPECIFY THE EPOCH OF
+THE COORDINATE SYSTEM WHICH MAY BE DIFFERENT FROM THE EPOCH OF THE OBSERVATION.
+
+The first four characters of the values of the ra / longitude and dec / latitude
+axis CTYPE keywords specify the celestial coordinate system. The currently
+permitted values of CTYPE[1:4] are RA-- / DEC- for equatorial coordinate
+systems, ELON / ELAT for the ecliptic coordinate system, GLON / GLAT for the
+galactic coordinate system, and SLON / SLAT for the supergalactic coordinate
+system.
+
+The second four characters of the values of the ra / longitude and dec /
+latitude axis CTYPE keywords specify the sky projection geometry. IRAF
+currently supports the AIT, ARC, CAR, CSC, GLS, MER, PAR, PCO, QSC,
+SIN, STG, TAN, TSC, and ZEA geometries as well as two internal projection
+geometries TNX, and ZPX. Consequently the currently permitted values of
+CTYPE[5:8] are -AIT, -ARC, -CAR, -CSC, -GLS, -MER, -PAR, -PCO, -QSC,
+-SIN, -STG, -TAN, -TSC, -ZEA as well as -ZPX and -TNX.
+
+If the input image celestial coordinate system is equatorial, the value of the
+RADECSYS keyword specifies which fundamental equatorial system is to be
+considered. The permitted values of RADECSYS are FK4, FK4-NO-E, FK5, ICRS,
+and GAPPT. If the RADECSYS keyword is not present in the image header, the
+values of the EQUINOX / EPOCH keywords (in that order of precedence) are used
+to determine the fundamental equatorial coordinate system. EQUINOX or EPOCH
+contain the epoch of the mean place and equinox for the FK4, FK4-NO-E, FK5,
+and ICRS systems (e.g 1950.0 or 2000.0). The default equatorial system is
+FK4 if EQUINOX or EPOCH < 1984.0, FK5 if EQUINOX or EPOCH >= 1984.0, and FK5
+if RADECSYS, EQUINOX, and EPOCH are undefined. If RADECSYS is defined but
+EQUINOX and EPOCH are not, the equinox defaults to 1950.0 for the FK4 and
+FK4-NO-E systems, and 2000.0 for the FK5 and ICRS systems. The equinox value is
+interpreted as a Besselian epoch for the FK4 and FK4-NO-E systems, and as a
+Julian epoch for the FK5 and ICRS systems. Users are
+strongly urged to use the EQUINOX keyword in preference to the EPOCH keyword,
+if they must enter their own equinox values into the image header. The FK4 and
+FK4-NO-E systems are not inertial and therefore also require the epoch of the
+observation (the time when the mean place was correct), in addition to the
+equinox. The epoch is specified, in order of precedence, by the values of the
+keywords MJD-WCS or MJD-OBS (which contain the modified Julian date, JD -
+2400000.5, of the coordinate system), or the DATE-OBS keyword (which contains
+the date of the observation in the form DD/MM/YY, CCYY-MM-DD, or
+CCYY-MM-DDTHH:MM:SS.S). As the latter quantity may
+only be accurate to a day, the MJD-WCS or MJD-OBS specification is preferred.
+If all 3 keywords are absent the epoch defaults to the value of equinox.
+Equatorial coordinates in the GAPPT system require only the specification
+of the epoch of observation which is supplied via the MJD-WCS, MJD-OBS,
+or DATE-OBS keywords (in that order of precedence) as for the FK4 and
+FK4-NO-E system.
+
+If the input image celestial coordinate system is ecliptic the mean ecliptic
+and equinox of date are required. These are supplied via the MJD-WCS, MJD-OBS,
+or DATE-OBS keywords (in that order or precedence) as for the equatorial FK4,
+FK4-NO-E, and GAPPT systems.
+
+The output coordinate system is specified by the \fIoutsystem\fR parameter
+as described in the PARAMETERS section.
+
+If an error is encountered when decoding the input or output world coordinate
+systems, an error message is printed on the standard output (if \fIverbose\fR
+is "yes"), and the input image left unmodified.
+
+If the input projection is one of the zenithal projections TAN, SIN, STG,
+ARC, or ZEA, then the header coordinate transformation can be preformed by
+transforming the CRVAL parameters and rotating the CD matrix as described in
+detail below. Otherwise the CRVAL values are transformed, the CD matrix is
+left unmodified, and the LONGPOLE and LATPOLE parameters required to perform
+the rotation are computed. If \fIlongpole\fR is yes then the zenithal
+coordinate systems will also be transformed using LONGPOLE and LATPOLE. At
+present IRAF looks for longpole and latpole parameters in the appropriate
+WATN_* keywords. If these are undefined the appropriate default values for
+each projection are assumed and new values are written to the WATN_* keywords.
+
+The new image celestial coordinate system is computed as follows. First a
+grid of \fInx\fR by \fIny\fR pixel and celestial coordinates, evenly spaced
+over the input image, is generated using the input image celestial coordinate
+system. Next these input celestial coordinates are transformed to coordinates
+in the output celestial coordinate system. Next the input celestial coordinates
+of the reference point (stored in degrees in the input image CRVAL keywords)
+are transformed to coordinates in the output celestial coordinate system,
+and new x and y pixel coordinates are computed using the transformed reference
+point coordinates but the original input CD matrix. The differences
+between the predicted and initial x and y pixel coordinates are used to
+compute the x and y axis rotation angles and the x and y magnification factors
+required to transform the original CD matrix to the correct new CD matrix.
+The process is shown schematically below.
+
+.nf
+1. x,y(input grid) -> ra,dec(input grid)
+
+2. ra,dec(input grid) -> ra,dec(output grid)
+
+3. ra_ref,dec_ref(input) -> ra_ref,dec_ref(output)
+
+4. ra,dec(output grid) -> x,y(predicted grid)
+
+5. x,y(input grid) -> F -> x,y(predicted grid)
+
+6. cd matrix(input) -> F -> cd matrix(output)
+.fi
+
+F is the fitted function of the x and y axis rotation angles and the
+x and y scaling factors required to match the input x and y values to the
+predicted x and y values.
+
+For most celestial coordinate transformations the fitted x and y scale factors
+will be very close to 1.0 and the x and y rotation angles will be almost
+identical. However small deviations from unity scale factors and identical
+x and y axis rotation angles do occur when transforming coordinates systems
+with the skewed axes.
+
+The precision of the transformations is usually very high, on the order
+of 10E-10 to 10E-11 in most cases. However conversions to and from the FK4
+equatorial system are less precise as these transformations
+involve the addition and subtraction of the elliptical aberration
+or E-terms. In this case the x and y scale factors correct for the first
+order E-terms and do significantly improve the precision of the coordinate
+transformation. The quadratic terms, i.e. terms in xy, x**2, and y**2
+however are not corrected for, and their absence does diminish the precision
+of the transformation coordinate transformation. For most practical purposes
+this loss of precision is insignificant.
+
+After the fit is completed, the celestial coordinates of the reference point
+in dd:mm:ss.s in the old and new systems, the rotation angle in degrees, the x
+and y scaling factors, and an estimate of the rms error of the x and y
+coordinate transformation are printed on the standard output.
+
+If \fIupdate\fR is yes, then the image header parameters CRVAL, CD,
+CTYPE, RADECSYS, EQUINOX, EPOCH, and MJD-WCS are modified, deleted, or
+added as appropriate. The position of the reference pixel in the
+image (stored in the CRPIX keywords), and the sky projection geometry, e.g.
+TAN, SIN, ARC, ETC are unchanged.
+
+USERS NEED TO BE AWARE THAT THE IRAF IMAGE WORLD COORDINATE SYSTEM
+CURRENTLY (IRAF VERSIONS 2.10.4 PATCH 2 AND EARLIER) SUPPORTS ONLY THE
+EQUATORIAL SYSTEM (CTYPE (ra axis) = "RA--XXXX" CTYPE (dec axis) = "DEC-XXXX")
+WHERE XXXX IS THE PROJECTION TYPE, EVEN THOUGH THE IMCCTRAN TASK
+SUPPORTS GALACTIC, ECLIPTIC, AND SUPERGALACTIC COORDINATES. IMCCTRAN will
+update the image correctly for non-equatorial systems, but IRAF will
+not be able to read these transformed image coordinate systems correctly.
+
+USERS SHOULD ALSO REALIZE THAT IMAGE WORLD COORDINATE SYSTEM REPRESENTATION
+IN FITS IS STILL IN THE DRAFT STAGE. ALTHOUGH IMCCTRAN TRIES TO CONFORM TO
+THE CURRENT DRAFT PROPOSAL AS MUCH AS POSSIBLE, WHERE NO ADOPTED STANDARDS
+CURRENTLY EXIST, THE FINAL FITS STANDARD MAY DIFFER FROM THE ONE ADOPTED HERE.
+
+.ih
+REFERENCES
+
+Additional information on the IRAF 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".
+
+Details of the FITS header world coordinate system interface can
+be found in the draft paper "World Coordinate Systems Representations Within the
+FITS Format" by Hanisch and Wells, available from the iraf anonymous ftp
+archive and the draft paper which supersedes it "Representations of Celestial
+Coordinates in FITS" by Greisen and Calabretta available from the NRAO
+anonymous ftp archives.
+
+The spherical astronomy routines employed here are derived from the Starlink
+SLALIB library provided courtesy of Patrick Wallace. These routines
+are very well documented internally with extensive references provided
+where appropriate. Interested users are encouraged to examine the routines
+for this information. Type "help slalib" to get a listing of the SLALIB
+routines, "help slalib opt=sys" to get a concise summary of the library,
+and "help <routine>" to get a description of each routine's calling sequence,
+required input and output, etc. An overview of the library can be found in the
+paper "SLALIB - A Library of Subprograms", Starlink User Note 67.7
+by P.T. Wallace, available from the Starlink archives.
+
+.ih
+EXAMPLES
+
+[1]. Precess the equatorial FK5 J2000 celestial coordinate system of the
+input 512 by 512 pixel square input image to J1975.0.
+
+.nf
+cl> imcctran image j1975.0
+
+INPUT IMAGE: image
+Insystem: image logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J2000.000
+ Epoch: J1987.25667351 MJD: 46890.00000
+Outsystem: j1975 Coordinates: equatorial FK5
+ Equinox: J1975.000 Epoch: J1975.00000000 MJD: 42413.25000
+Crval1,2: 201:56:43.5, 47:27:16.0 -> 201:40:53.8, 47:35:01.2 dd:mm:ss.s
+ Scaling: Xmag: 1.000000 Ymag: 1.000000 Xrot: 359.923 Yrot: 359.923 degrees
+ Rms: X fit: 8.465123E-11 pixels Y fit: 5.204446E-11 pixels
+.fi
+
+Before the transformation the image coordinate system looked like the following.
+
+.nf
+ ...
+ EPOCH = 2000
+ DATE-OBS= '05/04/87'
+ CRPIX1 = 257.75
+ CRPIX2 = 258.93
+ CRVAL1 = 201.94541667302
+ CRVAL2 = 47.45444
+ CDELT1 = -2.1277777E-4
+ CDELT2 = 2.1277777E-4
+ CTYPE1 = 'RA---TAN'
+ CTYPE2 = 'DEC--TAN'
+ ...
+.fi
+
+After the transformation the header looks like the following.
+
+.nf
+ ...
+ DATE-OBS= '05/04/87'
+ CRPIX1 = 257.75
+ CRPIX2 = 258.93
+ CRVAL1 = 201.681616387759
+ CRVAL2 = 47.583668865029
+ CTYPE1 = 'RA---TAN'
+ CTYPE2 = 'DEC--TAN'
+ RADECSYS= 'FK5 '
+ EQUINOX = 1975.
+ MJD-WCS = 42413.25
+ WCSDIM = 2
+ CD1_1 = -2.1277757990523E-4
+ CD1_2 = 2.84421945372844E-7
+ CD2_1 = 2.84421945363011E-7
+ CD2_2 = 2.12777579905235E-4
+ LTM1_1 = 1.
+ LTM2_2 = 1.
+ WAT0_001= 'system=image'
+ WAT1_001= 'wtype=tan axtype=ra'
+ WAT2_001= 'wtype=tan axtype=dec'
+ ...
+.fi
+
+Note the rms of the x and y fits is on the order 10.0e-10 to 10.0e-11 which
+is the expected numerical precision of the transformation.
+
+
+[2]. Convert the input image used in example 1 to the BFK4 1950.0 system.
+
+.nf
+cl> imcctran image B1950.0
+
+INPUT IMAGE: image
+Insystem: image logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J2000.000
+ Epoch: J1987.25667351 MJD: 46890.00000
+Outsystem: B1950 Coordinates: equatorial FK4
+ Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
+Crval1,2: 201:56:43.5, 47:27:16.0 -> 201:25:02.3, 47:42:47.1 dd:mm:ss.s
+ Scaling: Xmag: 0.999999 Ymag: 0.999999 Xrot: 359.848 Yrot: 359.848 degrees
+ Rms: X fit: 1.302837E-7 pixels Y fit: 8.545616E-8 pixels
+
+.fi
+
+Note that precision of the transformation is still good but is significantly
+less that the precision of the previous example. This is due to the fact
+that the quadratic terms in the E-term computation are not included in the
+transformation.
+
+The transformed image header in this case looks like the following.
+
+.nf
+ ...
+ DATE-OBS= '05/04/87'
+ CRPIX1 = 257.75
+ CRPIX2 = 258.93
+ CRVAL1 = 201.417300629944
+ CRVAL2 = 47.7130749603847
+ CTYPE1 = 'RA---TAN'
+ CTYPE2 = 'DEC--TAN'
+ RADECSYS= 'FK4 '
+ EQUINOX = 1950.
+ MJD-WCS = 33281.92345905
+ WCSDIM = 2
+ CD1_1 = -2.1277680505752E-4
+ CD1_2 = 5.66226465943254E-7
+ CD2_1 = 5.66226470798410E-7
+ CD2_2 = 2.12776805056766E-4
+ LTM1_1 = 1.
+ LTM2_2 = 1.
+ WAT0_001= 'system=image'
+ WAT1_001= 'wtype=tan axtype=ra'
+ WAT2_001= 'wtype=tan axtype=dec'
+ ...
+.fi
+
+
+[3]. Transform the celestial coordinate system of the input image used in
+examples 1 and 2 to the galactic coordinate system.
+
+.nf
+cl> imcctran image galactic
+
+INPUT IMAGE: image
+Insystem: image logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J2000.000
+ Epoch: J1987.25667351 MJD: 46890.00000
+Outsystem: galactic Coordinates: galactic
+ MJD: 33281.92346 Epoch: J1949.99979044 B1950.00000000
+rval1,2: 201:56:43.5, 47:27:16.0 -> 106:01:19.4, 68:27:46.1 dd:mm:ss.s
+ Scaling: Xmag: 1.000000 Ymag: 1.000000 Xrot: 202.510 Yrot: 202.510 degrees
+ Rms: X fit: 9.087450E-11 pixels Y fit: 3.815443E-11 pixels
+.fi
+
+The transformed header looks like the following.
+
+.nf
+ ...
+ DATE-OBS= '05/04/87'
+ CRPIX1 = 257.75
+ CRPIX2 = 258.93
+ CRVAL1 = 106.022047915293
+ CRVAL2 = 68.4627934475432
+ CTYPE1 = 'GLON-TAN'
+ CTYPE2 = 'GLAT-TAN'
+ MJD-WCS = 33281.92345905
+ WCSDIM = 2
+ CD1_1 = 1.96567112095654E-4
+ CD1_2 = 8.14601120181094E-5
+ CD2_1 = 8.14601120174619E-5
+ CD2_2 = -1.9656711209802E-4
+ LTM1_1 = 1.
+ LTM2_2 = 1.
+ WAT0_001= 'system=image'
+ WAT1_001= 'wtype=tan axtype=glon'
+ WAT2_001= 'wtype=tan axtype=glat'
+ ...
+.fi
+
+Users should not that although imcctran can write a legal galactic coordinate
+system to the image header, it and other iraf tasks cannot currently
+read this coordinate system.
+
+[4]. Repeat the previous example but don't update the image header.
+
+.nf
+cl> imcctran image galactic update-
+
+INPUT IMAGE: image
+Insystem: image logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J2000.000
+ Epoch: J1987.25667351 MJD: 46890.00000
+Outsystem: galactic Coordinates: galactic
+ MJD: 33281.92346 Epoch: J1949.99979044 B1950.00000000
+
+Current wcs
+ Axis 1 2
+ Crval 201.9454 47.4544
+ Crpix 257.75 258.93
+ Cd 1 -2.128E-4 0.
+ Cd 2 0. 2.128E-4
+
+New wcs
+ Axis 1 2
+ Crval 106.0220 68.4628
+ Crpix 257.75 258.93
+ Cd 1 1.966E-4 8.146E-5
+ Cd 2 8.146E-5 -1.966E-4
+
+Crval1,2: 201:56:43.5, 47:27:16.0 -> 106:01:19.4, 68:27:46.1 dd:mm:ss.s
+ Scaling: Xmag: 1.000000 Ymag: 1.000000 Xrot: 202.510 Yrot: 202.510 degrees
+ Rms: X fit: 9.087450E-11 pixels Y fit: 3.815443E-11 pixels
+.fi
+
+[5]. Repeat example 1 and check the accuracy of the results by using the
+skyctran task on the original image and on the transformed image.
+
+.nf
+cl> type coords
+ 1.0 1.0
+512.0 1.0
+512.0 512.0
+ 1.0 512.0
+
+cl> skyctran coords STDOUT "image logical" J1975.0
+
+Insystem: image logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J2000.000
+ Epoch: J1987.25667351 MJD: 46890.00000
+Outsystem: j1975 Coordinates: equatorial FK5
+ Equinox: J1975.000 Epoch: J1975.00000000 MJD: 42413.25000
+
+Input file: coords Output file: STDOUT
+
+ 1.0 1.0 13:27:02.9797 47:31:43.269
+512.0 1.0 13:26:24.3330 47:31:43.793
+512.0 512.0 13:26:24.3448 47:38:15.219
+ 1.0 512.0 13:27:03.0718 47:38:14.693
+
+cl> imcctran image j1975.0
+
+cl> skyctran coords STDOUT "image logical" "image world"
+
+Insystem: image logical Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J1975.000
+ Epoch: J1975.00000000 MJD: 42413.25000
+Outsystem: image world Projection: TAN Ra/Dec axes: 1/2
+ Coordinates: equatorial FK5 Equinox: J1975.000
+ Epoch: J1975.00000000 MJD: 42413.25000
+
+Input file: coords Output file: STDOUT
+
+ 1.0 1.0 13:27:02.9797 47:31:43.269
+512.0 1.0 13:26:24.3330 47:31:43.793
+512.0 512.0 13:26:24.3448 47:38:15.219
+ 1.0 512.0 13:27:03.0718 47:38:14.693
+.fi
+
+.ih
+TIME REQUIREMENTS
+
+.ih
+BUGS
+
+At present IRAF requires that the LONGPOLE and or LATPOLE keywords be
+defined in the appropriate WAT_* keywords, e.g. WAT1_* and WAT2_* for
+a 2D image. If these are not present then default values are assumed.
+The new values are computed and added to the WAT1_* and WAT2_* keywords.
+
+At present the experimental TNX and ZPX projections cannot be transformed
+with precision. Users should use the SKYCTRAN task to transform individual
+coordinate pairs.
+
+.ih
+SEE ALSO
+setjd,precess,galactic,xray.xspatial.skypix,stsdas.toolbox.tools.tprecess
+.endhelp
diff --git a/pkg/images/imcoords/doc/mkcwcs.hlp b/pkg/images/imcoords/doc/mkcwcs.hlp
new file mode 100644
index 00000000..542e4ff9
--- /dev/null
+++ b/pkg/images/imcoords/doc/mkcwcs.hlp
@@ -0,0 +1,93 @@
+.help mkcwcs Jun05 images.imcoords
+.ih
+NAME
+mkcwcs -- make or update a simple celestial wcs
+.ih
+USAGE
+mkcwcs wcsname
+.ih
+PARAMETERS
+.ls wcsname
+Image to be created or modified. If a new (non-existent) image is specified
+then a data-less image (NDIM=0) is created.
+.le
+.ls wcsref = ""
+Image whose WCS is first inherited and then updated.
+.le
+
+.ls equinox = INDEF
+Equinox of the coordinates specified in decimal years. If INDEF then the
+current value is not modified.
+.le
+.ls ra = INDEF
+Right ascension in hours. This may be typed in standard sexagesimal
+notation though it will be converted to decimal hours in EPARAM and
+to decimal degrees in the WCS as required by the standard. If INDEF
+then the current value is not modified.
+.le
+.ls dec = INDEF
+Declination in degrees. This may be typed in standard sexagesimal
+notation though it will be converted to decimal degrees in EPARAM.
+If INDEF then the current value is not modified.
+.le
+.ls scale = INDEF, pa = 0., lefthanded = yes
+Celestial pixel scale in arc seconds per pixel, the position angle in
+degrees, and the handedness of the axes. These are all represented by
+the WCS rotation matrix. If the scale is INDEF the current
+rotation matrix is unchanged and the position angle is ignored. If the
+scale is not INDEF then orthogonal axes are defined with the same scale on
+both axes. The handedness of the axes are specified by the
+\fIlefthanded\fR parameter. The position angle is measured from north
+increasing with the image lines (up in a standard display) and rotated
+towards east. Note that if the axes are lefthanded the angle is
+counterclockwise and if not it is clockwise.
+.le
+.ls projection = "tan" (tan|sin|linear)
+WCS projection function which may be "tan", "sin", or "linear".
+.le
+.ls rapix = INDEF, decpix = INDEF
+The reference pixel for the right ascension (first image axis) and for
+the declination (second image axes). The reference pixel may be fractional
+and lie outside the size of the image as allowed by the standard.
+.le
+.ih
+DESCRIPTION
+MKCWCS creates or modifies a celestial (RA/DEC) WCS in an image header. If a
+new image is specified the WCS is created in a data-less image header. A
+data-less WCS may be used in various tasks as a template. If a reference
+WCS is specified it is copied in whole and then desired elements of the WCS
+are modified. If a new WCS is created without a reference the initial values
+are for the pixel coordinates.
+
+The elements of the WCS which may be set are the coordinate equinox,
+the right ascension and declination, the pixel scale, the axes orientation,
+and the reference pixel in the image which corresponds to the specified
+right ascension and declination. If values are specified they WCS elements
+are left unchanged.
+
+The WCS is simple and not completely general because it defines the first
+coordinate axis to be right ascension and the second to be declination and
+that the axes are orthogonal with a uniform pixel scale (apart from the
+projection function).
+.ih
+EXAMPLES
+1. Create a data-less header by specifying a new wcs name.
+
+.nf
+ cl> mkcwcs new ra=1:20:23.1 dec=-12:11:13 scale=0.25
+.fi
+
+The reference pixel will be (0,0). To apply it later to an actual
+image (say with WCSCOPY) would require assigning the reference pixel.
+Note the use of sexagesimal notation.
+
+2. Modify the WCS of an existing image by changing the reference value
+and pixel.
+
+.nf
+ cl> mkcwcs old ra=1:20:23.1 dec=-12:11:13 rapix=1234 decpix=345
+.fi
+.ih
+SEE ALSO
+wcsedit,wcscopy,mkcwwcs
+.endhelp
diff --git a/pkg/images/imcoords/doc/mkcwwcs.hlp b/pkg/images/imcoords/doc/mkcwwcs.hlp
new file mode 100644
index 00000000..7140aa8c
--- /dev/null
+++ b/pkg/images/imcoords/doc/mkcwwcs.hlp
@@ -0,0 +1,110 @@
+.help mkcwwcs Jun05 images.imcoords
+.ih
+NAME
+mkcwwcs -- make or update a simple celestial/wavelength wcs
+.ih
+USAGE
+mkcwwcs wcsname
+.ih
+PARAMETERS
+.ls wcsname
+Image to be created or modified. If a new (non-existent) image is specified
+then a data-less image (NDIM=0) is created.
+.le
+.ls wcsref = ""
+Image whose WCS is first inherited and then updated.
+.le
+
+.ls equinox = INDEF
+Equinox of the coordinates specified in decimal years. If INDEF then the
+current value is not modified.
+.le
+.ls ra = INDEF
+Right ascension in hours. This may be typed in standard sexagesimal
+notation though it will be converted to decimal hours in EPARAM and
+to decimal degrees in the WCS as required by the standard. If INDEF
+then the current value is not modified.
+.le
+.ls dec = INDEF
+Declination in degrees. This may be typed in standard sexagesimal
+notation though it will be converted to decimal degrees in EPARAM.
+If INDEF then the current value is not modified.
+.le
+.ls scale = INDEF, pa = 0., lefthanded = yes
+Celestial pixel scale in arc seconds per pixel, the position angle in
+degrees, and the handedness of the axes. These are all represented by
+the WCS rotation matrix. If the scale is INDEF the current
+rotation matrix is unchanged and the position angle is ignored. If the
+scale is not INDEF then orthogonal axes are defined with the same scale on
+both axes. The handedness of the axes are specified by the
+\fIlefthanded\fR parameter. The position angle is measured from north
+increasing with the image lines (up in a standard display) and rotated
+towards east. Note that if the axes are lefthanded the angle is
+counterclockwise and if not it is clockwise.
+.le
+.ls projection = "tan" (tan|sin|linear)
+WCS projection function for the celestial axes which may be
+"tan", "sin", or "linear".
+.le
+
+.ls wave = INDEF
+Reference wavelength in arbitrary units. If INDEF then the current
+value is not modified.
+.le
+.ls wscale = INDEF
+Wavelength scale in arbitrary units per pixel. If INDEF then the current
+value is not modified.
+.le
+
+.ls rapix = INDEF, decpix = INDEF, wpix = INDEF
+The reference pixel for the right ascension (first image axis), for
+the declination (second image axes), and for the wavelength
+(third axis). The reference pixel may be fractional
+and lie outside the size of the image as allowed by the standard.
+.le
+.ih
+DESCRIPTION
+MKCWWCS creates or modifies a celestial (RA/DEC) plus wavelength
+three-dimensional WCS in an image header. If a
+new image is specified the WCS is created in a data-less image header. A
+data-less WCS may be used in various tasks as a template. If a reference
+WCS is specified it is copied in whole and then desired elements of the WCS
+are modified. If a new WCS is created without a reference the initial values
+are for the pixel coordinates.
+
+The elements of the WCS which may be set are the coordinate equinox,
+the right ascension and declination, the pixel scale, the axes orientation,
+the reference wavelength, the wavelength scale (i.e. dispersion),
+and the reference pixel in the image which corresponds to the specified
+right ascension and declination. If values are specified the WCS elements
+are left unchanged.
+
+The WCS is simple and not completely general because it defines the first
+coordinate axis to be right ascension, the second to be declination, and
+the third to be wavelength. The axes are orthogonal and the celestial axes
+have a uniform pixel scale (apart from the effects of the projection
+function).
+.ih
+EXAMPLES
+1. Create a data-less header by specifying a new wcs name.
+
+.nf
+ cl> mkcwwcs new ra=1:20:23.1 dec=-12:11:13 wave=5500. \
+ >>> scale=0.25 wscale=1.23
+.fi
+
+The reference pixel will be (0,0,0). To apply it later to an actual
+image (say with WCSCOPY) would require assigning the reference pixel.
+Note the use of sexagesimal notation.
+
+2. Modify the WCS of an existing image by changing the reference value
+and pixel.
+
+.nf
+ cl> mkcwwcs old ra=1:20:23.1 dec=-12:11:13 wave=5500. \
+ >>> rapix=1234 decpix=345 wpix=1024
+.fi
+.ih
+SEE ALSO
+wcsedit,wcscopy,mkcwcs
+.endhelp
diff --git a/pkg/images/imcoords/doc/skyctran.hlp b/pkg/images/imcoords/doc/skyctran.hlp
new file mode 100644
index 00000000..d91dd983
--- /dev/null
+++ b/pkg/images/imcoords/doc/skyctran.hlp
@@ -0,0 +1,861 @@
+.help skyctran Jun99 images.imcoords
+.ih
+NAME
+skyctran -- convert astronomical coordinates from one system to another
+.ih
+USAGE
+skyctran input output insystem outsystem
+.ih
+PARAMETERS
+.ls input
+The source of the input coordinates. The options are:
+.ls <filename>
+The list of input coordinate files. Coordinates may be entered by hand by
+setting input to "STDIN". A STDIN coordinate list is terminated by typing
+q or <EOF> (usually <ctrl/d> or <ctrl/z>).
+.le
+.ls imcursor
+If the input file name is equal to the reserved keyword "imcursor" the input
+coordinates are read from the image cursor and the input coordinate system
+is the coordinate system of the image specified by the insystem parameter.
+The coordinate list is terminated by typing q or <EOF> (usually <ctrl/d> or
+<ctr/z>).
+.le
+.ls grid
+If the input file name is equal to the reserved
+keyword "grid", an \fInilng\fR by \fInilat\fR grid of equally spaced
+input coordinates
+is generating spanning the region defined by \fIilngmin\fR, \fIilngmax\fR,
+\fIilatmin\fR, \fIilatmax\fR.
+.le
+.le
+.ls output
+The list of output coordinate files. The number of output files must be
+equal to one or the number of input files. Results may be printed on the
+terminal by setting output to "STDOUT".
+.le
+.ls insystem, outsystem
+The input and output celestial coordinate systems. The options are
+the following:
+.ls <imagename> [wcs]
+The celestial coordinate system is the world coordinate system of the image
+<imagename> and the input or output pixel coordinates may be in the
+"logical", "tv", "physical" or "world" coordinate systems. If wcs is not
+specified "logical" is assumed, unless the input coordinates are read from the
+image cursor, in which case "tv" is assumed. The image celestial coordinate
+system must be one of the valid FITS celestial coordinate systems:
+equatorial (FK4, FK4-NO-E, FK5, ICRS, or GAPPT), ecliptic, galactic, or
+supergalactic.
+.le
+.ls icrs [equinox] [epoch]
+The International Celestial Reverence System where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls equinox [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system if equinox is a
+Julian epoch, e.g. J2000.0 or 2000.0, or the equatorial mean place
+pre-IAU 1976 system (FK4) if equinox is a Besselian epoch, e.g. B1950.0
+or 1950.0. Julian equinoxes are prefixed by a J or j, Besselian equinoxes
+by a B or b. Equinoxes without the J / j or B / b prefix are treated as
+Besselian epochs if they are < 1984.0, Julian epochs if they are >= 1984.0.
+Epoch is the epoch of the observation and may be a Julian
+epoch, a Besselian epoch, or a Julian date. Julian epochs
+are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to the epoch type of
+equinox if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk5 [equinox] [epoch]
+The equatorial mean place post-IAU 1976 (FK5) system where equinox is
+a Julian or Besselian epoch e.g. J2000.0 or B1980.0.
+Equinoxes without the J / j or B / b prefix are treated as Julian epochs.
+The default value of equinox is J2000.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls fk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system where equinox is a
+Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0. Epoch
+is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. If undefined epoch defaults to equinox.
+.le
+.ls noefk4 [equinox] [epoch]
+The equatorial mean place pre-IAU 1976 (FK4) system but without the E-terms
+where equinox is a Besselian or Julian epoch e.g. B1950.0 or J2000.0,
+and epoch is the Besselian epoch, the Julian epoch, or the Julian date of the
+observation.
+Equinoxes without the J / j or B / b prefix are treated
+as Besselian epochs. The default value of equinox is B1950.0.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day. If undefined epoch defaults to equinox.
+.le
+.ls apparent epoch
+The equatorial geocentric apparent place post-IAU 1976 system where
+epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date.
+.le
+.ls ecliptic epoch
+The ecliptic coordinate system where epoch is the epoch of observation.
+Epoch is a Besselian epoch, a Julian epoch, or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian epochs
+if the epoch values < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian day.
+.le
+.ls galactic [epoch]
+The IAU 1958 galactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+.ls supergalactic [epoch]
+The deVaucouleurs supergalactic coordinate system.
+Epoch is a Besselian epoch, a Julian epoch or a Julian date.
+Julian epochs are prefixed by a J or j, Besselian epochs by a B or b.
+Epochs without the J / j or B / b prefix default to Besselian
+epochs if the epoch value < 1984.0, Julian epochs
+if the epoch value <= 3000.0, otherwise epoch is interpreted as
+a Julian date. The default value of epoch is B1950.0.
+.le
+
+In all the above cases fields in [] are optional with the defaults as
+described. The epoch field for fk5, icrs, galactic, and supergalactic
+coordinate systems is required only if the input coordinates are in the
+equatorial fk4, noefk4, fk5, or icrs systems and proper motions are defined.
+.le
+.ls transform = no
+If transform = no the computed output coordinates are appended to the
+input line and the new extended line is written to the output file. If
+transform = yes the computed output coordinates replace
+the input coordinates in the input line and the edited line is written
+to the output file. Transform is always set to "no" if the input
+is from the unredirected standard input.
+.le
+.ls lngcolumn = 1, latcolumn = 2
+The columns in the input file containing the x/ra/longitude and
+y/dec/latitude coordinates. Lngcolumn and latcolumn are always 1 and
+2 if the input is from the unredirected standard input.
+.le
+.ls plngcolumn = INDEF, platcolumn = INDEF
+The columns in the input file containing the ra and dec proper motions
+in " / year. If plngcolumn and platcolumn are INDEF the proper motions
+are assumed to be undefined. Proper motions
+are used only if the input coordinate system is equatorial fk4, noefk4,
+fk5, or icrs. Plngcolumn and platcolumn are always 3 and 4 if the input is from
+the unredirected standard input.
+.le
+.ls pxcolumn = INDEF, rvcolumn = INDEF
+The columns in the input file containing the parallax and radial velocity in
+in " and km / sec respectively. If pxcolumn and rvcolumn are INDEF, the
+parallax and radial velocities are assumed to be 0.0 and 0.0.
+Parallaxes and radial velocities are only used if proper motions are
+defined. Pxcolumn and rvcolumn are always 5 and 6 if the input is from the
+unredirected standard input.
+.le
+.ls ilngmin = INDEF, ilngmax = INDEF, ilatmin = INDEF, ilatmax = INDEF
+The lower and upper limits of the coordinate grid if \fIinput\fR =
+"grid".
+Ilngmin and ilngmax default to 1.0, 1.0, 0.0, 0.0, 0.0 and, 2048.0, ncols, 24.0,
+360.0, and TWOPI for coordinates in units of INDEF, pixels, hours, degrees,
+and radians respectively. Ilatmin and ilatmax default to 1.0, 1.0,
+-90.0, -90.0, -HALFPI and, 2048.0, nlines, 90.0, 90.0, and HALFPI
+for units of INDEF, pixels, degrees, degrees, and radians respectively.
+.le
+.ls nilng = 10, nilat = 10
+The size of the computed coordinate grid if \fIinput\fR = "grid".
+.le
+.ls ilngunits = "", ilatunits = ""
+The units of the input ra/longitude and dec/latitude coordinates.
+The options are:
+.ls hours
+Read the sky coordinates in hours.
+.le
+.ls degrees
+Read the sky coordinates in degrees.
+.le
+.ls radians
+Read the sky coordinates in radians.
+.le
+
+If the input system is the <imagename> [logical/tv/physical]
+system, pixel units are assumed regardless of the values
+of ilngunits or ilatunits. The default ilngunits and
+ilatunits values are
+hours and degrees for the equatorial coordinate systems and degrees and
+degrees for the remaining sky coordinate systems.
+.le
+.ls ilngformat = "", ilatformat = ""
+The output format of the input x/ra/longitude and y/dec/latitude coordinates
+if \fIinput\fR = "grid".
+The options are discussed in the formats section of the help page below.
+If the input coordinate system is the <imagename> [logical/tv/physical]
+system, default formats of %10.3f and %10.3f are assumed regardless
+of the values of ilngunits and ilatunits. Otherwise default formats
+of %12.3h, %12.2h, and %13.7g are assumed for input units of "hours", "degrees",
+and "radians" respectively. For values of \fIinput\fR other than "grid"
+the output formats of the input coordinates are the same as the input
+formats.
+.le
+.ls olngunits = "", olatunits = ""
+The units of the output ra/longitude and dec/latitude coordinates.
+The options are:
+.ls hours
+Output the sky coordinates in hours.
+.le
+.ls degrees
+Output the sky coordinates in degrees.
+.le
+.ls radians
+Output the sky coordinates in radians.
+.le
+
+If the output system is the <imagename> [logical/tv/physical]
+system, pixel units are assumed regardless of the values
+of olngunits or olatunits. The default olngunits and
+olatunits values are
+hours and degrees for the equatorial coordinate systems and degrees and
+degrees for the remaining sky coordinate systems.
+.le
+.ls olngformat = "", olatformat = ""
+The format of the computed x/ra/longitude and y/dec/latitude coordinates.
+The options are discussed in the formats section of the help page below.
+If the output coordinate system is the <imagename> [logical/tv/physical]
+system, default formats of %10.3f and %10.3f are assumed regardless
+of the values of olngunits and olatunits. Otherwise default formats
+of %12.3h, %12.2h, and %13.7g are assumed for output units of "hours",
+"degrees", and "radians" respectively.
+.le
+.ls icommands = ""
+The default image display cursor.
+.le
+.ls verbose = yes
+Print messages about actions taken by the task on the standard output?
+.le
+
+.ih
+DESCRIPTION
+
+SKYCTRAN converts coordinates in the input files
+\fIinput\fR from the input celestial coordinate system \fIinsystem\fR
+to the output celestial coordinate system \fIoutsystem\fR and writes the
+converted coordinates to the output files \fIoutput\fR. The input
+files may be simple text files, the standard input "STDIN",
+the image display cursor "imcursor", or a user specified coordinate grid.
+The output files may be simple
+text files or the standard output "STDOUT". SKYCTRAN may be used
+to change the units of the input coordinates, e.g. from degrees and degrees
+to hours and degrees, to precess the coordinates, to convert from one
+celestial coordinate system to another, e.g. from equatorial to ecliptic
+coordinates and vice versa, and to locate common objects in
+images whose fundamental coordinate systems are the same but observed at
+different epochs, e.g. FK4 B1950.0 and FK4 B1975.0, or different, e.g.
+equatorial FK4 B1950.0 and galactic.
+
+The input data are read from columns \fIlngcolumn\fR, \fIlatcolumn\fR,
+\fIplngcolumn\fR, \fIplatcolumn\fR, \fIpxcolumn\fR, and \fIrvcolumn\fR
+in the input files and if \fItransform\fR = yes, the converted coordinates are
+written to the same columns in the output files. If \fItransform\fR = "no",
+the converted coordinates are appended to the input line creating two
+additional columns in the output file. If the input file is the
+unredirected standard input then transpose is always "no". Comment lines, blanks
+lines, and lines for which the input coordinates could not be successfully
+decoded are passed on to the output file without modification.
+
+The input and output celestial coordinate systems \fIinsystem\fR and
+\fIoutsystem\fR must be one of the following: equatorial, ecliptic, galactic, or
+supergalactic. The equatorial systems must be one of: 1) FK4, the mean
+place pre-IAU 1976 system, 2) FK4-NO-E, the same as FK4 but without the
+E-terms, 3) FK5, the mean place post-IAU 1976 system, 4) ICRS,
+the International Celestial Reference System, 5) GAPPT, the geocentric
+apparent place in the post-IAU 1976 system.
+
+If \fIinsystem\fR or \fIoutsystem\fR is an image name then the celestial
+coordinate system is read from the image header. SKYCTRAN assumes that
+the celestial coordinate system is represented in the image header by
+the FITS keywords CTYPE, CRPIX, CRVAL, CD (or alternatively CDELT / CROTA),
+RADECSYS, EQUINOX (or EPOCH), and MJD-WCS (or MJD_OBS or DATE-OBS). USERS
+SHOULD TAKE NOTE THAT MJD-WCS IS CURRENTLY NEITHER A STANDARD OR
+PROPOSED FUTS STANDARD KEYWORD. HOWEVER IT OR SOMETHING SIMILAR IS REQUIRED
+TO SPECIFY THE EPOCH OF THE COORDINATE SYSTEM WHICH MAY BE DIFFERENT
+FROM THE EPOCH OF THE OBSERVATION.
+
+The first four characters of the values of the ra/longitude and dec/latitude
+axis CTYPE keywords specify the celestial coordinate system.
+The permitted CTYPE values are RA--/DEC- for equatorial coordinate systems,
+ELON/ELAT for the ecliptic coordinate system, GLON/GLAT for the galactic
+coordinate system, and SLON/SLAT for the supergalactic coordinate system,
+
+If the image celestial coordinate system is equatorial, the value
+of the RADECSYS keyword specifies the fundamental equatorial system.
+The permitted values of RADECSYS are FK4, FK4-NO-E,
+FK5, ICRS, and GAPPT. If the RADECSYS keyword is not
+present in the image header, the values of the EQUINOX or EPOCH keywords
+in that order of precedence are used to determine the fundamental
+equatorial system. EQUINOX or EPOCH contain the
+epoch of the mean place and equinox for the FK4, FK4-NO-E, FK5, and ICRS
+systems, e.g 1950.0 or 2000.0. The default equatorial system is FK4 if
+EQUINOX or EPOCH < 1984.0, FK5 if EQUINOX or EPOCH >= 1984.0, and FK5 if
+RADECSYS, EQUINOX and EPOCH are undefined.
+If RADECSYS is defined but EQUINOX and EPOCH are not the equinox
+defaults to 1950.0 for the FK4 and FK4-NO-E systems and 2000.0 for the FK5
+and ICRS systems.
+The equinox value is interpreted as a Besselian epoch for the FK4 and
+FK4-NO-E systems and as a Julian epoch for the FK5 and ICRS systems. Users are
+strongly urged to use the EQUINOX keyword in preference to the EPOCH
+keyword if they must enter their own values of the equinox into
+the image header. The FK4 and
+FK4-NO-E systems are not inertial and therefore also require the epoch of the
+observation (the time when the mean place was correct) in addition to the
+equinox. The input coordinate system epoch of the observation is also required
+if the input coordinate system is FK4, FK4-NO-E, FK5, or ICRS and proper motions
+are supplied.
+The epoch is specified, in order of precedence, by the values of
+the keywords MJD-WCS or MJD-OBS containing the modified Julian date
+(JD - 2400000.5) of
+the coordinate system, or the DATE-OBS keyword containing
+the date of the observation in the form DD/MM/YY, CCYY-MM-DD, or
+CCYY-MM-DDTHH:MM:SS.S. As the latter quantity may
+only be accurate to a day, the MJD-WCS or MJD-OBS specifications are
+preferable. If both
+keywords are absent the epoch defaults to the value of equinox.
+Equatorial coordinates in the GAPPT system require
+only the specification of the epoch of observation which is supplied
+via the MJD-WCS, MJD-OBS or DATE-OBS keywords as for the FK4, FK4-NO-E, FK5,
+and ICRS systems.
+
+If the celestial coordinate system is ecliptic the mean ecliptic and equinox of
+date are required. They are supplied via the MJD-WCS, MJD-OBS or DATE-OBS
+keywords as for the equatorial FK4, FK4-NO-E, FK5, ICRS, and GAPPT systems.
+
+If, the output coordinate system is galactic or supergalactic, the input
+coordinate system is FK4, FK4-NO-E, FK5, or ICRS and proper motions are
+supplied with the input coordinates, then the output epoch of the
+observation is also required. This is supplied via the MJD-WCS, MJD-OBS or
+DATE-OBS keywords as for the equatorial FK4, FK4-NO-E, FK5, ICRS, GAPPT,
+and ecliptic systems.
+
+USERS NEED TO BE AWARE THAT THE IRAF IMAGE WORLD COORDINATE SYSTEM
+CURRENTLY (IRAF VERSIONS 2.10.4 PATCH 2 AND EARLIER) SUPPORTS ONLY THE
+EQUATORIAL SYSTEM (CTYPE (ra axis) = "RA--XXXX" CTYPE (dec axis) = "DEC-XXXX")
+WHERE XXXX IS THE PROJECTION TYPE, EVEN THOUGH THE SKYCTRAN TASK
+SUPPORTS GALACTIC, ECLIPTIC, AND SUPERGALACTIC COORDINATES.
+
+USERS SHOULD ALSO REALIZE THAT IMAGE WORLD COORDINATE SYSTEM REPRESENTATION
+IN FITS IS STILL IN THE DRAFT STAGE. ALTHOUGH SKYCTRAN TRIES TO CONFORM TO
+THE CURRENT DRAFT PROPOSAL WHERE NO ADOPTED STANDARDS CURRENTLY EXIST, THE
+FINAL FITS STANDARD MAY DIFFER FROM THE ONE ADOPTED HERE.
+
+The IRAF builtin world coordinate systems "logical", "tv", "physical", and
+world are also supported. This means for example that users can begin
+with cursor coordinates in image 1, use the image header of image 1
+to transform the pixel coordinates to the celestial coordinate system of
+image 1, convert the image 1 celestial coordinates to celestial coordinates
+in the image 2 celestial coordinate system, and finally transform the
+celestial coordinate system 2 coordinates to pixel coordinates in image 2,
+all in one step.
+
+The \fIlogical coordinate system\fR is the pixel coordinate system of the
+current image. This coordinate system is the one used by the image
+input/output routines to access the image on disk. In the
+logical coordinate system,
+the coordinates of the pixel centers must lie within the following
+range: 1.0 <= x[i] <= nx[i], where x[i] is the coordinate in dimension i,
+nx[i] is the size of the image in dimension i, and the current maximum
+number of image dimensions is 7. In the case of an image section,
+the nx[i] refer to the dimensions of the section, not the dimensions
+of the full image.
+
+The \fItv coordinate system\fR is the pixel coordinate system used by the
+display servers XIMTOOL, SAOIMAGE, and IMTOOL.
+For images which are not image sections
+the tv and logical coordinate systems are identical. For images which are
+image sections the tv and physical coordinate systems are identical if
+the image has not undergone any prior linear transformations such as
+axis flips, section copies, shifts, scale changes, rotations, etc.
+
+The \fIphysical coordinate system\fR is the coordinate system in which the
+pixel coordinates of an object are invariant to successive linear
+transformations
+of the image. In this coordinate system, the pixel coordinates of an object
+in an image remain the same, regardless of any section copies, shifts,
+rotations, etc on the image. For example, an object with the
+physical coordinates (x,y) in an image would still have physical
+coordinates (x, y) in an image which is a section of the original image.
+
+The \fIworld coordinate system\fR is the default coordinate system for the
+image. The default world coordinate system is the one named by the
+environment variable "defwcs" if defined in the user environment (initially
+it is undefined) and present in the image header; else it is the first
+world coordinate system
+defined for the image (the .imh and .hhh image format support only one wcs
+but the .qp format can support more); else it is the physical coordinate
+system.
+
+IF AN ERROR IS ENCOUNTERED WHEN DECODING THE INPUT OR OUTPUT WORLD COORDINATE
+SYSTEMS, THEN AN ERROR FLAG IS PRINTED IN THE OUTPUT FILE AND ON THE STANDARD
+OUTPUT IF \fIVERBOSE\fR IS YES, AND THE INPUT COORDINATES ARE COPIED TO THE
+OUTPUT COORDINATES WITHOUT CHANGE.
+
+\fIIlngunits\fR, \fIilatunits\fR, \fIolngunits\fR, and \fIolatunits\fR
+set the units of the input and output coordinate systems.
+If the input or output system is the <imagename> [logical/tv/physical]
+system pixel units are assumed regardless of the values
+of <i/o>lngunits or <i/o>latunits. The default <i/o>lngunits and
+<i/o>latunits values are
+hours and degrees for the equatorial celestial coordinate system and
+degrees and degrees for the remaining celestial coordinate systems.
+
+The formats of the computed x/ra/longitude and y/dec/longitude coordinates
+are specified with the \fIolngformat\fR and \fIolatformat\fR parameters.
+The options are discussed in the formats section of the help page below.
+If the output coordinate system is the <imagename> [logical/tv/physical],
+default formats of %10.3f and %10.3f are assumed regardless
+of the values of olngunits and olatunits. Otherwise default formats
+of %12.3h, %12.2h, and %g are assumed for output units of "hours", "degrees",
+and "radians" respectively.
+
+.ih
+USER COMMANDS
+
+If the input file is STDIN the user can type in the input data by hand and
+set the input and output coordinate systems, the input and output coordinate
+units, and the output coordinate format interactively. The available commands
+are listed below.
+
+.nf
+ INTERACTIVE KEYSTROKE COMMANDS
+
+The following commands must be followed by a carriage return.
+
+? Print help
+: Execute colon command
+data Measure object
+q Exit task
+
+
+ VALID DATA STRING
+
+x/ra/long y/dec/lat [pmra pmdec [parallax radial velocity]]
+
+... x/ra/long y/dec/lat must be in pixels or the input units
+... pmra and pmdec must be in " / year
+... parallax must be in "
+... radial velocity must be in km / sec
+
+ COLON COMMANDS
+
+The following commands must be followed by a carriage return.
+
+:show Show the input and output coordinate systems
+:isystem [string] Show / set the input coordinate system
+:osystem [string] Show / set the output coordinate system
+:iunits [string string] Show / set the input coordinate units
+:ounits [string string] Show / set the output coordinate units
+:oformat [string string] Show / set the output coordinate format
+
+ VALID INPUT AND OUTPUT COORDINATE SYSTEMS
+
+image [logical/tv/physical/world]
+equinox [epoch]
+noefk4 [equinox [epoch]]
+fk4 [equinox [epoch]]
+fk5 [equinox [epoch]]
+icrs [equinox [epoch]]
+apparent epoch
+ecliptic epoch
+galactic [epoch]
+supergalactic [epoch]
+
+ VALID INPUT AND OUTPUT CELESTIAL COORDINATE UNITS
+ AND THEIR DEFAULT FORMATS
+
+hours %12.3h
+degrees %12.2h
+radians %13.7h
+.fi
+
+.ih
+IMAGE CURSOR COMMANDS
+
+In interactive image cursor mode the user can set the input and output
+coordinate systems, the output coordinate units, and the output coordinate
+formats. The available commands are listed below.
+
+.nf
+ INTERACTIVE KEYSTROKE COMMANDS
+
+? Print help
+: Execute colon command
+spbar Measure object
+q Exit task
+
+
+ COLON COMMANDS
+
+:show Show the input and output coordinate systems
+:isystem [string] Show / set the input coordinate system
+:osystem [string] Show / set the output coordinate system
+:ounits [string string] Show / set the output coordinate units
+:oformat [string string] Show / set the output coordinate format
+
+ VALID INPUT COORDINATE SYSTEMS
+
+image [tv]
+
+ VALID OUTPUT COORDINATE SYSTEMS
+
+image [logical/tv/physical/world]
+equinox [epoch]
+noefk4 [equinox [epoch]]
+fk4 [equinox [epoch]]
+fk5 [equinox [epoch]]
+icrs [equinox [epoch]]
+apparent epoch
+ecliptic epoch
+galactic [epoch]
+supergalactic [epoch]
+
+ VALID OUTPUT COORDINATE UNITS AND THEIR DEFAULT FORMATS
+
+hours %12.3h
+degrees %12.2h
+radians %13.7g
+.fi
+
+
+.ih
+FORMATS
+
+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:
+
+.nf
+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
+.fi
+
+
+.ih
+REFERENCES
+
+Additional information on the IRAF 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".
+
+Details of the FITS header world coordinate system interface can
+be found in the draft paper "World Coordinate Systems Representations Within the
+FITS Format" by Hanisch and Wells, available from the iraf anonymous ftp
+archive and the draft paper which supersedes it "Representations of Celestial
+Coordinates in FITS" by Greisen and Calabretta available from the NRAO
+anonymous ftp archives.
+
+The spherical astronomy routines employed here are derived from the Starlink
+SLALIB library provided courtesy of Patrick Wallace. These routines
+are very well documented internally with extensive references provided
+where appropriate. Interested users are encouraged to examine the routines
+for this information. Type "help slalib" to get a listing of the SLALIB
+routines, "help slalib opt=sys" to get a concise summary of the library,
+and "help <routine>" to get a description of each routine's calling sequence,
+required input and output, etc. An overview of the library can be found in the
+paper "SLALIB - A Library of Subprograms", Starlink User Note 67.7
+by P.T. Wallace, available from the Starlink archives.
+
+.ih
+EXAMPLES
+
+1. Precess the fk4 coordinates typed in by the user to the fk5 system with
+and without the proper motion values.
+
+.nf
+ cl> skyctran STDIN STDOUT fk4 fk5
+
+ # Insystem: fk4 Coordinates: equatorial FK4
+ # Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
+ # Outsystem: fk5 Coordinates: equatorial FK5
+ # Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000
+
+ # Input file: STDIN Output file: STDOUT
+
+ ... not including proper motion
+ 13:28:43.2 27:18:01.1
+ 13:28:43.2 27:18:01.1 13:31:03.855 27:02:35.13
+
+ ... including proper motion
+ 13:28:43.2 27:18:01.1 .36 -0.16
+ 13:28:43.2 27:18:01.1 .36 -0.16 13:31:05.215 27:02:27.37
+
+ ... change the output coordinate system to fk5 1975.0 and repeat
+ :os fk5 1975.0
+ :os
+
+ # Outsystem: fk5 1975.0 Coordinates: equatorial FK5
+ # Equinox: J1975.000 Epoch: J1975.00000000 MJD: 42413.25000
+
+ 13:28:43.2 27:18:01.1
+ 13:28:43.2 27:18:01.1 13:29:53.564 27:10:17.69
+
+ 13:28:43.2 27:18:01.1 .36 -0.16
+ 13:28:43.2 27:18:01.1 .36 -0.16 13:29:54.244 27:10:13.80
+
+ ... type EOF to quit
+ <EOF>
+.fi
+
+2. Precess a list of RAS in hours and DECS in degrees in the FK5 system
+equinox 1980.0 to equinox 2000.0 and write both the input coordinates and
+the output coordinates in hours and degrees to the output file.
+
+.nf
+ cl> skyctran inlist outlist j1980.0 j2000.0
+
+ ... or equivalently ...
+
+ cl> skyctran inlist outlist j1980.0 2000.0
+
+ ... or equivalently ...
+
+ cl> skyctran inlist outlist "fk5 1980.0" fk5
+.fi
+
+Note that if the coordinate system, e.g. fk5, is not specified explicitly
+then equinoxes < 1984 must be prefixed by J, or a Besselian rather than
+a Julian epoch will be assumed.
+
+3. Repeat the previous example but replace the input coordinates with
+the precessed coordinates in the output file.
+
+.nf
+ cl> skyctran inlist outlist j1980.0 j2000.0 transform+
+.fi
+
+4. Precess a list of RAS in hours and DECS in degrees in the FK4 system
+equinox 1950.0 to equinox 1975.0 and write both the input coordinates and
+the output coordinates in hours and degrees to the output file. The input
+and output epochs of observation default to the respective equinox
+values.
+
+.nf
+ cl> skyctran inlist outlist 1950.0 1975.0
+
+ ... or equivalently ...
+
+ cl> skyctran inlist outlist b1950.0 b1975.0
+
+ ... or equivalently ...
+
+ cl> skyctran inlist outlist fk4 b1975.0
+
+ ... or equivalently ...
+
+ cl> skyctran inlist outlist fk4 "fk4 1975.0"
+.fi
+
+5. Convert a list of RAS in hours and DECS in degrees in the FK4 system
+equinox 1950.0 to RAS in hours and DECS in degrees in the FK5 system
+equinox 2000.0, and replace the input coordinates with the
+output coordinates in the output file. The Besselian epoch of the
+observation is 1987.25.
+
+.nf
+ cl> skyctran inlist outlist "b1950.0 1987.25" j2000.0 \
+ transform+
+.fi
+
+6. Convert a list of RAS in hours and DECS in degrees to RAS in degrees
+and DECS in degrees, and replace the input coordinates with the output
+coordinates in the output file. As the input and output coordinate systems
+and equinoxes are the same no precession is performed.
+
+.nf
+ cl> skyctran inlist outlist 2000.0 2000.0 olngunits=degrees \
+ transform+
+.fi
+
+7. Convert a list of RAS in hours and DECS in degrees in the FK4
+system, equinox 1950.0, epoch of observation 1987.24, to galactic
+coordinates, and write both the input and output coordinate to the
+output file.
+
+.nf
+ cl> skyctran inlist outlist "b1950.0 1987.25" galactic
+.fi
+
+8. Convert a list of RAS in hours and DECS in degrees in the FK5
+system, equinox 2000.0, to ecliptic coordinates on Julian date
+2449879.5, replacing the input coordinates with the converted
+coordinates in the output file.
+
+.nf
+ cl> skyctran inlist outlist j2000 "ecliptic 2449879.5" \
+ transform+
+.fi
+
+9. Display an image and use the cursor and image header coordinate
+system, equatorial FK4, equinox 1950.0, epoch 1987.25 to print the pixel
+and galactic coordinates of the marked objects on the image display.
+Note that the test image dev$wpix has an incorrect value of EPOCH (0.0) that
+would have confused skyctran and need to be changed.
+
+.nf
+ cl> imcopy dev$wpix wpix
+ cl> hedit wpix epoch 1950.0
+ cl> display wpix 1 fi+
+ cl> skyctran imcursor STDOUT wpix galactic
+.fi
+
+10. Convert a list of RAS in hours and DECS in degrees measured in the
+image created in example 9 to the FK5 equinox 2000.0 coordinate system.
+
+.nf
+ cl> skyctran inlist outlist "wpix world" j2000.0
+
+ ... or equivalently ...
+
+ cl> skyctran inlist outlist "b1950.0 1987.25" j2000.0
+.fi
+
+11. Using an image whose header coordinate system is equatorial FK5
+equinox 2000.0 and a different image of the same region whose coordinate
+system is galactic use the image display and cursor to create a list of
+tie points in logical pixel coordinates that can be used as input to the
+registration tasks geomap and geotran. Note that this example and examples
+12 and 13 below will not work on iraf system earlier than 2.11 because galactic
+image header coordinates are not fully supported. They will work
+however on two images which have equatorial coordinates systems
+which are precessed with respect to each other.
+
+
+.nf
+ cl> display image1
+
+ ... this is the reference image
+
+ cl> skyctran imcursor outlist image1 "image2 logical"
+
+ ... mark many widely scattered points on the displayed
+ image image1 terminating the input list with
+ <EOF> which is usually <ctrl/z> or <ctrl/d>
+.fi
+
+12. Repeat example 11 but use a previously prepared list of image1
+logical pixel coordinates as input to the task.
+
+.nf
+ cl> skyctran inlist outlist "image1 logical"\
+ "image2 logical"
+.fi
+
+13. Repeat example 11 but have skyctran automatically generate a grid
+of 100 tie points.
+
+.nf
+ cl> skyctran grid outlist "image1 logical"\
+ "image2 logical"
+.fi
+
+.ih
+TIME REQUIREMENTS
+.ih
+BUGS
+.ih
+SEE ALSO
+setjd,precess,galactic,xray.xspatial.skypix,stsdas.toolbox.tools.tprecess
+.endhelp
diff --git a/pkg/images/imcoords/doc/starfind.hlp b/pkg/images/imcoords/doc/starfind.hlp
new file mode 100644
index 00000000..9817735e
--- /dev/null
+++ b/pkg/images/imcoords/doc/starfind.hlp
@@ -0,0 +1,304 @@
+.help starfind May97 images.imcoords
+.ih
+NAME
+starfind -- automatically detect stellar objects in a list of images
+.ih
+USAGE
+starfind image output hwhmpsf threshold
+.ih
+PARAMETERS
+.ls image
+The list of input images. The input images must be two-dimensional.
+.le
+.ls output
+The list of output object files. The number of output files must equal the
+number of input images. If output is "default", or "dir$default", or a
+directory specification then a default name of the form
+dir$root.extension.version is constructed, where dir$ is the directory name,
+root is the root image name, extension is "obj", and version is the next
+available version number.
+.le
+.ls hwhmpsf
+The half-width half-maximum of the image PSF in pixels.
+.le
+.ls threshold
+The detection threshold above local background in ADU.
+.le
+.ls datamin = INDEF, datamax = INDEF
+The minimum and maximum good data values in ADU. Datamin and datamax
+default to the constants -MAX_REAL and MAX_REAL respectively.
+.le
+.ls fradius = 2.5 (hwhmpsf)
+The fitting radius in units of hwhmpsf. Fradius defines the size
+of the Gaussian kernel used to compute the density enhancement image, and
+the size of the image region used to do the moment analysis.
+.le
+.ls sepmin = 5.0 (hwhmpsf)
+The minimum separation for detected objects in units of hwhmpsf.
+.le
+.ls npixmin = 5
+The minimum area of the detected objects in pixels.
+.le
+.ls maglo = INDEF, maghi = INDEF
+The minimum and maximum magnitudes of the detected objects. Maglo and maghi
+default to the constants -MAX_REAL and MAX_REAL respectively.
+.le
+.ls roundlo = 0.0, roundhi = 0.2
+The minimum and maximum ellipticity values of the detected objects, where
+ellipticity is defined as 1 - b / a, and a and b are the semi-major and
+semi-minor axis lengths respectively.
+.le
+.ls sharplo = 0.5, sharphi = 2.0
+The minimum and maximum sharpness values of the detected objects, where
+sharpness is defined to be the ratio of the object size to the
+hwhmpsf parameter value.
+.le
+.ls wcs = ""
+The world coordinate system. The options are:
+.ls " "
+The world coordinate system is undefined. Only logical (pixel) coordinates
+are printed.
+.le
+.ls logical
+The world coordinate system is the same as the logical (pixel) coordinate
+system, but two sets of identical logical (pixel) coordinates are printed.
+.le
+.ls physical
+The world coordinate system is the same as the logical (pixel) coordinate
+system of the parent image if any.
+.le
+.ls world
+The world coordinate system of the image if any.
+.le
+.le
+.ls wxformat = "", wyformat = ""
+The output format for the x and y axis world coordinates. If wxformat and
+wyformat are undefined then: 1) the value of the wcs format attribute is
+used if the output wcs is "world" and the attribute is defined, 2) "%9.3f"
+is used if the output wcs is "logical" or "physical", and "%11.8g" is used
+if the output wcs is "world". If the input image is a sky projection image and
+the x and y axes are ra and dec respectively, then the formats "%12.2H" and
+"%12.1h" will print the world coordinates in hours and degrees respectively.
+.le
+.ls boundary = "nearest"
+The boundary extension type. The choices are:
+.ls nearest
+Use the value of the nearest boundary pixel.
+.le
+.ls constant
+Use a constant value.
+.le
+.ls reflect
+Generate a value by reflecting around the boundary.
+.le
+.ls wrap
+Generate a value by wrapping around to the other side of the image.
+.le
+.le
+.ls constant = 0.0
+The constant for constant boundary extension.
+.le
+.ls nxblock = INDEF, nyblock = 256
+The working block size. If undefined nxblock and nyblock default
+to the number of columns and rows in the input image respectively.
+.le
+.ls verbose = no
+Print messages about the progress of the task ?
+.le
+
+.ih
+DESCRIPTION
+
+STARFIND searches the input images \fIimage\fR for local density maxima
+with half-widths at half-maxima of ~ \fIhwhmpsf\fR and peak amplitudes
+greater than ~ \fIthreshold\fR above the local background, and writes
+the list of detected objects to \fIoutput\fR.
+
+STARFIND is a modified version of the DAOPHOT package DAOFIND algorithm.
+However STARFIND is intended for use with the IMAGES package image matching
+and image coordinates tasks and is therefore configured somewhat differently
+than the version used in the photometry packages.
+
+.ih
+ALGORITHMS
+
+STARFIND assumes that the point spread function can be approximated by a radial
+Gaussian function whose sigma is 0.84932 * \fIhwhmpsf\fR pixels. STARFIND uses
+this model to construct a convolution kernel which is truncated at
+max (2.0, \fIfradius * hwhmpsf\fR) pixels and normalized to zero power.
+
+For each point in the image density enhancement values are computed by
+convolving the input image with the radial Gaussian function. This operation
+is mathematically equivalent to fitting the image data at each point, in the
+least-squares sense, with a truncated, lowered, radial Gaussian function.
+After the convolution each density enhancement value is an estimate of
+the amplitude of the best fitting radial Gaussian function at that point.
+If \fIdatamin\fR and \fIdatamax\fR are defined then bad data is ignored,
+i.e. rejected from the fit, during the computation of the density enhancement
+values. Out of bounds image pixels are evaluated using the boundary extension
+algorithm parameters \fIboundary\fR and \fIconstant\fR. Out of
+bounds density enhancement values are set to zero.
+
+After the convolution, STARFIND steps through the density enhancement
+image searching for density enhancements greater then \fIthreshold\fR
+and brighter than any density enhancements within a radius of
+\fIsepmin * hwhmpsf\fR pixels. For each potential detection the
+local background is estimated and used, along with the values of
+\fIdatamin\fR and \fIdatamax\fR, to estimate the position (Xc and Yc),
+size (Area and Hwhm), shape (E and Sharp), orientation (Pa), and
+brightness (Mag) of each object using the second order moments analysis
+shown below.
+
+.nf
+ I0 = sum (I)
+ N = sum (1.0)
+ if (N <= 0)
+ Sky = maxdata - maxden
+ else
+ Sky = I0 / N
+
+ M0 = sum (I - Sky)
+ Mx = sum (X * (I - Sky))
+ My = sum (Y * (I - Sky))
+
+ Xc = Mx / M0
+ Xc = My / M0
+ Mag = -2.5 * log10 (M0)
+ Area = N
+
+ Mxx = sum ((X - Xc) * (X - Xc) * (I - Sky))
+ Mxy = sum ((X - Xc) * (Y - Yc) * (I - Sky))
+ Myy = sum ((Y - Yc) * (Y - Yc) * (I - Sky))
+
+ Hwhm = sqrt (log (2) * (Mxx + Myy))
+ E = sqrt ((Mxx - Myy) ** 2 + 4 * Mxy ** 2) / (Mxx + Myy))
+ Pa = 0.5 * atan (2 * Mxy / (Mxx - Myy))
+Sharp = Hmhw / Hwhmpsf
+.fi
+
+The sums are computed using pixels which lie within \fIfradius * hwhmpsf\fR of
+the maximum density enhancement, and whose values are within the good data
+limits defined by \fIdatamin\fR and \fIdatamax\fR, and which are above the local
+background estimate (Sky).
+
+Objects whose magnitude, roundness, and sharpness characteristics are outside
+the values defined by \fImaglo\fR, \fImaghi\fR, \fIroundlo\fR, \fIroundhi\fR,
+\fIsharplo\fR, and \fIsharphi\fR and whose total areas is less than
+\fInpixmin\fR pixels are rejected from the list.
+
+If \fIwcs\fR parameter is defined, the world coordinates as well as
+the pixel coordinates of the detected objects are computed and printed
+using the formats defined by \fIwxformat\fR and \fIwyformat\fR.
+
+To minimize the memory requirements and increase efficiency, STARFIND
+is configured to operate on data blocks that are \fInxblock * nyblock\fR
+in size. To keep the image i/o operation to a minimum nxblock is set
+to INDEF and defaults to the number of columns in the input image.
+Setting both parameter to INDEF will force STARFIND to perform the
+whole operation in memory.
+
+.ih
+FORMATS
+
+.nf
+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
+.fi
+
+.ih
+EXAMPLES
+
+1. Find stellar objects with peak values greater than 100 counts above
+local background in the test image dev$wpix whose fwhm is ~2.5 pixels.
+
+.nf
+cl> starfind dev$wpix default 1.25 100.
+cl> display dev$wpix 1 fi+
+cl> tvmark 1 wpix.obj.1 col=204
+.fi
+
+2. Repeat the previous example but tell starfind to compute and print
+world coordinates in hours and degrees as well as pixel coordinates.
+
+.nf
+cl> starfind dev$wpix default 1.25 100. wcs=world wxf="%12.2H"\
+ wyf="%12.1h"
+cl> display dev$wpix 1 fi+
+cl> tvmark 1 wpix.obj.1 col=204
+.fi
+
+.ih
+TIME REQUIREMENTS
+Starfind requires approximately 8 CPU seconds to search a 512 by 512
+image using a 7 by 7 pixel convolution kernel (SPARCStation2).
+
+.ih
+BUGS
+
+.ih
+SEE ALSO
+imcentroid, apphot.daofind, daophot.daofind
+.endhelp
diff --git a/pkg/images/imcoords/doc/wcsctran.hlp b/pkg/images/imcoords/doc/wcsctran.hlp
new file mode 100644
index 00000000..c8ee4316
--- /dev/null
+++ b/pkg/images/imcoords/doc/wcsctran.hlp
@@ -0,0 +1,340 @@
+.help wcsctran May95 images.imcoords
+.ih
+NAME
+wcsctran -- use the image WCS to transform between IRAF coordinate systems
+.ih
+USAGE
+wcsctran input output image inwcs outwcs
+.ih
+PARAMETERS
+.ls input
+The list of input coordinate files. The number of input coordinate
+files must be one or equal to the number of input images. Coordinates
+may be entered by hand by setting input to "STDIN".
+.le
+.ls output
+The list of output coordinate files. The number of coordinate files
+must be one or equal to the number of input images. Results may be printed
+on the terminal by setting output to "STDOUT".
+.le
+.ls image
+The list of input images containing the WCS information.
+.le
+.ls inwcs, outwcs
+The input and output coordinate systems. Coordinates in the input
+file are assumed to be in the input system. Coordinates are written to
+the output file in the output system. The options are:
+.ls logical
+Logical coordinates are pixel coordinates relative to the current
+image. The logical coordinate system is the coordinate system used by
+the image input/output routines to access the image data on disk.
+.le
+.ls tv
+Tv coordinates are pixel coordinates used by the ximtool and saoimage
+display servers.
+Tv coordinates include the effects of any input image section, but
+do not include the effects of previous linear transformations.
+If the input image name does not include an image section, then tv coordinates
+are identical to logical coordinates. If the input image name does include
+a section, and the input image has not been linearly transformed or
+copied from a parent image, tv coordinates are identical to physical
+coordinates.
+.le
+.ls physical
+Physical coordinates are pixel coordinates invariant with respect to linear
+transformations of the physical image data. For example, if the current
+image was created by extracting a section of another image, the physical
+coordinates of an object in the current image will be equal to the physical
+coordinates of the same object in the parent image, although the logical
+coordinates will be different.
+.le
+.ls world
+World coordinates are image coordinates in any units which are invariant with
+respect to linear transformations of the physical image data. For example,
+the ra and dec of an object will always be the same no matter how the image
+is linearly transformed. The default world coordinate
+system is either 1) the value of the environment variable "defwcs" if
+set in the user's IRAF environment (normally it is undefined) and present
+in the image header, 2) the value of the "system"
+attribute in the image header keyword WAT0_001 if present in the
+image header or, 3) the "physical" coordinate system.
+.le
+.le
+.ls columns = "1 2 3 4 5 6 7"
+The list of columns separated by whitespace or commas in the input coordinate
+file containing the coordinate values.
+The number of specified columns must be greater than or equal to the
+dimensionality of the input image. The coordinates are read in the
+order they are specified in the columns parameter.
+.le
+.ls units = ""
+The units of the input coordinate values, normally degrees for the sky
+projection coordinate systems and angstroms for spectral coordinate
+systems.
+The options are:
+.ls hours
+Input coordinates specified in hours are converted to decimal degrees by
+multiplying by 15.0.
+.le
+.ls native
+The internal units of the wcs. No conversions on the input coordinates
+are performed.
+.le
+
+Units conversions are performed only if the input wcs is "world".
+.le
+.ls formats = ""
+The format for the computed output coordinates. If the formats
+parameter is undefined then: 1) the value of the wcs format attribute
+is used if the output wcs is "world" and the attribute is defined, 2)
+%g format is used with the precision set to the maximum of the precision of
+the input coordinates and the value of the min_sigdigits parameter.
+.le
+.ls min_sigdigits = 7
+The minimum precision of the output coordinates if, the formats parameter
+is undefined, and the output coordinate system is "world" but the wcs
+format attribute is undefined.
+.le
+.ls verbose = yes
+Print comment lines to the output file as the task executes.
+.le
+
+.ih
+DESCRIPTION
+
+WCSCTRAN transforms a list of coordinates, read from the input file
+\fIinput\fR, from the coordinate system defined by \fIinwcs\fR to the
+coordinate system defined by \fIoutwcs\fR using world coordinate system
+information in the input image \fIimage\fR header and writes the results
+to the output file \fIoutput\fR.
+
+The input coordinates are read from and written to the
+columns in the input / output file specified by the \fIcolumns\fR parameter.
+The units of the input coordinate units are assumed to be the internal
+units of the coordinate system as defined in the image header, normally
+degrees for sky projection coordinate systems and angstroms for
+spectral coordinate systems. For convenience input coordinates in hours
+are accepted and converted to decimal degrees if the \fIunits\fR parameter
+is set appropriately.
+
+The format of the output units can be set using the
+\fIformats\fR parameter. If the output formats are unspecified then the
+output coordinates are written using, 1) the value of wcs format attribute if
+outwcs = "world" and the attribute is defined, or, 2) the %g format and a
+precision which is the maximum of the precision of the input coordinates
+and the value of the \fImin_sigdigits\fR parameter. All remaining
+fields in the input file are copied to the output file without modification.
+
+WCSCTRAN transforms coordinates from one builtin IRAF coordinate system
+to another. The builtin coordinate systems are "logical", "physical", and
+"world". For convenience WCSCTRAN also supports the "tv" coordinate system
+which is not a builtin IRAF system, but is used by the display server tasks
+XIMTOOL, SAOIMAGE, and IMTOOL.
+
+The \fIlogical coordinate system\fR is the pixel coordinate system of the
+current image. This coordinate system is the one used by the image
+input/output routines to access the image on disk. In the
+logical coordinate system,
+the coordinates of the pixel centers must lie within the following
+range: 1.0 <= x[i] <= nx[i], where x[i] is the coordinate in dimension i,
+nx[i] is the size of the image in dimension i, and the current maximum
+number of image dimensions is 7. In the case of an image section,
+the nx[i] refer to the dimensions of the section, not the dimensions
+of the full image.
+
+The \fItv coordinate system\fR is the pixel coordinate system used by the
+display servers XIMTOOL, SAOIMAGE, and IMTOOL.
+For images which are not image sections
+the tv and logical coordinate systems are identical. For images which are
+image sections the tv and physical coordinate systems are identical if
+the image has not undergone any prior linear transformations such as
+axis flips, section copies, shifts, scale changes, rotations, etc.
+
+The \fIphysical coordinate system\fR is the coordinate system in which the
+pixel coordinates of an object are invariant to successive linear
+transformations
+of the image. In this coordinate system, the pixel coordinates of an object
+in an image remain the same, regardless of any section copies, shifts,
+rotations, etc on the image. For example, an object with the
+physical coordinates (x,y) in an image would still have physical
+coordinates (x, y) in an image which is a section of the original image.
+
+The \fIworld coordinate system\fR is the default coordinate system for the
+image. The default world coordinate system is the one named by the
+environment variable "defwcs" if defined in the user environment (initially
+it is undefined) and present in the image header; else it is the first
+world coordinate system
+defined for the image (the .imh and .hhh image format support only one wcs
+but the .qp format can support more); else it is the physical coordinate
+system.
+
+In most cases the number of input coordinates is equal to the number of
+output coordinates, and both are equal to the dimensions of the input image.
+In some cases however, the number of output coordinates may be greater or
+less than the number of input coordinates. This situation occurs
+if the input image has been dimensionally-reduced, i.e. is a section
+of a higher-dimensioned parent image, and the input coordinate system
+or the output coordinate system but not both is "logical" or "tv".
+For example, if the input image is a 1D line extracted from a 2D parent
+image with a sky projection world coordinate system, and the user
+specifies a transformation from the "logical" to "world" systems,
+only one input coordinate (column number) is required, but two output
+coordinates (ra and dec) are produced. If the input and output coordinate
+systems are reversed, then two input coordinates (ra and dec) are required,
+but only one output coordinate (column number) is produced. If the number of
+output coordinates is less than the number of input coordinates, the extra
+input coordinate columns in the input file are set to INDEF in the output file.
+If the number of output columns is greater than the number of input columns,
+the extra coordinate columns are added to the end of the output line.
+
+.ih
+FORMATS
+
+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:
+
+.nf
+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
+.fi
+
+
+.ih
+REFERENCES
+
+Additional information on IRAF 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". 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.
+
+.ih
+EXAMPLES
+
+1. Find the pixel coordinates of a list of objects in an image, given a list
+of their ras and decs in hh:mm:ss.s and dd:mm:ss format. Limit the precision
+of the output coordinates to 3 decimal places. In this example, the input
+ras and decs are assumed to be in columns 1 and 2 of the input coordinate
+file, and the ras must be converted from hours to decimal degrees.
+
+.nf
+ im> wcsctran incoords outcoords image world logical units="h n" \
+ formats="%8.3f %0.3f"
+.fi
+
+2. Repeat the previous example using the same input coordinate list to
+produce output coordinate lists for a list of input images.
+
+.nf
+ im> wcsctran incoords @outcoolist @imlist world logical units="h n" \
+ formats="%8.3f %8.3f"
+.fi
+
+3. Transform pixel coordinates in a photometry file to ra and dec
+coordinates, writing the output coordinates in hh:mm:ss.ss and dd:mm:ss.s
+format. The input pixel coordinates are stored in columns 3 and 4 of the
+input coordinate file.
+
+.nf
+ im> wcsctran magfile omagfile image logical world col="3 4" \
+ formats="%12.2H %12.1h"
+.fi
+
+4. Given a set of pixel coordinates in the parent image, find the pixel
+coordinates of the same objects in an image which is a shifted, rotated
+and scaled version of the parent image. The input coordinate list
+is created using the displayed parent image and the rimcursor task.
+The output coordinate lists is marked on the displayed transformed
+image using the tvmark task.
+
+.nf
+ im> display parent 1 fi+
+ im> rimcursor > coolist
+ im> imlintran parent image 45.0 45.0 1.5 1.5 xin=256 yin=256 \
+ xout=281 yout=263
+ im> wcsctran coolist ocoolist image physical logical
+ im> display image 2 fi+
+ im> tvmark 2 outcoolist
+.fi
+
+.ih
+TIME REQUIREMENTS
+
+.ih
+BUGS
+
+.ih
+SEE ALSO
+wcsreset, wcsedit, rimcursor, listpixels, lintran
+
+.endhelp
diff --git a/pkg/images/imcoords/doc/wcsedit.hlp b/pkg/images/imcoords/doc/wcsedit.hlp
new file mode 100644
index 00000000..836add95
--- /dev/null
+++ b/pkg/images/imcoords/doc/wcsedit.hlp
@@ -0,0 +1,429 @@
+.help wcsedit Apr92 images.imcoords
+.ih
+NAME
+wcsedit -- edit an image world coordinate system parameter
+.ih
+USAGE
+wcsedit image parameter value axes1
+.ih
+PARAMETERS
+.ls image
+The list of images for which the WCS is to be edited. Image sections are
+ignored. If the image does not exist a data-less image header is first
+created with the default WCS of dimensionality given by the "wcsdim"
+parameter.
+.le
+.ls parameter
+The WCS parameter to be edited. The WCS parameters recognized by
+WCSEDIT are: 1) the FITS WCS
+parameters crpix, crval, cd and, 2) the IRAF WCS parameters ltv, ltm, wtype,
+axtype, units, label, and format. Only one WCS parameter may be edited at a
+time.
+.le
+.ls value
+The new parameter value. The numerical parameters crpix, crval, cd, ltv, and
+ltm will not be updated if WCSEDIT is unable to decode the parameter value
+into a legal floating point number.
+.le
+.ls axes1
+The list of principal axes for which \fIparameter\fR is to be edited.
+Axes1 can
+be entered as a list of numbers separated by commas, e.g. "1,2" or as a
+range, e.g. "1-2".
+.le
+.ls axes2
+The list of dependent axes for which \fIparameter\fR is to be edited.
+Axes2 can
+be entered as a list of numbers separated by commas, e.g. "1,2" or as a
+range, e.g. "1-2". The axes2 parameter is only required if
+\fIparameter\fR is "cd" or "ltm".
+.le
+.ls wcs = "world"
+The WCS to be edited. The options are: the builtin systems "world" or
+"physical", or a named system, e.g. "image" or "multispec". The builtin system
+"logical" may not be edited.
+.ls world
+If \fIwcs\fR is "world" the default WCS is edited. The default WCS
+is either 1) the value of the environment variable "defwcs" if
+set in the user's IRAF environment (normally it is undefined) and present
+in the image header,
+2) the value of the "system"
+attribute in the image header keyword WAT0_001 if present in the
+image header or, 3) the "physical" coordinate system.
+.le
+.ls physical
+If \fIwcs\fR is "physical", WCS is the pixel coordinate system of
+the original image, which may be different from the pixel coordinate system
+of the current image, if the current image is the result of an
+imcopy or other geometric transformation operation. In the "physical"
+coordinate system the ltv, ltm and the axis attribute
+parameters wtype, axtype, units, label, and format may be edited, but the FITS
+parameters crval, crpix, and cd cannot.
+.le
+.ls name
+A user supplied wcs name.
+If the named WCS does not exist in the image, a new one of that
+name initialized to the identity transform, will be opened for editing, and
+the old WCS will be destroyed. This option should only be used for creating
+a totally new FITS WCS.
+.le
+.le
+.ls wcsdim = 2
+WCS dimensionality when creating a new data-less image header.
+.le
+.ls interactive = no
+Edit the WCS interactively?
+.le
+.ls commands = ""
+The interactive editing command prompt.
+.le
+.ls verbose = yes
+Print messages about actions taken in interactive or non-interactive mode?
+.le
+.ls update = yes
+Update the image header in non-interactive mode? A specific command exists
+to do this in interactive mode.
+.le
+
+.ih
+DESCRIPTION
+WCSEDIT modifies the WCS of an existing image or creates a data-less image
+header of the dimensionality given by the \fIwcsdim\fR parameter.
+
+In non-interactive mode WCSEDIT replaces the current value of the WCS
+parameter \fIparameter\fR with the new value \fIvalue\fR in the headers of
+\fIimages\fR and prints a summary of the new WCS on the terminal. If
+\fIverbose\fR is "no" the summary is not printed. If \fIverbose\fR is
+"yes" and \fIupdate\fR is "no", the result of the editing operation
+is printed on the terminal but the header is not modified.
+
+The WCS parameter \fIparameter\fR may be one of: crval, crpix, cd, ltv, ltm,
+wtype, axtype, units, label, or format in either upper or lower case.
+The WCS array parameters crpix, crval, ltv, wtype, axtype, units, label,
+and format
+may be edited for more than one axis at a time by setting \fIaxes1\fR to a
+range of axes values. The WCS matrix parameters cd and ltm may be edited for
+more than one axis at a time by setting both \fIaxes1\fR and \fIaxes2\fR to
+a range of values. In this case, if no \fIaxes2\fR values are entered,
+\fIaxes2\fR = "", the
+diagonal elements of the cd and ltm matrices specified by \fIaxes1\fR are
+edited. A single non-diagonal element of the cd or ltm matrices can be
+edited by setting \fIaxis1\fR and \fIaxis2\fR to a single number.
+
+The user can create a new WCS from scratch by setting
+\fIwcs\fR to a name different from the name of the WCS in the image header.
+A new WCS with the same dimension as the image and initialized
+to the identity transformation is presented to the user for editing.
+IF THE USER UPDATES THE IMAGE HEADER AFTER EDITING THE NEW WCS, ALL
+PREVIOUS WCS INFORMATION IS LOST.
+
+In interactive mode, WCSEDIT displays the current WCS
+on the terminal if \fIverbose\fR = "yes", and prompts the user for
+an editing command. The supported editing commands are shown below.
+
+.nf
+ BASIC COMMANDS
+
+? Print the WCSEDIT commands
+show Print out the current WCS
+update Quit WCSEDIT and update the image WCS
+quit Quit WCSEDIT without updating the image WCS
+
+
+ PARAMETER DISPLAY AND EDITING COMMANDS
+
+crval [value axes1] Show/set the FITS crval parameter(s)
+crpix [value axes1] Show/set the FITS crpix parameter(s)
+cd [value axes1 [axes2]] Show/set the FITS cd parameter(s)
+ltv [value axes1] Show/set the IRAF ltv parameter(s)
+ltm [value axes1 [axes2]] Show/set the IRAF ltm parameter(s)
+wtype [value axes1] Show/set the FITS/IRAF axes transform(s)
+axtype [value axes1] Show/set the FITS/IRAF axis type(s)
+units [value axes1] Show/set the IRAF units(s)
+label [value axes1] Show/set the IRAF axes label(s)
+format [value axes1] Show/set the IRAF axes coordinate format(s)
+.fi
+
+.ih
+THE WCS PARAMETERS
+
+Below is a list of the WCS parameters as they appear encoded in the in the
+IRAF image header. Parameters marked with E can be edited directly with
+WCSEDIT. Parameters marked with U should be updated automatically by WCSEDIT
+if the proper conditions are met. The remaining parameters cannot be edited
+with WCSEDIT. A brief description of the listed parameters is given below.
+For a detailed description of the meaning of these parameters, the user
+should consult the two documents listed in the REFERENCES section.
+
+.nf
+WCSDIM WCS dimension (may differ from image)
+
+CTYPEn U coordinate type
+CRPIXn E reference pixel
+CRVALn E world coords of reference pixel
+CDi_j E CD matrix
+
+CDELTn U CDi_i if CD matrix not used (input only)
+CROTA2 U rotation angle if CD matrix not used
+
+LTVi E Lterm translation vector
+LTMi_j E Lterm rotation matrix
+
+WATi_jjj U WCS attributes for axis I (wtype,axtype,units,label,format)
+WAXMAPii WCS axis map
+.fi
+
+The WCSDIM and WAXMAP parameters cannot be edited by WCSEDIT, unless a
+new WCS is created in which case WCSDIM is set to
+the dimension of the input image and the axis map is deleted.
+The FITS parameters CRPIX, CRVAL, and CD
+define the transformation between the world coordinate system and the pixel
+coordinate system of the image and may be edited directly. The more general
+FITS CD matrix notation supersedes the FITS CDELT/CROTA notation if both are
+present on input, and is used by preference on output. The FITS parameter
+CTYPE cannot be edited directly by WCSEDIT but is correctly updated on
+output using the current values of the WCS parameters wtype and axtype
+parameters, if there was a pre-existing FITS header in the image. On input
+IRAF currently recognizes the following values of the FITS parameter CTYPE:
+RA---TAN and DEC--TAN (the tangent plane sky projection), RA---SIN and
+DEC--SIN (the sin sky projection), RA---ARC and DEC--ARC (the arc sky
+projection), LINEAR, and MULTISPEC, from which it derives the correct values
+for wtype and axtype.
+
+The LTV and LTM are IRAF parameters which define the transformation between
+the
+current image pixel coordinate system and the original pixel coordinate system,
+if the current image was derived from a previous
+image by a geometric transformation, e.g. IMCOPY or IMSHIFT.
+Both parameters may be edited directly by WCSEDIT, but with the exception
+of resetting the LTV vector to 0 and the LTM matrix to the identity
+matrix it is not usually desirable to do so. The task WCSRESET can also
+be used for this purpose.
+
+The WATi_jjj parameters are not directly accessible by WCSEDIT but the five
+axis attributes which are encoded under these keywords (wtype, axtype,
+units, label, and format) may be edited.
+The IRAF WCS code currently
+recognizes the following values for "wtype": "linear", "tan", "sin",
+"arc", and "multispec". If "wtype" is not defined or cannot
+be decoded by the WCS code "linear" is assumed.
+Axtype should be "ra" or "dec" if wtype is one of the sky projections
+"tan", "sin" or "arc", otherwise it should be undefined.
+WCSEDIT will combine the values of "wtype" and "axtype" on output to
+produce the correct value of the FITS keyword CTYPE.
+The "label" and "units" parameter may be set to any string constant.
+Format must be set to a legal IRAF format as described in the section
+below.
+
+.ih
+FORMATS
+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:
+
+.nf
+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
+.fi
+
+.ih
+REFERENCES
+
+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". 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.
+
+.ih
+EXAMPLES
+
+1. Change the default output coordinate formats for an image with a defined
+FITS tangent plane projection in its header, for the RA axis (axis 1), and the
+DEC axis (axis 2) to %H and %h respectively. Then display the image and use
+rimcursor to produce a coordinate list of objects whose coordinates are
+printed as hh:mm:ss.s and dd:mm:ss.s respectively.
+
+.nf
+ cl> wcsedit image format %H 1
+ cl> wcsedit image format %h 2
+ cl> display image 1
+ cl> rimcursor wcs=world > coordlist
+ ... mark the coordinates
+.fi
+
+2. Change the default sky projection for an image with a defined tangent
+plane projection to one with a sin projection. Note that wtype for both
+axis1 and axis2 must be changed to "sin". Check the results first before
+doing the actual update.
+
+.nf
+ cl> wcsedit image wtype sin 1-2 update-
+ cl> wcsedit image wtype sin 1-2
+.fi
+
+
+3. Change the diagonal elements of the FITS cd matrix to 2.0. The off
+diagonal elements are 0.0. This is equivalent to resetting the image scale.
+
+.nf
+ cl> wcsedit image cd 2.0 1-2 ""
+.fi
+
+4. Set the value of the FITS cd matrix elements, cd[2,1] and cd[1,2] to 0.0.
+This removes any rotation/skew from the WCS definition.
+
+.nf
+ cl> wcsedit image cd 0.0 2 1
+ cl> wcsedit image cd 0.0 1 2
+.fi
+
+5. Change the FITS crval value for axis 2.
+
+.nf
+ cl> wcsedit image crval 47.85 2
+.fi
+
+6. Create a totally new WCS for an image, deleting the previous WCS
+and set the diagonal elements of the cd matrix to 0.68. 0.68 is the
+scale of the 36 inch telescope at KPNO.
+
+.nf
+ cl> wcsedit image cd 1.5 1-2 wcs="kpno9m"
+.fi
+
+7. Interactively edit the WCS of an image. with an existing FITS header.
+
+.nf
+ cl> wcsedit image interactive+
+
+ ... summary of current WCS is printed on terminal
+
+ wcsedit: ?
+
+ ... user types in ? to see list of wcsedit commands
+
+ wcsedit: cd 2.0 1-2
+
+ ... user changes the scale of the WCS
+
+ wcsedit: format %0.3f 1-2
+
+ ... user changes format so the coordinates will be printed
+ out with 3 decimals of precision by any tasks which
+ can read the WCS format parameter such as rimcursor
+ and listpixels
+
+ wcsedit: show
+
+ ... user checks the new wcs
+
+ wcsedit: update
+
+ ... user quits editor and updates the image header
+.fi
+
+8. Open and edit a new WCS for an image. Any pre-existing WCS will
+be destroyed, assuming that the default wcs is not "newwcs".
+
+.nf
+ cl> wcsedit image wcs=newwcs intera+
+
+ wcsedit: ....
+ wcsedit: ....
+
+ ... edit in the desired values
+
+ wcsedit: update
+
+ ... update the image header.
+.fi
+
+.ih
+TIME REQUIREMENTS
+.ih
+BUGS
+The IRAF WCS code supports the dimensional reduction of images,
+for example creating an image with smaller dimensions than its parent, but
+may not be fully compatible with FITS when this occurs.
+In this case user may need to fix up an illegal or
+incorrect WCS with HEDIT or HFIX bypassing the WCS code used by WCSEDIT.
+
+WCSEDIT does not permit the user to edit any parameters encoded in the
+WATi_jjj keywords other than the five listed: wtype, axtype, units, label,
+and format. For example WCSEDIT cannot be used to edit the "speci" parameters
+used by the IRAF spectral reductions code "multispec" format. The spectral
+reduction code itself should be used to do this, although hfix can
+be used to fix a serious problem should it arise.
+.ih
+SEE ALSO
+wcsreset,hedit,hfix
+.endhelp
diff --git a/pkg/images/imcoords/doc/wcsreset.hlp b/pkg/images/imcoords/doc/wcsreset.hlp
new file mode 100644
index 00000000..401e0ae0
--- /dev/null
+++ b/pkg/images/imcoords/doc/wcsreset.hlp
@@ -0,0 +1,272 @@
+.help wcsreset Apr92 images.imcoords
+.ih
+NAME
+wcsreset -- reset the image coordinate system
+.ih
+USAGE
+wcsreset image wcs
+.ih
+PARAMETERS
+.ls image
+The list of images for which the coordinate system is to be reset. Image
+sections are ignored.
+.le
+.ls wcs
+The name of the coordinate system to be reset. The following systems are
+pre-defined:
+.ls physical
+Reset the physical coordinate system to the logical coordinate system, but
+leave the default world coordinate system unchanged. This operation removes
+the history of past image operations such as imcopy, imshift, magnify, etc
+from the definition of the physical coordinate system, but not from the
+definition of the world coordinate system.
+.le
+.ls world
+Reset the default world coordinate system to the logical coordinate system.
+This operation removes all world coordinate system information from the
+image header.
+.le
+
+In addition to these two reserved world coordinate systems, the name of any
+other defined world coordinate system, for example "multispec" may be given.
+In this case WCSRESET resets the named coordinate system to the logical
+coordinate system only if it is present in the image header.
+.le
+.ls verbose = yes
+Print messages about actions taken by the task?
+.le
+.ih
+DESCRIPTION
+
+WCSRESET resets the coordinate system \fIwcs\fR in the images specified by
+\fIimage\fR to the logical coordinate system, and prints messages about the
+actions taken if \fIverbose\fR = "yes". Since WCSRESET modifies the
+image headers it should be used with caution.
+
+Logical coordinates are coordinates relative to the current image. The
+logical coordinate system is the one used by the image input/output routines
+to access the image on disk. In an image raster logical coordinate system,
+the coordinates of the pixel centers must lie within the following
+range: 1.0 <= x[i] <= nx[i], where x[i] is the coordinate in dimension i,
+nx[i] is the size of the image in dimension i, and the current maximum
+number of image dimensions is 7. In the case of an image section of an image
+raster, the nx[i] refer to the dimensions of the section, not the dimensions
+of the full image. The logical coordinate system cannot by definition be
+reset.
+
+The physical coordinate system is the coordinate system in which the
+coordinates of an object are invariant to successive linear transformations
+of the image. In this coordinate system, the pixel coordinates of an object
+in an image raster remain the same, regardless of any imcopy, imshift,
+rotate, etc operations on the image. The most common reason for desiring to
+reset the physical coordinate system to the logical coordinate system is to
+make the new image independent of its history by removing the effects of
+these linear transformation operations from its physical coordinate system.
+Resetting the physical coordinate system to the logical coordinate system,
+does not alter the default world coordinate system. If for example the input
+image is a spectrum, with a defined dispersion solution, resetting the
+physical coordinate system will not alter the dispersion solution.
+Similarly if the input image is a direct CCD image with a defined sky
+projection world coordinate system, resetting the physical coordinate system
+will not alter the sky projection.
+
+The world coordinate system is the default coordinate system for the
+image. The default world coordinate system is the one named by the
+environment variable "defwcs" if defined in the user environment (initially
+it is undefined) and present in the image header; else it is the first
+world coordinate system
+defined for the image (the .imh and .hhh image format support only one wcs
+but the .qp format can support more); else it is the physical coordinate
+system. Resetting the default coordinate system to the logical
+coordinate system will destroy all coordinate information for that system,
+for that image.
+
+If the user sets the parameter wcs to a specific system, for example
+to "multispec", only images with the coordinate system "multispec"
+will have their coordinate system reset.
+
+.ih
+REFERENCES
+
+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". 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.
+
+.ih
+EXAMPLES
+
+1. The user runs implot on a section of the spectrum outspec with the
+wcs parameter set to "physical".
+
+.nf
+ implot outsec[30:50] wcs=physical
+.fi
+
+To his/her surprise the range of the plot in x produced by implot is
+[129,149] not [30:50] as expected. The user lists the image header with the
+imheader task and sees the following.
+
+.nf
+ WCSDIM = 1
+ CTYPE1 = 'LINEAR '
+ CRVAL1 = 4953.94775390626
+ CRPIX1 = -98.
+ CDELT1 = 0.0714096948504449
+ CD1_1 = 0.0714096948504449
+ WAT0_001= 'system=linear
+ WAT1_001= 'wtype=linear label=Wavelength units=Angstroms
+ LTV1 = -99.
+ LTM1_1 = 1.
+.fi
+
+The standard FITS keywords CTYPE1, CRVAL1, CRPIX1, and CDELT1 are present.
+The CD1_1 keyword is part of the new FITS CD matrix notation and in this
+example duplicates the function of CDELT1. The remaining keywords WCSDIM,
+WAT0_001, WAT1_001, LTV1, and LTM1_1 are IRAF specific keywords. The
+user notes that the LTV1 keyword is -99. not 0. and suddenly remembers that
+outspec was created by extracting a piece of a larger spectrum using the
+imcopy task as shown below.
+
+.nf
+ cl> imcopy inspec[100:200] outspec
+.fi
+
+The section [30:50] in outspec actually corresponds to the section [129:149]
+in inspec and it is this coordinate system that implot is plotting when
+wcs = "physical". The user decides has he/she does not want to know
+about the pixel coordinate system of the original image and runs wcsreset
+to reset the physical coordinate system to the logical coordinate system.
+
+.nf
+ wcsreset outspec physical
+.fi
+
+The new header of outspec looks like the following.
+
+.nf
+ WCSDIM = 1
+ CTYPE1 = 'LINEAR '
+ CRVAL1 = 4953.94775390626
+ CRPIX1 = -98.
+ CDELT1 = 0.0714096948504449
+ CD1_1 = 0.0714096948504449
+ WAT0_001= 'system=linear
+ WAT1_001= 'wtype=linear label=Wavelength units=Angstroms
+ LTM1_1 = 1.
+.fi
+
+It is identical to the header listed above except that the
+LTV1 keyword is not defined and is therefore 0. The user runs
+implot with wcs = "physical" as before and sees a plot which extends
+from 30 to 50 as expected.
+
+2. Reset the physical coordinate system of the direct CCD image skypix
+which has a defined sky projection system. Skypix was created by
+copying the central [129:384,129:384] of a 512 square image into a 256
+square image.
+
+The image header is the following.
+
+.nf
+ CRPIX1 = 129.75
+ CRPIX2 = 130.93
+ CRVAL1 = 201.94541667302
+ CRVAL2 = 47.45444
+ CTYPE1 = 'RA---TAN'
+ CTYPE2 = 'DEC--TAN'
+ CDELT1 = -2.1277777E-4
+ CDELT2 = 2.1277777E-4
+ WCSDIM = 2
+ CD1_1 = -2.1277777000000E-4
+ CD2_2 = 2.12777770000000E-4
+ LTV1 = -128.
+ LTV2 = -128.
+ LTM1_1 = 1.
+ LTM2_2 = 1.
+ WAT0_001= 'system=image
+ WAT1_001= 'wtype=tan axtype=ra
+ WAT2_001= 'wtype=tan axtype=dec
+.fi
+
+The user runs implot on skypix wcs = "physical"
+
+.nf
+ implot skypix wcs=physical
+.fi
+
+and sees a plot in x which extends from 129 to 384 which are the coordinates
+of skypix in the original image.
+The user resets the physical coordinate system to the logical coordinate
+system.
+
+.nf
+ cl> wcsreset m51 physical
+.fi
+
+The new header looks like the following. Note that the LTV1 and LTV2 keywords
+have disappeared, they are 0. but everything else is the same.
+
+.nf
+ CRPIX1 = 129.75
+ CRPIX2 = 130.93
+ CRVAL1 = 201.94541667302
+ CRVAL2 = 47.45444
+ CTYPE1 = 'RA---TAN'
+ CTYPE2 = 'DEC--TAN'
+ CDELT1 = -2.1277777E-4
+ CDELT2 = 2.1277777E-4
+ WCSDIM = 2
+ CD1_1 = -2.1277777000000E-4
+ CD2_2 = 2.12777770000000E-4
+ LTM1_1 = 1.
+ LTM2_2 = 1.
+ WAT0_001= 'system=image
+ WAT1_001= 'wtype=tan axtype=ra
+ WAT2_001= 'wtype=tan axtype=dec
+.fi
+
+When the user runs implot with wcs = "physical" he/she sees a plot which
+extends from 1 to 256 as expected.
+
+3. Initialize the world coordinate system of the previous image.
+
+.nf
+ cl> wcsreset skypix world
+.fi
+
+The header now looks like the following.
+
+.nf
+ WCSDIM = 2
+ LTM1_1 = 1.
+ LTM2_2 = 1.
+ WAT0_001= 'system=physical
+ WAT1_001= 'wtype=linear
+ WAT2_001= 'wtype=linear
+.fi
+
+The world system defaults to the physical coordinates system and the
+physical coordinate system is identical to the logical coordinate system.
+All coordinate information has been destroyed.
+
+4. Initialize the world coordinate system "spec1". If the default world
+coordinate
+system "spec1" cannot be found in the image header a warning message
+will be issued and nothing will be changed.
+
+.nf
+ cl> wcsreset spectrum spec1
+.fi
+
+.ih
+TIME REQUIREMENTS
+.ih
+BUGS
+.ih
+SEE ALSO
+rimcursor,listpixels,wcsedit,hedit,hfix
+.endhelp