IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 12, 2015, 6:18:23 PM (11 years ago)
Author:
eugene
Message:

merge changes from EAM dev branch ohana.20150429

Location:
trunk/Ohana
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.data

  • trunk/Ohana/src/opihi/cmd.data/rd.c

    r38255 r38441  
    99  Buffer *buf;
    1010
     11  int VERBOSE = FALSE;
     12  if ((N = get_argument (argc, argv, "-v"))) {
     13    remove_argument (N, &argc, argv);
     14    VERBOSE = TRUE;
     15  }
     16
    1117  int JustHead = FALSE;
    1218  if ((N = get_argument (argc, argv, "-head"))) {
     
    9197      return (FALSE);
    9298    }
    93     if (gfits_extension_is_compressed (&buf[0].header)) {
     99    if (gfits_extension_is_compressed_image (&buf[0].header)) {
    94100        IsCompressed = TRUE;
    95101    }
     
    124130      Nword = 1;
    125131      IsCompressed = FALSE;
    126       if (gfits_extension_is_compressed (&buf[0].header)) {
     132      if (gfits_extension_is_compressed_image (&buf[0].header)) {
    127133        if (!strcmp (CCDKeyword, "EXTNAME")) Nword = 1;
    128134        IsCompressed = TRUE;
     
    198204    ftable.header[0].buffer = NULL;
    199205    gfits_copy_header (&buf[0].header, ftable.header);
    200     status = gfits_fread_ftable_data (f, &ftable, FALSE);  // this just reads the bytes (not even a SWAP)
    201     status = gfits_uncompress_image (&buf[0].header, &buf[0].matrix, &ftable);
     206
     207    if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { gprint (GP_ERR, "problem reading compressed image table data\n"); fclose (f); return FALSE; }
     208    if (!gfits_byteswap_varlength_column (&ftable, 1)) { gprint (GP_ERR, "problem doing byteswap on compressed image metadata column\n"); fclose (f); gfits_free_table (&ftable); return FALSE; }
     209    if (!gfits_uncompress_image (&buf[0].header, &buf[0].matrix, &ftable)) { gprint (GP_ERR, "problem uncompressing the image data\n"); fclose (f); gfits_free_table (&ftable); return FALSE; }
     210
    202211    // uncompressing the image leaves the format as an extension
    203212    gfits_extended_to_primary (&buf[0].header, TRUE, "Standard FITS");
    204213    gfits_free_table (&ftable);
     214
     215    status = TRUE;
    205216    // XXX this currently does not work for a cube (we get a cube back, not a specific plane)
    206217  } else {
     
    239250  buf[0].unsign = buf[0].header.unsign;
    240251
    241   gprint (GP_LOG, "read "OFF_T_FMT" bytes from %s into buffer %s\n",
    242            buf[0].header.datasize + buf[0].matrix.datasize, argv[2], argv[1]);
     252  if (VERBOSE) gprint (GP_LOG, "read "OFF_T_FMT" bytes from %s into buffer %s\n", buf[0].header.datasize + buf[0].matrix.datasize, argv[2], argv[1]);
    243253
    244254  blank = 0xffff;
Note: See TracChangeset for help on using the changeset viewer.