- Timestamp:
- May 30, 2015, 7:59:48 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh
r38339 r38340 1 2 macro testall 3 4 foreach bitpix 8 16 32 -32 -64 5 echo ===== bitpix = $bitpix ===== 6 test1 $bitpix 7 end 8 end 1 9 2 10 macro test1 3 mcreate z 500 500 11 if ($0 != 2) 12 echo "USAGE: test_image (bitpix)" 13 break 14 end 15 16 mcreate z 8 8 4 17 set x = xramp(z) 5 wd x test.raw.fits -bitpix -32-bzero 0 -bscale 16 wd x test.cmp.fits -bitpix -32-bzero 0 -bscale 1 -compress18 wd x test.raw.fits -bitpix $1 -bzero 0 -bscale 1 19 wd x test.cmp.fits -bitpix $1 -bzero 0 -bscale 1 -compress 7 20 rd b test.cmp.fits -x 0 8 21 set d = x - b 9 22 stat d 10 exec fpack -g -S test.raw.fits > test.fpk.fits 11 exec funpack -S test.cmp.fits > test.fun.fits 23 24 if ($bitpix == -64) 25 echo "*** bitpix $bitpix fails fpack / funpack ***" 26 else 27 exec fpack -g -S test.raw.fits > test.fpk.fits 28 echo "load fpack version" 29 rd c test.fpk.fits -x 0 30 set d = x - c 31 stat d 32 end 33 34 if ($bitpix == -64) 35 echo "*** bitpix $bitpix fails fpack / funpack ***" 36 else 37 exec funpack -S test.cmp.fits > test.fun.fits 38 rd e test.fun.fits 39 set d = x - e 40 stat d 41 end 12 42 end 13 43 … … 25 55 macro test3 26 56 57 $NPT = 10 58 create x 0 $NPT 59 set y = x^2 60 create ID 1 {$NPT + 1} -int 61 62 write -fits test test.raw.tbl x y ID 63 write -fits test test.cmp.tbl x y ID -compress-mode NONE 64 65 foreach f x y ID 66 set $f\_raw = $f 67 delete $f 68 end 69 70 echo "===== raw =====" 71 data test.raw.tbl 72 read -fits test x y ID 73 74 foreach f x y ID 75 set dv = $f - $f\_raw 76 vstat dv 77 end 78 delete -q x y ID 79 80 echo "===== cmp =====" 81 data test.cmp.tbl 82 read -fits test x y ID 83 84 foreach f x y ID 85 set dv = $f - $f\_raw 86 vstat dv 87 end 88 end 89 90 macro test4 91 27 92 create x 0 100 28 93 set y = x^2 94 create ID 1 101 -int 29 95 30 create ID 1 101 -int31 96 write -fits test test.raw.tbl x y ID 97 write -fits test test.cmp.tbl x y ID -compress 32 98 33 write -fits test test.cmp.tbl x y ID -compress 99 foreach f x y ID 100 set $f\_raw = $f 101 delete $f 102 end 103 104 echo "===== raw =====" 105 data test.raw.tbl 106 read -fits test x y ID 107 108 foreach f x y ID 109 set dv = $f - $f\_raw 110 vstat dv 111 end 112 delete -q x y ID 113 114 echo "===== cmp =====" 115 data test.cmp.tbl 116 read -fits test x y ID 117 118 foreach f x y ID 119 set dv = $f - $f\_raw 120 vstat dv 121 end 34 122 end
Note:
See TracChangeset
for help on using the changeset viewer.
