next up previous 231
Next: Using the NDF library directly
Up: USING THE NDF LIBRARY TO DO MORE
Previous: Using regions and slices of images


Accessing foreign data formats

IMG can be used to access data in formats other than NDF by using the NDF library's `on-the-fly' data conversion capabilities. If you have the CONVERT package (SUN/55) available on your system, you can use it to give your IMG programs access to several important additional astronomical data formats (including IRAF, disk FITS and FIGARO). All you need to do is issue the package startup command:
% convert
before running your IMG program. It will then be able to access these other formats in the same way as its ``native'' NDF format.

If you have copies of the same image in more than one format, you may need to add the appropriate file type extension - .imh, .fit and .dst for the IRAF, FITS and FIGARO formats respectively - as part of the image name, in order to distinguish them. So a typical session in which an IRAF data frame is read might be (the program is the mean example from §[*]):

% convert
% mean
IN - Input image > myimage.imh
Mean = 108.3154
%

One point of particular relevance to IMG is the transfer of header information between the different data formats. Unless you take special action, only FITS headers will generally be transferred. So, unless you intend to make sole use of the NDF format, having sources of header information other than FITS may cause problems and is probably best avoided for the sake of simplicity.

If you want to process data in formats other than those provided by CONVERT, then you can define your own conversions. You should consult SSN/20 about how to do this.



next up previous 231
Next: Using the NDF library directly
Up: USING THE NDF LIBRARY TO DO MORE
Previous: Using regions and slices of images

IMG Simple Image Data Access
Starlink User Note 160
P.W. Draper
R.F. Warren-Smith
3 March 2003
E-mail:P.W.Draper@durham.ac.uk

Copyright © 2000-2003 Council for the Central Laboratory of the Research Councils