Changeset 38339
- Timestamp:
- May 30, 2015, 1:49:15 PM (11 years ago)
- Location:
- branches/eam_branches/ohana.20150429/src/libfits
- Files:
-
- 4 edited
-
extern/gzip.c (modified) (1 diff)
-
matrix/F_compress_utils.c (modified) (1 diff)
-
matrix/F_uncompress_M.c (modified) (3 diffs)
-
test/compress.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/extern/gzip.c
r38334 r38339 200 200 } 201 201 202 // the '5' is the compression level: make this a user argument 203 err = deflateInit(&stream, 5); 202 // the '1' is the compression level: make this a user argument 203 // NOTE: cfitsio uses a fixed value of 1 204 err = deflateInit(&stream, 1); 204 205 if (0) fprintf (stderr, "inp buffers cmp 0: %d => %d => %d\n", stream.avail_in, stream.avail_out, (int) stream.total_out); 205 206 -
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_compress_utils.c
r38329 r38339 166 166 int i, Nbyte; 167 167 168 if (!strcasecmp(cmptype, "GZIP_1") ) {168 if (!strcasecmp(cmptype, "GZIP_1") || !strcasecmp(cmptype, "NONE")) { 169 169 if (out_bitpix == 8) return (1); 170 170 if (out_bitpix == 16) return (2); -
branches/eam_branches/ohana.20150429/src/libfits/matrix/F_uncompress_M.c
r38334 r38339 261 261 262 262 zdata = gfits_varlength_column_pointer (ftable, &zdef, row, &Nzdata); 263 if (!zdata) return (FALSE);263 if (!zdata) ESCAPE; 264 264 265 265 // XXX not certain this is the correct place to do the swap (or if zdata_pixsize is … … 267 267 268 268 if (strcasecmp(cmptype, "GZIP_1")) { 269 if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) return (FALSE);269 if (!gfits_byteswap_zdata (zdata, Nzdata, zdata_pixsize)) ESCAPE; 270 270 } 271 271 272 272 // gfits_uncompress_data uncompresses from zdata to the temporary output buffer which must be allocated 273 273 // XXX the tile must not be > 2GB 274 if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, odata_pixsize)) return (FALSE);274 if (!gfits_uncompress_data ((char *)zdata, Nzdata, cmptype, optname, optvalue, Noptions, out, &Nout, odata_pixsize)) ESCAPE; 275 275 276 276 // copy the uncompressed pixels into their correct locations 277 if (!gfits_distribute_data (matrix, odata_pixsize, out, Nout, otile, oblank, ztile, zblank, zscale, zzero)) return (FALSE);277 if (!gfits_distribute_data (matrix, odata_pixsize, out, Nout, otile, oblank, ztile, zblank, zscale, zzero)) ESCAPE; 278 278 279 279 // update the tile counters, carrying to the next dimension if needed … … 287 287 } 288 288 } 289 290 FREE (ztile); 291 if (optname != NULL) { 292 for (j = 0; j < Noptions; j++) { 293 FREE (optname[j]); 294 FREE (optvalue[j]); 295 } 296 FREE (optname); 297 FREE (optvalue); 298 } 299 FREE (out); 300 FREE (otile); 301 FREE (ntile); 289 302 return (TRUE); 290 303 } -
branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh
r38329 r38339 1 1 2 macro go2 macro test1 3 3 mcreate z 500 500 4 4 set x = xramp(z) … … 8 8 set d = x - b 9 9 stat d 10 exec fpack -g -S test.raw.fits > test.fpk.fits 10 11 exec funpack -S test.cmp.fits > test.fun.fits 11 12 end 12 13 13 macro ttest 14 macro test2 15 mcreate z 500 500 16 set x = xramp(z) 17 wd x test.raw.fits -bitpix -32 -bzero 0 -bscale 1 18 wd x test.cmp.fits -bitpix -32 -bzero 0 -bscale 1 -compress -compress-mode NONE 19 rd b test.cmp.fits -x 0 20 set d = x - b 21 stat d 22 # exec funpack -S test.cmp.fits > test.fun.fits 23 end 24 25 macro test3 14 26 15 27 create x 0 100
Note:
See TracChangeset
for help on using the changeset viewer.
