[fitsbits] FITS reading problems

William Pence pence at tetra.gsfc.nasa.gov
Mon Jan 17 12:16:07 EST 2000


The input value of the status parameter must = 0  before every
call to a CFITSIO routine otherwise the routine will simply return 
without doing anything.  This 'inherited status'  feature prevents
CFITSIO from continuing  operations that could possibly compound
the original  error, and makes it unnecessary to test the status value after
every single CFITSIO call.  So just reset status = 0 if you want to ignore
the error and continue processing.  It is not necessary to call the
fits_clear_errmsg routine in this case because no error messages
were written to the error stack as a result of this error.

-Bill Pence


On Mon, Jan 17, 2000 at 11:50:10AM +0000, Liam Gretton wrote:
> Hi,
> 
> I'm using my own port of CFITSIO 2.024 to RISC OS (this may or may not be
> relevant, but RISC OS is a desktop OS that isn't like Unix at all).
> 
> I've found that trying to read a keyword that isn't present in a FITS file
> means that all subsequent attempts to read keywords that *are* present fail.
> 
> For example, using
> 
>   fits_read_key_str(ffile, "ORIGIN", value, NULL, &status);
>   
> when the ORIGIN keyword is not present returns a status of 202
> (KEY_NO_EXIST) as expected. I've tried using fits_clear_errmsg() after this
> to allow my code to continue reading the rest of the file, but to no avail.
> Even closing and re-opening the file doesn't help!
> 
> Any suggestions to solve this irritating problem would be gratefully
> received.
> 
> -- 
> Liam Gretton                                              ljg at star.le.ac.uk
> Space Research Centre,                             http://www.src.le.ac.uk/
> Physics and Astronomy Dept,                      phone +44 (0) 116 223 1039
> University of Leicester,                          fax  +44 (0) 116 252 2464
> Leicester LE1 7RH, UK                             http://xmm4.xra.le.ac.uk/



More information about the fitsbits mailing list