- Timestamp:
- Jun 4, 2015, 5:42:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/test/compress.sh
r38363 r38366 5 5 tapPLAN 88 6 6 7 foreach mode NONE GZIP_1 GZIP_2 RICE_1 7 foreach mode NONE GZIP_1 GZIP_2 RICE_1 RICE_ONE 8 8 # foreach mode GZIP_1 9 9 # foreach mode GZIP_2 … … 11 11 foreach bitpix 8 16 32 -32 -64 12 12 # foreach bitpix 32 13 if (($mode == RICE_1) && ($bitpix < 0)) continue ; # RICE_1 is for int only 13 if (($mode == RICE_1) && ($bitpix < 0)) continue ; # RICE_1 is for int only 14 if (($mode == RICE_ONE) && ($bitpix < 0)) continue ; # RICE_1 is for int only 14 15 tapDIAG 2 "===== bitpix = $bitpix, mode = $mode =====" 15 16 test_image_single $bitpix $mode … … 29 30 $bitpix = $1 30 31 $cmpmode = $2 32 33 delete -q x z b c d e 31 34 32 35 mcreate z 8 8 … … 121 124 macro test_table_all_single_column 122 125 126 tapPLAN 88 127 123 128 local format cmpmode 124 129 125 foreach cmpmode NONE GZIP_1 130 foreach cmpmode NONE GZIP_1 GZIP_2 RICE_1 RICE_ONE 126 131 foreach format B I J K E D 132 if (($cmpmode == RICE_1) && ($format == E)) continue ; # RICE_1 is for int only 133 if (($cmpmode == RICE_ONE) && ($format == E)) continue ; # RICE_1 is for int only 134 if (($cmpmode == RICE_1) && ($format == D)) continue ; # RICE_1 is for int only 135 if (($cmpmode == RICE_ONE) && ($format == D)) continue ; # RICE_1 is for int only 136 if (($cmpmode == RICE_1) && ($format == K)) continue ; # RICE_1 is for int only 137 if (($cmpmode == RICE_ONE) && ($format == K)) continue ; # RICE_1 is for int only 127 138 test_table_single_column $cmpmode $format 128 139 end 129 140 end 141 tapDONE 130 142 end 131 143 … … 136 148 end 137 149 138 local cmpmode 150 local cmpmode format 139 151 $cmpmode = $1 140 141 delete -q x 142 143 $NPT = 1000 144 create x 0 $NPT 145 146 local format 152 $format = $2 153 154 tapDIAG 2 "===== testing $cmpmode $format =====" 155 156 delete -q x dv 157 158 $NPT = 10000 159 160 if ($format == B) 161 create x -128 128 162 else 163 create x 0 $NPT 164 end 147 165 148 166 $fields = x 149 $format = $2150 167 151 168 write -fits test test.raw.tbl $fields -format $format … … 157 174 end 158 175 159 echo"===== $cmpmode $format raw ====="176 tapDIAG 2 "===== $cmpmode $format raw =====" 160 177 data test.raw.tbl 161 178 read -fits test $fields … … 163 180 foreach f $fields 164 181 set dv = $f - $f\_raw 165 vstat dv 166 end 167 delete -q $fields 168 169 echo "===== $cmpmode $format cmp =====" 182 vstat -q dv 183 tapOK {abs($MEAN) < 0.001} "read our raw $cmpmode $format (MEAN = $MEAN)" 184 tapOK {$SIGMA < 0.001} "read our raw $cmpmode $format (SIGMA = $SIGMA)" 185 end 186 delete -q $fields 187 188 tapDIAG 2 "===== $cmpmode $format cmp =====" 170 189 data test.cmp.tbl 171 190 read -fits test $fields … … 173 192 foreach f $fields 174 193 set dv = $f - $f\_raw 175 vstat dv 176 end 194 vstat -q dv 195 tapOK {abs($MEAN) < 0.001} "read our cmp $cmpmode $format (MEAN = $MEAN)" 196 tapOK {$SIGMA < 0.001} "read our cmp $cmpmode $format (SIGMA = $SIGMA)" 197 end 198 199 if ($cmpmode == NONE) return; # funpack will not recognize NONE 200 if ($cmpmode == RICE_ONE) return; # funpack will not recognize RICE_ONE for tables 201 if (($cmpmode == GZIP_2) && ($format == B)) return; # GZIP_2 invalid for B 202 203 tapDIAG 2 "===== $cmpmode $format fpack =====" 204 205 # try to run fpack on ours 206 if (1) 207 tapEXEC /bin/cp -f test.raw.tbl test.fpk.tbl 208 tapEXEC fpack -table -F test.fpk.tbl 209 210 data test.fpk.tbl 211 read -fits test $fields 212 213 foreach f $fields 214 set dv = $f - $f\_raw 215 vstat -q dv 216 tapOK {abs($MEAN) < 0.001} "read fpack $cmpmode $format (MEAN = $MEAN)" 217 tapOK {$SIGMA < 0.001} "read fpack $cmpmode $format (SIGMA = $SIGMA)" 218 end 219 delete -q $fields 220 end 221 222 break -auto off 223 echo $cmpmode $format 224 exec ls test.cmp.tbl test.fpk.tbl | fields -x 0 PCOUNT ZCTYP1 225 break -auto on 226 227 tapDIAG 2 "===== $cmpmode $format funpack =====" 228 229 # try to run fpack on ours 230 tapEXEC /bin/cp -f test.cmp.tbl test.fun.tbl 231 tapEXEC funpack -F test.fun.tbl 232 233 data test.fun.tbl 234 read -fits test $fields 235 236 foreach f $fields 237 set dv = $f - $f\_raw 238 vstat -q dv 239 tapOK {abs($MEAN) < 0.001} "read funpack $cmpmode $format (MEAN = $MEAN)" 240 tapOK {$SIGMA < 0.001} "read funpack $cmpmode $format (SIGMA = $SIGMA)" 241 end 242 delete -q $fields 177 243 end 178 244 … … 199 265 delete -q x y z 200 266 201 $NPT = 1000 267 $NPT = 10000 202 268 create x 0 $NPT 203 269 set y = x^2
Note:
See TracChangeset
for help on using the changeset viewer.
