iraf icon indicating copy to clipboard operation
iraf copied to clipboard

Revert to CFITSIO for table i/o

Open olebole opened this issue 11 months ago • 0 comments

Taken from NOIRLABs IRAF, 5d4c168b549bf2b41a2e7dfe0e5e2de86328b9ba, author @mjfitzpatrick

The libtbtables.a was changed in v2.16 to use SPP fitsio from earlier uses of the fortran version under the assumption that they were equivalent. However, there is a bug in the fortran version of ftdrow() when called by the TDIFFER task in which the output table doesn't have its NAXIS2 value properly updated for FITS tables causing the task to exit. The cfitsio code acknowledges the value may not be correct and so uses an internal data structure value for the 'nrows' rather than the keyword, but equivalent functionality does not exist in the fortran version. A similar problem exists when inserting rows but this is not called from any existing NTTOOLS tasks.

This change fixes a bug in the GEMINI.GSEEING task which is the only task known to call TDIFFER.

This PR however has a number of disadvantages: first the cfitsio version is quite old, so that many platforms are unsupported. Then, cfitsio is platform dependent and therefore should be part of the HSI and not part of an application package. And finally, cfitsio is used in other packages (st4gem, fitsutil), and it is probably not a good idea to have the same code (maybe in different versions) several times.

olebole avatar Mar 05 '24 07:03 olebole