A FITS file can be converted to NDF using the Starlink package Convert. The
convert instruction sets up the
definitions for this package and only needs to be entered once,
the relevant one here being
Note that the
.sdf file extension NDF may be omitted to save typing.
Unless your FITS file is from a recognised source, fits2ndf puts the various FITS extensions into NDF extensions called FITS_EXT_, where counts from one for the first FITS extension. These are located in the top-level MORE component of the NDF. If one of these is the array you want—it should be an NDF too—it will be easier to handle if you copy out of the NDF extension to its own NDF.
If there is a variance array stored in another extension that you want to attach to your new NDF, a command like the following will do that.
fits2ndf does offer a way of mapping FITS extensions to familiar NDF array components DATA, VARIANCE,
and QUALITY through the
EXTABLE file, avoiding the ndfcopy and possible setvar steps.
The Convert package can also be used to convert an NDF file to FITS format.
There are options to control whether or not to export all of the NDF extensions (
PROEXTS) and history records
PROHIS), and whether or not to merge the contents of the FITS airlock (
For historical reasons the specific set of headers encoding the world co-ordinate system varies from package to package. There is a parameter to select the appropriate encoding for the destination of the FITS file. A common one in the submillimetre world is the Class package used for spectroscopic reductions.
This will create a
ga20091011_37_1_reduced.fit file with the Class-style of WCS headers.