FUNCTION safe_headfits, file, ext, maxtry ; Description: This function tests that a FITS image file is available on disk before ; reading in the required header corresponding to the specified image ; extension. If the file is not available, then the module waits 1 second ; before trying again. The module will attempt to read the image header a ; total of "maxtry" times before giving up and returning the string ; "ERROR". ; ; Input Parameters: ; ; file - STRING - The full directory path and file name of the FITS image file to be ; read in. ; ext - INTEGER/LONG - The FITS file image extension for which the header is to be ; read in. If "ext" is set to a negative number, then the ; function will read in the primary FITS header (extension ; number "0"). ; maxtry - INTEGER/LONG - Maximum number of attempts at reading the image header ; before giving up and returning the string "ERROR" (Default ; value = 1). ; ; Return Value: ; ; The required header is returned as a STRING VECTOR. ; ; Author: Dan Bramich (dan.bramich@hotmail.co.uk) ; ; History: ; ; 19/04/2008 - Module created (dmb) ;Check that "file" is a variable of STRING type ;If "ext" is not a non-negative number of the correct type, then reset its value to "0" ;If "maxtry" is not a positive number of the correct type, then reset its value to "1" ;Wait until the input file is available ;Return the required header