You are here: Home / Surveys & Projects / WFCAM / Data Processing / IRAF ZPN patch

IRAF ZPN patch

Information on the fix for ZPN in IRAF.


IRAF V2.13 already includes the ZPN driver, earlier versions require the following patch.

IRAF V2.12 and before do not support the ZPN projection. This means that all the operations that use the WCS (e.g. stacking, co-ordinate conversions, etc.) will produce the wrong result. The ZPN projection has been part of the FITS standard (see Calabretta, M.R. & Greisen, E.W. 2002 A&A, 395, 1077) for several years now and it is actually supported by many astronomical software programs.


To apply the patch you need to login in your system as the iraf user.

  1. Download the path tar file: zpnfix.tgz
  2. Unpack the file in $iraf/sys/mwcs
  3. Login into IRAF as the iraf user (or iraf administrator):
    cl> cd iraf$
    cl> mkpkg <arch>
    where <arch> is your OS. For example, if it is RedHat, then:
    cl>mkpkg redhat
  4. Compile the patch in iraf$sys/mwcs and then relink everything:
    cl> cd iraf$sys/mwcs
    cl> mkpkg
    cl> mkpkg generic
  5. Compile and relink all the NOAO packages:
    cl> cd noao$
    cl> mkpkg <arch>
    cl> mkpkg
    cl> mkpkg generic
    as before, substitute the correct value for your OS.
  6. Repeat step 5 for any other external packages (e.g. mscred).

The quick alternative

Although we strongly recommend fixing the ZPN problem by using the latest IRAF distribution, there is an alternative.

IRAF understands another projection called ZPX which is almost equivalent to ZPN but it is not standard. One possibility is therefore to convert the WCS in the FITS headers from ZPN to ZPX. To do that you can use this IRAF script. One of the main drawbacks of this approach is that the WCS will be interpreted correctly only as long as you are working within IRAF, e.g. DS9 will not understand it WCS anymore.

Note that if you work around the problem by converting to the TAN projection, you get serious astrometric distortion of up 10 arcsec around the outer corners of the detectors.