FITS file handling inside Midas ------------------------------- FITS files can be used as input and input/output files throughout Midas. A FITS image file is processed as follows: a) for Input/Modification the FITS header is read into memory (handled via OSY_VMEM) and stored as Midas descriptors (inside SCFOPN) FCT.IOCHAN is set to a negative value instead of a positive file id FCT.FILTYPE = 1 thereafter all access to the descriptors of that file proceeds exactly the same as for Midas files, the switch is set at the OSY_RVB + OSY_WVB level, which test for a negative file id (I/O channel) the data of the FITS file are always mapped in completely, once the first SCFMAP, SCFPUT or SCFGET call happens if the FITS image has been modified (descr. and/or data) the internal image is written to a new FITS file which is renamed to input image after b) for Output newly created images are always in Midas format and in the end (SCFCLO) are saved as FITS file on disk To produce FITS files automatically in Midas the command: SET/MIDAS newfile=FITS has to be executed first, which sets keyword AUX_MODE(13) to 1 (Midas format and default is 0). A FITS table file is processed as follows: a) for Input/Modification the FITS header is read into memory (handled via OSY_VMEM) and stored as Midas descriptors FCT.IOCHAN is set to a negative value instead of a positive file id, also all table data is already mapped into memory (inside TCTOPN) FCT.FILTYPE = 2 thereafter all access to the descriptors of that table proceeds exactly the same as for Midas files, the switch is set at the OSY_RVB + OSY_WVB level, which test for a negative file id (I/O channel) version 0.99 980317