IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2015, 7:59:48 PM (11 years ago)
Author:
eugene
Message:

more work on compression : cfitsio assumes gzip, not zlib (I have made uncompress general )

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_M.c

    r38329 r38340  
    139139  int tile_pixsize = gfits_uncompressed_data_pixsize (zcmptype, header[0].bitpix, NULL, NULL, 0);
    140140
     141  int Nzdata_alloc = raw_pixsize*max_tile_size + 100;
    141142  ALLOCATE (raw,   char, raw_pixsize*max_tile_size);
    142   ALLOCATE (zdata, char, raw_pixsize*max_tile_size);
     143  ALLOCATE (zdata, char, Nzdata_alloc);
    143144
    144145  // init the otile[] counters
     
    155156    if (!gfits_collect_data (matrix, raw, Nraw, raw_pixsize, otile, oblank, ztile, zblank, zscale, zzero)) ESCAPE(A);
    156157
     158    if (!strcasecmp(zcmptype, "GZIP_1")) {
     159      if (!gfits_byteswap_zdata (raw, Nraw, raw_pixsize)) ESCAPE(A);
     160    }
     161
    157162    // XXX the tile must not be > 2GB
    158163   
    159164    // optname, optvalue = NULL, Noptions = 0
    160165
    161     int Nzdata = raw_pixsize*max_tile_size; // available space, replaced with actual output size on compression
     166    int Nzdata = Nzdata_alloc; // available space, replaced with actual output size on compression
    162167    if (!gfits_compress_data (zdata, &Nzdata, zcmptype, NULL, NULL, 0, raw, Nraw, tile_pixsize)) ESCAPE(A);
    163168
     
    298303        SETUP_INSIZE (int, 4);
    299304        break;
     305      case 8:
     306        SETUP_INSIZE (double, 8);
     307        break;
    300308      default:
    301309        abort();
Note: See TracChangeset for help on using the changeset viewer.