### IRAF2NDF

Converts an IRAF image to an NDF

#### Description:

This application converts an IRAF image to an NDF. See the "Notes" for details of the conversion.

iraf2ndf in out

#### Parameters:

The name of the IRAF image. Note that this excludes the ".imh" file extension.
##### OUT = NDF (Write)
The name of the NDF to be produced.
If TRUE, the user headers of the IRAF file are written verbatim to the NDF’s FITS extension. Any IRAF history records are also appended to the FITS extension. The FITS extension is not created if there are no user headers present in the IRAF file. [TRUE]
This parameter decides whether or not to create NDF HISTORY records. Only the IRAF headers with keyword HISTORY, and which originated from NDF HISTORY records are used. If PROHIS=TRUE, NDF HISTORY records are created. [TRUE]

#### Examples:

iraf2ndf ell_galaxy new_galaxy
Converts the IRAF image ell_galaxy (comprising files ell_galaxy.imh and ell_galaxy.pix) to an NDF called new_galaxy.
iraf2ndf ell_galaxy new_galaxy noprofits noprohis
As above, except no FITS extension is created, and NDF-style HISTORY lines in ell_galaxy.imh are not transferred to HISTORY records in NDF new_galaxy.

#### Notes:

The rules for the conversion are as follows:
• The NDF is created with bounds determined by any LBOUND$n$ keywords in the IRAF image header.

• The NDF data array is copied from the ".pix" file.

• The title of the IRAF image (object i_title in the ".imh" header file) becomes the NDF title. Likewise headers OBJECT and BUNIT become the NDF label and units respectively.

• The pixel origin is set if any LBOUNDn headers are present.

• Lines from the IRAF image header file may be transferred to the FITS extension of the NDF, when PROFITS=TRUE. Any compulsory FITS keywords that are missing are added. Certain other keywords are not propagated. These are the IRAF “Mini World Co-ordinate System” (MWCS) keywords WCSDIM, DC_FLAG, WATd_nnn (d is dimension, nnn is the line number). Certain NDF-style HISTORY lines in the header are also be ignored when PROHIS=TRUE (see two notes below).

• When PROFITS=TRUE, lines from the HISTORY section of the IRAF image are also extracted and added to the NDF’s FITS extension as FITS HISTORY lines. Two extra HISTORY lines are added to record the original name of the image and the date of the format conversion.

• When PROHIS=TRUE, any HISTORY lines in the IRAF headers, which originated from an NDF2IRAF conversion of NDF HISTORY records. Such headers are not transferred to the FITS airlock, when PROFITS=TRUE.

• Most axis information can be propagated either from standard FITS-like keywords, or certain MCWS headers. Supported systems and formats are listed below.

• FITS

• linear
• log-linear

• Equispec

• linear

• log-linear

• Multispec

• linear

• log-linear

• Chebyshev and Legendre polynomials

• Linear and cubic Spline

• Explicit list of co-ordinates

However, for Multispec axes, only the first (spec1) axis co-ordinates are transferred to the NDF AXIS centres. Any spec2 …specn co-ordinates, present when the data array is not one-dimensional or multiple fits have been stored, are ignored. The weights for multiple fits are thus also ignored. The data type of the axis centres is _REAL or _DOUBLE depending on the number of significant digits in the co-ordinates or coefficients.

The axis labels and units are also propagated, where present, to the NDF AXIS structure. In the FITS system, these are derived from the CTYPEn and CUNITn keywords. In the MWCS, these components originate in the label and units parameters.

The redshift correction, when present, is applied to the MCWS axis co-ordinates.

#### Related Applications

Convert: NDF2IRAF.

#### Pitfalls

• Bad pixels in the IRAF image are not replaced.

• Some of the routines required for accessing the IRAF header file are written in SPP. Macros are used to find the start of the header line section, this constitutes an ‘Interface violation’ as these macros are not part of the IMFORT interface specification. It is possible that these may be changed in the future, so beware.

#### References

IRAF User Handbook Volume 1A: A User’s Guide to FORTRAN Programming in IRAF, the IMFORT Interface, by Doug Tody.

CONVERT, IRAF

#### Implementation Status:

• Only handles one-, two-, and three-dimensional IRAF files.

• The NDF produced has type _WORD or _REAL corresponding to the type of the IRAF image. (The IRAF IMFORT FORTRAN subroutine library only supports these data types: signed words and real.) The pixel type of the image can be changed from within IRAF using the ‘chpixtype’ task in the ‘images’ package.

• See "Release Notes" for IRAF Version compatibility.