Changeset 38356 for branches/eam_branches/ohana.20150429/src/libfits/test
- Timestamp:
- Jun 3, 2015, 7:00:55 AM (11 years ago)
- Location:
- branches/eam_branches/ohana.20150429/src/libfits/test
- Files:
-
- 1 added
- 2 edited
-
compress.sh (modified) (2 diffs)
-
imagecomp.c (modified) (4 diffs)
-
ricetest.c (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh
r38343 r38356 2 2 macro test_image_all 3 3 4 foreach mode NONE GZIP_1 4 foreach mode NONE GZIP_1 RICE_1 5 5 foreach bitpix 8 16 32 -32 -64 6 6 echo ===== bitpix = $bitpix ===== … … 40 40 end 41 41 42 if ($cmpmode == RICE_1) 43 echo "*** funpack fails on RICE_1 ****" 44 return 45 end 46 42 47 if ($bitpix == -64) 43 48 echo "*** bitpix $bitpix fails fpack / funpack ***" 44 49 else 50 echo "run funpack on our version" 45 51 exec funpack -S test.cmp.fits > test.fun.fits 46 52 rd e test.fun.fits -
branches/eam_branches/ohana.20150429/src/libfits/test/imagecomp.c
r38340 r38356 4 4 5 5 int test_compress (int bitpix, char *zcmptype); 6 7 // char *cmptype[] = {"NONE", "GZIP_1", "GZIP_2", "PLIO_1", "RICE_1", "RICE_ONE", "HCOMPRESS_1", NULL}; 8 char *cmptype[] = {"NONE", "GZIP_1", "RICE_1", "RICE_ONE", NULL}; 9 int 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}; 6 17 7 18 int main (int argc, char **argv) { … … 11 22 diag ("libfits imagecomp.c tests"); 12 23 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 } 18 30 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"); 24 41 25 42 exit (0); … … 27 44 28 45 # define NX 100 29 # define NY 10 046 # define NY 10 30 47 31 48 int test_compress (int bitpix, char *zcmptype) { // make a table, compress, uncompress, compare : use compression zcmptype … … 65 82 for (ix = 0; ix < NX; ix++) { 66 83 for (iy = 0; iy < NY; iy++) { 84 int IY = iy + 1; 67 85 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; 73 91 default: myAbort ("bad bitpix value"); 74 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
