Changeset 42394
- Timestamp:
- Feb 14, 2023, 12:59:01 PM (3 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 7 edited
-
chip_imfile.pl (modified) (4 diffs)
-
dist_bundle.pl (modified) (5 diffs)
-
ipp_apply_burntool.pl (modified) (1 diff)
-
ipp_apply_burntool_fix.pl (modified) (2 diffs)
-
ipp_apply_burntool_single.pl (modified) (3 diffs)
-
permcheck.pl (modified) (1 diff)
-
sc_prepare_chip.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/chip_imfile.pl
r40387 r42394 86 86 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR ); 87 87 88 my $burntoolStateGood; 89 my $burntoolStateGoodUpdate; 88 90 my $neb; 89 91 my $scheme = file_scheme($outroot); … … 292 294 293 295 ## Read camera config to get the current good burntool state : 294 ## XXX This is extremely slow. Any better way to do this? 295 ## my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -"; 296 ## ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 297 ## run(command => $camera_config_cmd, verbose => 0); 298 ## unless ($success) { 299 ## $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 300 ## &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 301 ## } 302 ## 303 ## my $camData = $mdcParser->parse(join "", @$stdout_buf) or 304 ## &my_die("Unable to parse ppConfigDump metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 305 306 ## XXX short term hack until we have a C-based parser 307 my $burntoolStateGood = 14; 308 my $burntoolStateGoodUpdate = 13; 309 ## foreach my $camEntry (@$camData) { 310 ## if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD") { 311 ## $burntoolStateGood = $camEntry->{value}; 312 ## } 313 ## if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD.UPDATE") { 314 ## $burntoolStateGoodUpdate = $camEntry->{value}; 315 ## } 316 ## } 296 my $ppConfigDump_cmd = "$ppConfigDump -camera GPC1 -get-key BURNTOOL.STATE.GOOD"; 297 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 298 IPC::Cmd::run(command => $ppConfigDump_cmd, verbose => $verbose); 299 unless ($success) { 300 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 301 warn ("Unable to perform ppConfigDump"); 302 exit($error_code); 303 } 304 305 # This is ugly, but doing a full parse for one entry is a bit wasteful. 306 foreach my $line (split /\n/, (join "", @$stdout_buf)) { 307 if ($line =~ /BURNTOOL.STATE.GOOD/) { 308 $line =~ s/^\s+//; 309 $burntoolStateGood = (split /\s+/, $line)[2]; 310 last; 311 } 312 } 313 314 my $ppConfigDump_cmd = "$ppConfigDump -camera GPC1 -get-key BURNTOOL.STATE.GOOD.UPDATE"; 315 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 316 IPC::Cmd::run(command => $ppConfigDump_cmd, verbose => $verbose); 317 unless ($success) { 318 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 319 warn ("Unable to perform ppConfigDump"); 320 exit($error_code); 321 } 322 323 # This is ugly, but doing a full parse for one entry is a bit wasteful. 324 foreach my $line (split /\n/, (join "", @$stdout_buf)) { 325 if ($line =~ /BURNTOOL.STATE.GOOD.UPDATE/) { 326 $line =~ s/^\s+//; 327 $burntoolStateGoodUpdate = (split /\s+/, $line)[2]; 328 last; 329 } 330 } 317 331 318 332 if ($run_state eq 'new') { 319 333 print "burntool state vs burntoolStateGood : $burntoolState vs $burntoolStateGood\n"; 334 $useBestBurntool = 0 if (abs($burntoolState) >= $burntoolStateGoodUpdate); 320 335 } else { 321 336 # if doing update go ahead if burntoolState is at least at BURNTOOL.STATE.GOOD.UPDATE … … 369 384 if ($ppImageApplyBurntool && ($burntoolState == -1 * $burntoolStateGood)) { 370 385 my $burntoolTable_uri = $uri; 371 $burntoolTable_uri =~ s/fits$/burn.tbl/; 386 if($burntoolStateGood >= 15) { 387 $burntoolTable_uri =~ s/fits$/burn.v15.tbl/; 388 } else { 389 $burntoolTable_uri =~ s/fits$/burn.tbl/; 390 } 372 391 my $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri ); 373 392 if ((!$burntoolTable_uriReal)||(!($ipprc->file_exists($burntoolTable_uri)))) { … … 416 435 if ($burntoolState == -1 * $burntoolStateGood) { # Burntool information stored in an external table. 417 436 $burntoolTable_uri = $uri; 418 $burntoolTable_uri =~ s/fits$/burn.tbl/; 437 if($burntoolStateGood >= 15) { 438 $burntoolTable_uri =~ s/fits$/burn.v15.tbl/; 439 } else { 440 $burntoolTable_uri =~ s/fits$/burn.tbl/; 441 } 419 442 $burntoolTable_uriReal = $ipprc->file_resolve( $burntoolTable_uri ); 420 443 if ((!$burntoolTable_uriReal)||(!($ipprc->file_exists($burntoolTable_uri)))) { -
trunk/ippScripts/scripts/dist_bundle.pl
r40823 r42394 75 75 my $file_cmd = can_run('file') or (warn "can't find program file" and $missing_tools = 1); 76 76 my $zcat = can_run('zcat') or (warn "can't find program zcat" and $missing_tools = 1); 77 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 77 78 if ($missing_tools) { 78 79 warn("Can't find required tools."); … … 131 132 } 132 133 134 # Determine the value of a "good" burntool run. 135 my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD"; 136 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 137 run ( command => $config_cmd, verbose => $verbose); 138 unless ($success) { 139 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 140 &my_die("Unable to perform ppConfigDump: $error_code", 0, 0, $class_id, $PS_EXIT_SYS_ERROR); 141 } 142 143 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 144 &my_die("Unable to parse metadata config doc", 0, 0, $class_id, $PS_EXIT_SYS_ERROR); 145 146 my $burntoolStateGood = 999; 147 foreach my $cfg (@$recipeData) { 148 if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') { 149 $burntoolStateGood = $cfg->{value}; 150 } 151 } 152 if ($burntoolStateGood == 999) { 153 &my_die("Failed to determine BURNTOOL.STATE.GOOD", $burntoolStateGood, $class_id, 0, $PS_EXIT_SYS_ERROR); 154 } 155 156 133 157 $ipprc->redirect_output($logfile) if $logfile; 134 158 … … 144 168 # note: We my_die in get_file_list if something goes wrong. 145 169 146 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs );170 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs,$burntoolStateGood); 147 171 148 172 if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) { … … 555 579 my $clean = shift; 556 580 my $num_sky_inputs = shift; 581 my $bt_state_good = shift; 557 582 558 583 my @file_list; … … 576 601 my %burntool_table; 577 602 $burntool_table{file_rule} = "BURNTOOL.TABLE"; 578 $burntool_table{name} = "$path_base.burn.tbl"; 603 604 if($bt_state_good == 15) { 605 $burntool_table{name} = "$path_base.burn.v15.tbl"; 606 } else { 607 $burntool_table{name} = "$path_base.burn.tbl"; 608 } 579 609 push @file_list, \%burntool_table; 580 610 } -
trunk/ippScripts/scripts/ipp_apply_burntool.pl
r31906 r42394 146 146 147 147 my $outTable = $file->{uri}; 148 $outTable =~ s/fits$/burn.tbl/; 148 149 if($burntoolStateGood == 15) { 150 $outTable =~ s/fits$/burn.v15.tbl/; 151 } else { 152 $outTable =~ s/fits$/burn.tbl/; 153 } 149 154 my $outTableReal = $ipprc->file_resolve($outTable, 1); 150 155 -
trunk/ippScripts/scripts/ipp_apply_burntool_fix.pl
r37313 r42394 15 15 my $missing_tools; 16 16 my $regtool = can_run('regtool') or (warn "Can't find regtool" and $missing_tools = 1); 17 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 17 18 my $burntool = can_run('ipp_apply_burntool_single.pl') or (warn "Can't find ipp_burntool_apply_single.pl" and $missing_tools = 1); 18 19 if ($missing_tools) { … … 65 66 die "failed to find uri in regtool output" unless $uri; 66 67 68 # Determine the value of a "good" burntool run. 69 my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD"; 70 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 71 run ( command => $config_cmd, verbose => $verbose); 72 unless ($success) { 73 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 74 carp("Unable to perform ppConfigDUmp $command: $error_code"); 75 exit $error_code; 76 } 77 78 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or die("Unable to parse Config metadata"); 79 80 my $burntoolStateGood = 999; 81 foreach my $cfg (@$recipeData) { 82 if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') { 83 $burntoolStateGood = $cfg->{value}; 84 } 85 } 86 if ($burntoolStateGood == 999) { 87 die("Failed to determine BURNTOOL.STATE.GOOD"); 88 } 89 90 67 91 # Construct burntool table name 68 92 my $table; 69 ($table = $uri) =~ s/\.fits/\.burn\.tbl/; 93 if($burntoolStateGood == 15) { 94 ($table = $uri) =~ s/\.fits/\.burn\.v15\.tbl/; 95 } else { 96 ($table = $uri) =~ s/\.fits/\.burn\.tbl/; 97 } 98 70 99 print "$table\n"; 71 100 -
trunk/ippScripts/scripts/ipp_apply_burntool_single.pl
r37077 r42394 178 178 179 179 my $outTable = $this_uri; 180 $outTable =~ s/fits$/burn.tbl/; 180 if($burntoolStateGood == 15) { 181 $outTable =~ s/fits$/burn.v15.tbl/; 182 } else { 183 $outTable =~ s/fits$/burn.tbl/; 184 } 185 181 186 my $outTableReal = $ipprc->file_resolve($outTable, 1); 182 187 if (!$outTableReal) { … … 188 193 if ($previous_uri) { 189 194 $previousTable = $previous_uri; 190 $previousTable =~ s/fits$/burn.tbl/; 195 if($burntoolStateGood == 15) { 196 $previousTable =~ s/fits$/burn.v15.tbl/; 197 } else { 198 $previousTable =~ s/fits$/burn.tbl/; 199 } 191 200 $previousTableReal = $ipprc->file_resolve($previousTable, 0); 192 201 if (!$previousTableReal) { … … 219 228 # burntool 220 229 if (($previousTableReal)&&($previousTableReal ne '')) { 230 print "Running: $burntool $tempPixels in=$previousTableReal out=$outTableReal tableonly=t persist=t\n"; 221 231 $status = vsystem ("$burntool $tempPixels in=$previousTableReal out=$outTableReal tableonly=t persist=t", $REALRUN); 222 232 } 223 233 else { 234 print "Running: $burntool $tempPixels out=$outTableReal tableonly=t persist=t\n"; 224 235 $status = vsystem ("$burntool $tempPixels out=$outTableReal tableonly=t persist=t", $REALRUN); 225 236 } -
trunk/ippScripts/scripts/permcheck.pl
r39971 r42394 375 375 if ($product eq 'BURN.TABLE.DOESNT.HAVE.A.PRODUCT') { 376 376 my $bt_state = $entry->{burntool_state}; 377 if ($bt_state !=-14) { next; }377 if ($bt_state > -14) { next; } 378 378 my $bt_file = $entry->{uri}; 379 $bt_file =~ s/fits$/burn.tbl/; 379 380 if($bt_state <= -15) { 381 $bt_file =~ s/fits$/burn.v15.tbl/; 382 } else { 383 $bt_file =~ s/fits$/burn.tbl/; 384 } 380 385 push @keys, $bt_file; 381 386 -
trunk/ippScripts/scripts/sc_prepare_chip.pl
r38168 r42394 260 260 } 261 261 262 263 # Determine the value of a "good" burntool run. 264 my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD"; 265 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 266 run ( command => $config_cmd, verbose => $verbose); 267 unless ($success) { 268 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 269 &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $class_id, $PS_EXIT_SYS_ERROR); 270 } 271 272 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 273 &my_die("Unable to parse metadata config doc", $exp_id, $class_id, $PS_EXIT_SYS_ERROR); 274 275 my $burntoolStateGood = 999; 276 foreach my $cfg (@$recipeData) { 277 if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') { 278 $burntoolStateGood = $cfg->{value}; 279 } 280 } 281 if ($burntoolStateGood == 999) { 282 &my_die("Failed to determine BURNTOOL.STATE.GOOD", $exp_id, $class_id, $PS_EXIT_SYS_ERROR); 283 } 284 285 262 286 # The image exists, so continue. This resets the variables, but also outputs the file locations. 263 287 ($ipp_uri, $remote_uri) = uri_to_outputs_raw($uri); 264 288 my $btt = $uri; 265 $btt =~ s/fits$/burn.tbl/; 266 289 if($burntoolStateGood == 15) { 290 $btt =~ s/fits$/burn.v15.tbl/; 291 } else { 292 $btt =~ s/fits$/burn.tbl/; 293 } 294 267 295 # Check burntool table for existance, and if it doesn't, regenerate it. 268 296 my ($ipp_btt, $remote_btt) = uri_convert($btt);
Note:
See TracChangeset
for help on using the changeset viewer.
