IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 1 and Version 2 of FITS_Interface_in_PSLib


Ignore:
Timestamp:
Apr 7, 2009, 1:02:17 PM (17 years ago)
Author:
eugene
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FITS_Interface_in_PSLib

    v1 v2  
    44
    55Files compressed with CFITSIO Tile compression using the gzip compression method have to be handled in a somewhat surprising way by libgfits.  In the tile compression method, a series of compressed data sequences are written as entries in a variable length FITS table column.  These are identified by the table header as having 4 bytes per data element.  Normally, I would expect to have to do the following steps:
    6 # read a segment of data from the table
    7 # byteswap (if needed) based on the size of the data element (in this case 4 bytes)
    8 # pass the swapped data vector to the uncompression function (in this case zlib's uncompress function)
    9 # insert the resulting data values into the image in the appropriate location. 
     61. read a segment of data from the table
     71. byteswap (if needed) based on the size of the data element (in this case 4 bytes)
     81. pass the swapped data vector to the uncompression function (in this case zlib's uncompress function)
     91. insert the resulting data values into the image in the appropriate location. 
    1010
    1111For images compressed with cfitsio gzip (at least for 16 input data), I apparently have to:
    12 # read the data segment from the table
    13 # strip off the gzip header segment (gfits_gz_striphead)
    14 # pass the remaining bytes directly to a modified version of the uncompress function (gfits_uncompress) -- this version is copied from uncompress, but passes the value -15 to inflateInit to tell it that the data has had the header stripped already.
    15 # byteswap the resulting vector based on the bytes/pixel of the output data.
     121. read the data segment from the table
     131. strip off the gzip header segment (gfits_gz_striphead)
     141. pass the remaining bytes directly to a modified version of the uncompress function (gfits_uncompress) -- this version is copied from uncompress, but passes the value -15 to inflateInit to tell it that the data has had the header stripped already.
     151. byteswap the resulting vector based on the bytes/pixel of the output data.
    1616
    1717Does this mean I am doing something wrong (ie, I could skip some of this work if I just...?), or does it mean CFITSIO is doing something strange (like byteswapping in the wrong place or messing up the header?).  I've update libgfits to handle this issue in r23724.