IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38336


Ignore:
Timestamp:
May 29, 2015, 5:45:50 PM (11 years ago)
Author:
eugene
Message:

for uncompressed image, need to swap bytes on the varlength column

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/opihi/cmd.data/rd.c

    r38062 r38336  
    192192    ftable.header[0].buffer = NULL;
    193193    gfits_copy_header (&buf[0].header, ftable.header);
    194     status = gfits_fread_ftable_data (f, &ftable, FALSE);  // this just reads the bytes (not even a SWAP)
    195     status = gfits_uncompress_image (&buf[0].header, &buf[0].matrix, &ftable);
     194    if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { fprintf (stderr, "problem reading compressed image table data\n"); fclose (f); return FALSE; }
     195    if (!gfits_byteswap_varlength_column (&ftable, 1)) { fprintf (stderr, "problem doing byteswap on compressed image metadata column\n"); fclose (f); gfits_free_table (&ftable); return FALSE; }
     196    if (!gfits_uncompress_image (&buf[0].header, &buf[0].matrix, &ftable)) { fprintf (stderr, "problem uncompressing the image data\n"); fclose (f); gfits_free_table (&ftable); return FALSE; }
     197
    196198    // uncompressing the image leaves the format as an extension
    197199    gfits_extended_to_primary (&buf[0].header, TRUE, "Standard FITS");
Note: See TracChangeset for help on using the changeset viewer.