mTANHdr

Description:
Analyzes a template file and determines if there would be an adequate equivalent distorted TAN projection, within a specified tolerance, and outputs the alternate header. This header can be used in conjunction with mProjectPP to produce a TAN plane image. This process is considerably faster than projecting with the general purpose tool mProject.
The output header is a FITS header template containing a TAN projection with polynomial focal plane distortions. (Link to an example output header)
mTANHdr is most suitable for projections which can be approximated by tangent-plane projections (TAN, SIN, ZEA, STG, ARC), and is also therefore not suited for images covering large portions of the sky.
Syntax:
mTANHdr [-d] [-o order][-i maxiter][-t tolerance][-s statusfile] orig.hdr new.hdr

Switches:

-d
Print additional debugging information to stdout.
-o order
Order of output header polynomial focal plane distortions (default = 4)
-i maxiter
Maximum number of iteration attempts to produce header (default = 50)
-t tolerance
Distortion tolerance value for acceptable output (default = 0.01)
-s statusfile
Output and errors are written to statusfile instead of stdout.

Arguments:

orig.hdr
Input FITS header
new.hdr
Path to output header to be created
Results:
[struct stat="OK", fwdxerr=fwdxerr, fwdyerr=fwdyerr, fwditer=iter, revxerr=revxerr, revyerr=revyerr, reviter=reviter]
where fwdxerr and fwdyerr are the maximum errors along each axis found when projecting from the original image to the distorted header; revxerr and revyerr are the maximum errors along each axis found when projecting from the distorted header back to the original header; and fwditer and reviter are the number of iterations required in each direction to converge on a solution.

Examples:

$ mTANHdr input/SIN_1.hdr alternate.hdr
[struct stat="OK", fwdxerr=4.31068e-05, fwdyerr=4.42599e-05, fwditer=4, revxerr=1.22123e-05, revyerr=1.19694e-05, reviter=4]

The output header is a FITS header template containing a TAN projection with polynomial focal plane distortions: alternate.hdr

Return Codes:

  • [struct stat="OK", fwdxerr=fwdxerr, fwdyerr=fwdyerr, fwditer=iter, revxerr=revxerr, revyerr=revyerr, reviter=reviter]
  • [struct stat="ERROR", msg="Usage: mTANHdr [-d] [-o order] [-i maxiter] [-t tolerance] [-s statusfile] orig.hdr new.hdr (default: order = 4, maxiter = 50, tolerance = 0.01)"]
  • [struct stat="ERROR", msg="-i (iterations) argument "arg" not an integer"]
  • [struct stat="ERROR", msg="-o (order) argument "arg" not an integer"]
  • [struct stat="ERROR", msg="-t (tolerance) argument "arg" not a real number"]
  • [struct stat="ERROR", msg="Cannot open status file: statusfile"]
  • [struct stat="ERROR", msg="Cannot open output template file new.hdr"]
  • [struct stat="ERROR", msg="All points offscale in forward transform"]
  • [struct stat="ERROR", msg="All points offscale in reverse transform"]
  • [struct stat="ERROR", msg="Bad template: orig.hdr"]
  • [struct stat="ERROR", msg="Output wcsinit() failed."]
  • [struct stat="ERROR", msg="Singular Matrix-1"]
  • [struct stat="ERROR", msg="Singular Matrix-2"]
  • [struct stat="ERROR", msg="Allocation failure in ivector()"]