IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#759 closed defect (fixed)

psFitsReadHeader fails to handle NaN cards

Reported by: rhl@… Owned by: Paul Price
Priority: high Milestone:
Component: fits Version: 0.11.0
Severity: normal Keywords:
Cc:

Description

A fits header card such as
RA = NaN / 1st row - Right ascension of telescope boresigh
are read without complaint as S16 (== 'I').

The problem is that cfitsio routine fits_get_keytype doesn't complain.

N.b. note that this routine is also called by psMetadataReadHeader()

Change History (5)

comment:1 by Paul Price, 20 years ago

Owner: changed from David.Robbins@… to Paul Price

I'll take a look into this.

comment:2 by Paul Price, 20 years ago

Cc: eugene@… added
Resolution: fixed
Status: newclosed

This is principally due to a deficiency in cfitsio. We have plans to upgrade to
our own FITS reader in the future, but we have more immediate priorities.

I tried reading a FITS header that contains NaN and Inf, but these are both
converted to zero. fits_get_keytype reports that "nan" is a short int (the
default, "I've no idea what this is" type). I added filters to the parsing of
this type in psFitsReadHeader to trap NAN, INF and -INF, and add them as F32
types to the metadata. I'm not 100% happy with the solution (the problem is
mostly cfitsio's), but the result is that we can now read these values successfully.

The FITS header contains:
FOONAN = nan /
FOOINF = inf /

Using psFitsReadHeader, and psMetadataPrint:
FOONAN: nan
FOOINF: inf

Updated the code in CVS head.

Note also bug 760 --- writing NaN or Inf to a FITS header as a floating-point
type is impossible with cfitsio.

comment:3 by Paul Price, 20 years ago

Removed psMetadataReadHeader --- this function is no longer in the SDRS, and its
functionality has been replaced by psFitsReadHeader.

Changed in CVS head.

comment:4 by Paul Price, 20 years ago

Keywords: VERIFIED added

Bug has been resolved.... closing.

comment:5 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.