Changeset 42848 for trunk/tools
- Timestamp:
- May 9, 2025, 2:04:40 PM (12 months ago)
- Location:
- trunk/tools/eam/rawfix.20230221/src
- Files:
-
- 4 edited
-
check.rawfix.sh (modified) (1 diff)
-
ipp_apply_burntool_psvideo.pl (modified) (9 diffs)
-
rawfix.burntool.pt (modified) (4 diffs)
-
rawfix.fixchip.pt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/check.rawfix.sh
r42459 r42848 75 75 if ($mystate == "burntool.new") goto good_state 76 76 if ($mystate == "burntool.done") goto good_state 77 if ($mystate == "burntool.redo") goto good_state 77 78 if ($mystate == "burntool.fail") goto good_state 78 79 -
trunk/tools/eam/rawfix.20230221/src/ipp_apply_burntool_psvideo.pl
r42648 r42848 4 4 # for all exposures for a given time period. 5 5 # USAGE: ipp_apply_burntool.pl --dbname gpc1 --class_id XY00 --dateobs_begin YYYY/MM/DD --dateobs_end YYYY/MM/DD 6 # OPTION: --check-status : scan the exposures/chips and report if the desired burntool file exists 6 7 7 8 use warnings; … … 22 23 print "Starting script $0 on $host at $date\n\n"; 23 24 24 my ( $class_id, $dateobs_begin, $dateobs_end, $convert, $dbname, $logfile, $ verbose, $save_temps, $rerun, $psvidOutput);25 my ( $class_id, $dateobs_begin, $dateobs_end, $convert, $dbname, $logfile, $check_status, $verbose, $save_temps, $rerun, $psvidOutput); 25 26 GetOptions( 26 27 'class_id=s' => \$class_id, # chip identifier … … 28 29 'dateobs_end=s' => \$dateobs_end, # exposure date/time range stop 29 30 'dbname|d=s' => \$dbname, # Database name 30 'psvidOutput |d=s'=> \$psvidOutput, # output base for psvideo data31 'psvidOutput=s' => \$psvidOutput, # output base for psvideo data 31 32 'logfile=s' => \$logfile, 32 33 'rerun' => \$rerun, 34 'check-status' => \$check_status, 33 35 'verbose' => \$verbose, # Print to stdout 34 36 'save-temps' => \$save_temps, # Save temporary files? 35 36 37 ) or pod2usage( 2 ); 37 38 … … 74 75 my $burntoolStateGood = 15; 75 76 if (0) { 77 # XXX note: I am disabling this automatic check of the burntool value 78 # and hard-wiring 15 76 79 # Determine the value of a "good" burntool run. 77 80 # XXX this program should always generate the latest version … … 154 157 my $state = $file->{burntool_state}; 155 158 159 my $exp_name = $file->{exp_name}; 160 if ($exp_name =~ /a$/) { 161 print "STRK: skipping $exp_name, streak exposure\n"; 162 next; 163 } 164 156 165 my $rawImfile = $file->{uri}; 157 166 my $rawImfileReal = $ipprc->file_resolve($rawImfile, 0); … … 161 170 } 162 171 172 if ($rawImfileReal =~ /fits.fz$/) { 173 print "COMP: skipping $exp_name, lossy-compressed data\n"; 174 next; 175 } 176 163 177 my $outTable = $file->{uri}; 164 178 165 179 my $data_state = $file->{data_state}; 166 180 if ($data_state eq "lossy") { 167 print " ##skipping $rawImfile : data_state $data_state\n";168 next; 169 } 170 171 if ($burntoolStateGood == 15) {181 print "SKIP: skipping $rawImfile : data_state $data_state\n"; 182 next; 183 } 184 185 if ($burntoolStateGood == 15) { 172 186 $outTable =~ s/fits$/burn.v15.tbl/; 173 187 } else { 174 $outTable =~ s/fits$/burn.tbl/; 175 } 188 # $outTable =~ s/fits$/burn.tbl/; 189 die "invalid burntoolStateGood $burntoolStateGood\n"; 190 } 191 192 if ($check_status) { 193 my $outTableReal = $ipprc->file_resolve($outTable, 0); 194 if (defined $outTableReal and ($state == $outState)) { 195 print "GOOD: $outTableReal for $exp_id, $class_id, $state\n"; 196 } else { 197 if (defined $outTableReal) { 198 print "FAIL: $outTableReal for $exp_id, $class_id, $state\n"; 199 } else { 200 print "MISS: $rawImfile for $exp_id, $class_id, $state\n"; 201 } 202 } 203 next; 204 } 205 176 206 my $outTableReal = $ipprc->file_resolve($outTable, 1); 177 207 … … 222 252 $status = vsystem ("$funpack -S $rawImfileReal > $tempPixels", $REALRUN); 223 253 if ($status) { 224 print "FAIL: funpack fails for $rawImfile\n"; 225 &my_die("failed on funpack",$exp_id,$class_id); 254 255 ## funpack can fail in two specific ways that might be recoverable: 256 ## 1) the file is corrupt (bad MD5SUM) 257 ## 2) the file is missing 258 259 ## in either case, IFF a file exists in the other location with the right MD5SUM, we can use it instead 260 261 my $nebInstances = $ipprc->find_instances($rawImfile) or my_die("error with find_instance"); 262 my $md5tru = $file->{md5sum}; 263 my $isBad = 1; 264 my $goodInstance = "NONE"; 265 266 foreach my $uri (@$nebInstances) { 267 # strip the leading file:// 268 $uri =~ s|file://||; 269 270 # get the md5sum 271 if (-e $uri) { 272 my $fh; 273 open($fh,$uri); 274 my $md5sum = Digest::MD5->new->addfile($fh)->hexdigest; 275 close ($fh); 276 if ($md5sum eq $md5tru) { 277 print "uri: $uri $md5sum eq $md5tru\n"; 278 $status = vsystem ("$funpack -S $uri > $tempPixels", $REALRUN); 279 if ($status) { 280 print "FALT: funpack failed for $rawImfile and $uri\n"; 281 &my_die("failed on funpack",$exp_id,$class_id); 282 } else { 283 $isBad = 0; 284 $goodInstance = $uri; 285 } 286 } else { 287 print "MDBD: $uri $md5sum vs $md5tru\n"; 288 } 289 } else { 290 print "GONE: $uri NOTFOUND\n"; 291 } 292 } 293 294 if ($isBad) { 295 print "FAIL: funpack failed for $rawImfile, not recovered\n"; 296 &my_die("failed on funpack",$exp_id,$class_id); 297 } else { 298 print "FIXT: funpack failed for $rawImfile on $rawImfileReal but recovered $goodInstance\n"; 299 } 226 300 } 227 301 … … 261 335 262 336 print "\n"; 337 } else { 338 print "DONE: skipping $rawImfile : btState $state vs $burntoolStateGood : data_state $data_state\n"; 263 339 } 264 340 … … 275 351 } 276 352 353 print STDERR "exit SUCCESS\n"; 277 354 exit 0; 278 355 -
trunk/tools/eam/rawfix.20230221/src/rawfix.burntool.pt
r42720 r42848 82 82 # save the page so we can use it below 83 83 84 substr $DATEOBS 0 4 YEAR 85 84 86 # write an entry point in the log for this night 85 sprintf tmpline "%s/%s/ log.burntool.runhosts.v%d" $mypath$DATEOBS $ITER87 sprintf tmpline "%s/%s/%s/log.burntool.runhosts.v%d" $mypath $YEAR $DATEOBS $ITER 86 88 date -var mydate 87 exec echo " # start runhosts $mydate" >> $tmpline89 exec echo "\\# start runhosts $mydate" >> $tmpline 88 90 89 91 # get_hosts_fixchip.sh selects the most used machine at ITC … … 180 182 # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs 181 183 periods -exec 0.05 182 command ipp_apply_burntool_psvideo.pl --dateobs_begin $STARTDATE --dateobs_end $ENDDATE --class_id $CHIP_ID --dbname gpc1 --psvidOutput $psvidOutput 184 command ipp_apply_burntool_psvideo.pl --rerun --dateobs_begin $STARTDATE --dateobs_end $ENDDATE --class_id $CHIP_ID --dbname gpc1 --psvidOutput $psvidOutput 185 ## NOTE the rerun option is set here 183 186 end 184 187 … … 270 273 ######################### UTILITIES ################################# 271 274 275 macro burntool.loadhosts.state 276 if ($0 != 2) 277 echo "USAGE: burntool.loadhosts.state (state)" 278 break 279 end 280 281 task nights.burntool.loadhosts 282 active $1 283 end 284 end 285 286 macro burntool.clean.state 287 if ($0 != 2) 288 echo "USAGE: burntool.clean.state (state)" 289 break 290 end 291 292 task nights.burntool.clean 293 active $1 294 end 295 end 296 297 macro burntool.run.state 298 if ($0 != 2) 299 echo "USAGE: burntool.run.state (state)" 300 break 301 end 302 303 task nights.burntool.run 304 active $1 305 end 306 end 307 272 308 macro nights.burntool.exit 273 309 if ($0 != 2) … … 279 315 book getword burntool.book $options:1 NHOST -var Nhosts 280 316 book getword burntool.book $options:1 NDONE -var Ndone 281 book getword burntool.book $options:1 stage-var ITER317 book getword burntool.book $options:1 iter -var ITER 282 318 $Ndone ++ 283 319 book setword burntool.book $options:1 NDONE $Ndone -
trunk/tools/eam/rawfix.20230221/src/rawfix.fixchip.pt
r42464 r42848 91 91 sprintf tmpline "%s/%s/%s/log.fixchip.runhosts.v%d" $mypath $YEAR $DATEOBS $ITER 92 92 date -var mydate 93 exec echo " # start runhosts $mydate" >> $tmpline93 exec echo "\\# start runhosts $mydate" >> $tmpline 94 94 95 95 # the command returns these fields: dateobs stage fixhost chipID
Note:
See TracChangeset
for help on using the changeset viewer.
