Changeset 42114 for trunk/ippTests
- Timestamp:
- Mar 16, 2022, 3:28:13 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/ippTests/ippCheck/cammask.pro (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTests/ippCheck/cammask.pro
r42031 r42114 52 52 $smfreal = `neb-locate -p $smffile` 53 53 54 # sets the list chipName:0 - chipName:n based on chipRun 54 55 get.chip.metadata $dbname $chipID 56 57 # set the list camMask:0 - camMask:n based on nebulous listing 58 # some cam-stage masks may be missing, these are set to NONE 59 # the number of entries in both lists is the same (chipName:n) 55 60 get.chip.mask.files $camPath 56 61 62 # read in the PHU header 63 rd PHU $smfreal 64 65 # set the list chipNseq:0 - chipNseq:n based on smf entries. 66 # Some chips may be missing from the smf, these are set to -1 67 # $chipNseq:n = $chipName:n 68 get.chip.smf.Nseq $smfreal 69 57 70 for i 0 $camMask:n 58 echo $chipName:$i $c amMask:$i71 echo $chipName:$i $chipNseq:$i $camMask:$i 59 72 end 60 73 … … 71 84 set Nref = ramp(Rref) 72 85 73 # read in the PHU header 74 rd PHU $smfreal 75 76 # create the chipName list from the smffile and calculate the index numbers. 77 # NOTE: if a chip is missing from the smf, this may be inconsistent with chipMask:n 78 # XXX for now, we fail is this happens 79 list chipsRaw -x "ftable -list $smfreal | grep -n hdr | prcol 1 | sed s/.hdr//" 80 for i 0 $chipsRaw:n 81 list word -splitbychar : $chipsRaw:$i 82 $chipNseq:$i = $word:0 - 3; # this number depends on the number of leading tables 83 if ("$chipName:$i" != "$word:1") 84 echo "ERROR: missing chip from smffile: " $chipName:$i 85 break 86 end 87 end 88 89 # delete any existing output vectors 90 foreach field $SMF_FIELDS_CAM $REF_FIELDS_CAM $XTR_FIELDS_CAM 91 delete -q $field\_out 92 end 86 # delete any existing output vectors 87 foreach field $SMF_FIELDS_CAM $REF_FIELDS_CAM $XTR_FIELDS_CAM 88 delete -q $field\_out 89 end 93 90 94 91 # find matching entries in smf file 95 92 for i 0 $chipName:n 93 ## echo $chipName:$i $chipNseq:$i $camMask:$i 94 95 if ($chipNseq:$i < 0) continue 96 96 97 get.chip.detect.stats $chipName:$i $chipNseq:$i 97 get.chip.mask.stats $camMask:$i 98 99 if ("$camMask:$i" == "NONE") 100 # if the mask files are missing, all are masked or unmasked? 101 set Q1ref_onchp = zero(Xref_onchp) + 1.0 102 else 103 get.chip.mask.stats $camMask:$i 104 end 98 105 99 106 foreach field $SMF_FIELDS_CAM … … 241 248 242 249 # get the full list from nebulous (faster than getting each one at a time) 243 list tmpName -x "neb-ls $pathbase.%.mk.fits"250 list tmpName -x "neb-ls -c $pathbase.%.mk.fits" 244 251 245 252 # the list of masks might not match the list of chips 253 # mark missing cam-stage masks with NONE 246 254 $j = 0 255 echo "chipName:n $chipName:n" 247 256 for i 0 $chipName:n 257 # if we get to the end of the list, assign the missing entries to NONE 258 if ($j >= $tmpName:n) 259 $camMask:$i = NONE 260 continue 261 end 248 262 list word -splitbychar . $tmpName:$j 249 263 $Nch = $word:n - 3 … … 254 268 end 255 269 $camMask:$i = $tmpName:$j 256 if ($VERBOSE) echo "found chipMask $camMask:$i "270 if ($VERBOSE) echo "found chipMask $camMask:$i ($chipName:$i) : $i $j $chipName:n $tmpName:n" 257 271 if ($COPYMASKS) exec neb-copy $camMask:$i $OUTDIR 258 272 $j ++ 259 273 end 260 274 $camMask:n = $chipName:n 275 end 276 277 # get the file names of the chip mask files. 278 # these are actually the masks from the camera stage which 279 # has the dynamic masking applied 280 macro get.chip.smf.Nseq 281 if ($0 != 2) 282 echo "USAGE: get.camera.smf.Nseq (smffile)" 283 echo " sets chipNseq:0 - chipNseq:n" 284 break 285 end 286 287 local i j smffile 288 $smffile = $1 289 290 # identify the chips in the smffile and calculate the index numbers. 291 # NOTE: if a chip is missing from the smf, set Nseq to -1 292 list chipsRaw -x "ftable -list $smfreal | grep -n hdr | prcol 1 | sed s/.hdr//" 293 294 $j = 0 295 for i 0 $chipName:n 296 # if we get to the end of the list, assign the missing entries to NONE 297 if ($j >= $chipsRaw:n) 298 $chipNseq:$i = -1 299 continue 300 end 301 list word -splitbychar : $chipsRaw:$j 302 $myNseq = $word:0 - 3; # this number depends on the number of leading tables 303 $mychip = $word:1 304 if ($mychip != $chipName:$i) 305 $chipNseq:$i = -1 306 continue 307 end 308 $chipNseq:$i = $myNseq 309 if ($VERBOSE) echo "found chip entry $chipNseq:$i ($chipName:$i) : $i $j $chipName:n $chipsRaw:n" 310 $j ++ 311 end 312 $chipNseq:n = $chipName:n 261 313 end 262 314
Note:
See TracChangeset
for help on using the changeset viewer.
