IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2021, 3:37:52 PM (5 years ago)
Author:
eugene
Message:

clarify in comments the buffers and pixel sizes used in the different stages of compression/uncompression; catch unimplemented compression cases; fix error in pixel size for RICE1; cleanup verbose code; use correct sscanf format code in ASCII table reading code

Location:
trunk/Ohana/src/libfits/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/test/compress.sh

    r38425 r41474  
    11input tap.dvo
     2
     3## NOTE: in order to run this test suite, you must have a modern version of fpack / funpack.
     4## The IPP version included in the build tree (3100-p5) does not have support for gzip2 in fpack.
     5
     6## Acceptable versions can be obtained by downloading a current copy
     7## of CFITSIO (https://heasarc.gsfc.nasa.gov/fitsio/).
     8
     9## To avoid installing the library or funpack/fpack in your psconfig
     10## tree, only build the code locally and do NOT install. 
     11
     12## in the cfitsio directory, edit the Makefile with the following changes:
     13
     14## LDFLAGS_BIN =        -g -O2 -Wl,-rpath,${CFITSIO_LIB} -static
     15## CFLAGS =     -g -Dg77Fortran -fPIC
     16## (comment out the old versions)
     17
     18## run psconfigure, make, make fpack funpack
     19
     20## after building these (static) binaries, link them into this test directory
    221
    322macro tests
     
    524  test_table_all_rnd
    625end
     26
     27$FPACK = ./fpack
     28$FUNPACK = ./funpack
    729
    830macro test_image_all
     
    5375
    5476 if ($cmpmode == GZIP_1)
    55    exec fpack -q 0 -g -S test.raw.fits > test.fpk.fits
     77   ## mana does not (yet) handle non-zero quantization
     78   exec $FPACK -q 0 -g -S test.raw.fits > test.fpk.fits
    5679 end
    5780 if ($cmpmode == GZIP_2)
    58    exec fpack -q 0 -g2 -S test.raw.fits > test.fpk.fits
     81   exec $FPACK -q 0 -g2 -S test.raw.fits > test.fpk.fits
    5982 end
    6083 if ($cmpmode == RICE_1)
    61    exec fpack -r -S test.raw.fits > test.fpk.fits
     84   exec $FPACK -r -S test.raw.fits > test.fpk.fits
    6285 end
    6386 # echo "load fpack version"
     
    6891 tapOK {$SIGMA      < 0.001} "read fpack $cmpmode $bitpix (SIGMA = $SIGMA)"
    6992
    70  if ($cmpmode == RICE_1_0)
    71    echo "*** funpack fails on RICE_1 ****"
    72    return
    73  end
     93 # if ($cmpmode == RICE_1_0)
     94 #   echo "*** funpack fails on RICE_1 ****"
     95 #   return
     96 # end
    7497
    7598 # echo "run funpack on our version"
    76  exec funpack -S test.cmp.fits > test.fun.fits
     99 exec $FUNPACK -S test.cmp.fits > test.fun.fits
    77100 rd e test.fun.fits
    78101 set d = x - e
     
    213236 if (1)
    214237   tapEXEC /bin/cp -f test.raw.tbl test.fpk.tbl
    215    tapEXEC fpack -table -F test.fpk.tbl
     238   tapEXEC $FPACK -table -F test.fpk.tbl
    216239   
    217240   data test.fpk.tbl
     
    236259 # try to run fpack on ours
    237260 tapEXEC /bin/cp -f test.cmp.tbl test.fun.tbl
    238  tapEXEC funpack -F test.fun.tbl
     261 tapEXEC $FUNPACK -F test.fun.tbl
    239262
    240263 data test.fun.tbl
     
    403426 if (1)
    404427   tapEXEC /bin/cp -f test.raw.tbl test.fpk.tbl
    405    tapEXEC fpack -table -F test.fpk.tbl
     428   tapEXEC $FPACK -table -F test.fpk.tbl
    406429   
    407430   data test.fpk.tbl
     
    431454 # try to run fpack on ours
    432455 tapEXEC /bin/cp -f test.cmp.tbl test.fun.tbl
    433  tapEXEC funpack -F test.fun.tbl
     456 tapEXEC $FUNPACK -F test.fun.tbl
    434457
    435458 data test.fun.tbl
  • trunk/Ohana/src/libfits/test/imagecomp.c

    r39457 r41474  
    33# include "tap_ohana.h"
    44
     5# define MEM_VERBOSE FALSE
     6
    57int test_compress (int bitpix, char *zcmptype);
    68int test_compress_fullrange (int bitpix, char *zcmptype);
    79int test_compress_fulltile (int bitpix, char *zcmptype);
    810
    9 // char *cmptype[] = {"NONE", "NONE_2", "GZIP_1", "GZIP_2", "PLIO_1", "RICE_1", "RICE_ONE", "HCOMPRESS_1", NULL};
     11// XXX FULL SET : char *cmptype[] = {"NONE", "NONE_2", "GZIP_1", "GZIP_2", "PLIO_1", "RICE_1", "RICE_ONE", "HCOMPRESS_1", NULL};
    1012char *cmptype[] = {"NONE", "NONE_1", "NONE_2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", NULL};
     13// XXX NOT WORKING: char *cmptype[] = {"HCOMPRESS_1", NULL};
    1114int bitpix[] = {8, 16, 32, -32, -64, 0};
    1215
     
    3134      test_compress_fulltile (bitpix[j], cmptype[i]);
    3235      test_compress_fullrange (bitpix[j], cmptype[i]);
    33       ok (ohana_memcheck (TRUE), "no memory corruption");
     36      ok (ohana_memcheck (MEM_VERBOSE), "no memory corruption");
    3437    }
    3538  }
     
    4346      test_compress_fulltile (bitpix[j], cmptype[i]);
    4447      test_compress_fullrange (bitpix[j], cmptype[i]);
    45       ok (ohana_memcheck (TRUE), "no memory corruption");
     48      ok (ohana_memcheck (MEM_VERBOSE), "no memory corruption");
    4649    }
    4750  }
     
    5558      test_compress_fulltile (bitpix[j], cmptype[i]);
    5659      test_compress_fullrange (bitpix[j], cmptype[i]);
    57       ok (ohana_memcheck (TRUE), "no memory corruption");
     60      ok (ohana_memcheck (MEM_VERBOSE), "no memory corruption");
    5861    }
    5962  }
     
    138141  }     
    139142 
     143  // diag ("--- Image has a total of %d pixels of which %d are bad ---", NX*NY, Nbad);
    140144  ok (!Nbad, "all image pixels match");
    141145
Note: See TracChangeset for help on using the changeset viewer.