IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 3, 2015, 7:00:55 AM (11 years ago)
Author:
eugene
Message:

get the input / output / compressed pixels sizes right and get the byteswaps right

Location:
branches/eam_branches/ohana.20150429/src/libfits/test
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh

    r38343 r38356  
    22macro test_image_all
    33
    4   foreach mode NONE GZIP_1
     4  foreach mode NONE GZIP_1 RICE_1
    55    foreach bitpix 8 16 32 -32 -64
    66      echo ===== bitpix = $bitpix =====
     
    4040 end
    4141
     42 if ($cmpmode == RICE_1)
     43   echo "*** funpack fails on RICE_1 ****"
     44   return
     45 end
     46
    4247 if ($bitpix == -64)
    4348   echo "*** bitpix $bitpix fails fpack / funpack ***"
    4449 else
     50   echo "run funpack on our version"
    4551   exec funpack -S test.cmp.fits > test.fun.fits
    4652   rd e test.fun.fits
  • branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c

    r38340 r38356  
    44
    55int test_compress (int bitpix, char *zcmptype);
     6
     7// char *cmptype[] = {"NONE", "GZIP_1", "GZIP_2", "PLIO_1", "RICE_1", "RICE_ONE", "HCOMPRESS_1", NULL};
     8char *cmptype[] = {"NONE", "GZIP_1", "RICE_1", "RICE_ONE", NULL};
     9int bitpix[] = {8, 16, 32, -32, -64, 0};
     10
     11// char *cmptype[] = {"NONE", "GZIP_1", NULL};
     12// char *cmptype[] = {"PLIO_1", NULL};
     13// int bitpix[] = {8, 16, 32, 0};
     14
     15// char *cmptype[] = {"RICE_1", NULL};
     16// int bitpix[] = {-32, -64, 0};
    617
    718int main (int argc, char **argv) {
     
    1122  diag ("libfits imagecomp.c tests");
    1223
    13   test_compress (  8, "NONE");
    14   test_compress ( 16, "NONE");
    15   test_compress ( 32, "NONE");
    16   test_compress (-32, "NONE");
    17   test_compress (-64, "NONE");
     24  int i, j;
     25  for (i = 0; cmptype[i]; i++) {
     26    for (j = 0; bitpix[j]; j++) {
     27      test_compress (bitpix[j], cmptype[i]);
     28    }
     29  }
    1830
    19   test_compress (  8, "GZIP_1");
    20   test_compress ( 16, "GZIP_1");
    21   test_compress ( 32, "GZIP_1");
    22   test_compress (-32, "GZIP_1");
    23   test_compress (-64, "GZIP_1");
     31  // test_compress ( 16, "NONE");
     32  // test_compress ( 32, "NONE");
     33  // test_compress (-32, "NONE");
     34  // test_compress (-64, "NONE");
     35  //
     36  // test_compress (  8, "GZIP_1");
     37  // test_compress ( 16, "GZIP_1");
     38  // test_compress ( 32, "GZIP_1");
     39  // test_compress (-32, "GZIP_1");
     40  // test_compress (-64, "GZIP_1");
    2441
    2542  exit (0);
     
    2744
    2845# define NX 100
    29 # define NY 100
     46# define NY 10
    3047
    3148int test_compress (int bitpix, char *zcmptype) { // make a table, compress, uncompress, compare : use compression zcmptype
     
    6582  for (ix = 0; ix < NX; ix++) {
    6683    for (iy = 0; iy < NY; iy++) {
     84      int IY = iy + 1;
    6785      switch (bitpix) {
    68         case   8: rawdata_char  [ix + NX*iy] = ix + iy*iy; break;
    69         case  16: rawdata_short [ix + NX*iy] = ix + iy*iy; break;
    70         case  32: rawdata_int   [ix + NX*iy] = ix + iy*iy; break;
    71         case -32: rawdata_float [ix + NX*iy] = ix + iy*iy; break;
    72         case -64: rawdata_double[ix + NX*iy] = ix + iy*iy; break;
     86        case   8: rawdata_char  [ix + NX*iy] = ix + IY*IY; break;
     87        case  16: rawdata_short [ix + NX*iy] = ix + IY*IY; break;
     88        case  32: rawdata_int   [ix + NX*iy] = ix + IY*IY; break;
     89        case -32: rawdata_float [ix + NX*iy] = ix + IY*IY; break;
     90        case -64: rawdata_double[ix + NX*iy] = ix + IY*IY; break;
    7391        default: myAbort ("bad bitpix value");
    7492      }
Note: See TracChangeset for help on using the changeset viewer.