Changeset 42602
- Timestamp:
- Jan 28, 2024, 2:24:07 PM (2 years ago)
- Location:
- branches/eam_branches/ipp-20230313/ippScripts
- Files:
-
- 1 added
- 4 edited
-
Build.PL (modified) (1 diff)
-
scripts/xccal.pl (modified) (1 diff)
-
scripts/xcff_warp.pl (added)
-
scripts/xcsky.pl (modified) (3 diffs)
-
scripts/xcstack_skycell.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/ippScripts/Build.PL
r42581 r42602 159 159 scripts/xcsky.pl 160 160 scripts/xccal.pl 161 scripts/xcff_warp.pl 161 162 )], 162 163 dist_abstract => 'Scripts for running the Pan-STARRS IPP', -
branches/eam_branches/ipp-20230313/ippScripts/scripts/xccal.pl
r42581 r42602 45 45 print "USAGE: xccal.pl --xccal_id (xccal_id) --outroot (root) --camera (camera) [options]\n"; 46 46 print " --xccal_id (xccal_id) : run identifier\n"; 47 print " --xcstack_id (xcstack_id) : run identifier\n"; 47 48 print " --camera (camera) : Camera name\n"; 48 49 print " --dbname (dbname) : Database name\n"; -
branches/eam_branches/ipp-20230313/ippScripts/scripts/xcsky.pl
r42580 r42602 135 135 136 136 { 137 my $recipe_psphot = $ipprc->reduction($reduction, ' STACKPHOT_PSPHOT'); # Recipe to use for psphot138 my $recipe_ppsub = $ipprc->reduction($reduction, 'STACKPHOT_PPSUB'); # Recipe to use for ppsub139 my $recipe_ppstack = $ipprc->reduction($reduction, 'STACKPHOT_PPSTACK'); # Recipe to use for ppstack137 my $recipe_psphot = $ipprc->reduction($reduction, 'XCSTACK_PSPHOT'); # Recipe to use for psphot 138 # my $recipe_ppsub = $ipprc->reduction($reduction, 'XCSTACK_PPSUB'); # Recipe to use for ppsub 139 # my $recipe_ppstack = $ipprc->reduction($reduction, 'XCSTACK_PPSTACK'); # Recipe to use for ppstack 140 140 unless ($recipe_psphot) { 141 &my_die("Couldn't find selected reduction for STACKPHOT: $reduction\n", $xcsky_id, $PS_EXIT_CONFIG_ERROR);141 &my_die("Couldn't find selected reduction for XCSTACK_PSPHOT: $reduction\n", $xcsky_id, $PS_EXIT_CONFIG_ERROR); 142 142 } 143 143 144 144 print "reduction: $reduction\n"; 145 145 print "recipe_psphot: $recipe_psphot\n"; 146 print "recipe_ppsub: $recipe_ppsub\n";147 print "recipe_ppstack: $recipe_ppstack\n";146 # print "recipe_ppsub: $recipe_ppsub\n"; 147 # print "recipe_ppstack: $recipe_ppstack\n"; 148 148 my $configuration = $ipprc->filename("PSPHOT.STACK.CONFIG", $outroot); 149 149 … … 261 261 $command .= " -threads $threads" if defined $threads; 262 262 $command .= " -recipe PSPHOT $recipe_psphot"; 263 $command .= " -recipe PPSUB $recipe_ppsub";264 $command .= " -recipe PPSTACK $recipe_ppstack";263 # $command .= " -recipe PPSUB $recipe_ppsub"; 264 # $command .= " -recipe PPSTACK $recipe_ppstack"; 265 265 $command .= " -dumpconfig $configuration" if !$updatemode; 266 266 $command .= " -tracedest $traceDest -log $logDest"; … … 274 274 } 275 275 276 # XXX need to enable the STATS output in psphotStack, then read the results here: 276 277 # my $outputStatsReal = $ipprc->file_resolve($outputStats); 277 278 # &my_die("Couldn't find expected output file: $outputStats", $xcsky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStatsReal); -
branches/eam_branches/ipp-20230313/ippScripts/scripts/xcstack_skycell.pl
r42560 r42602 19 19 20 20 use IPC::Cmd 0.36 qw( can_run run ); 21 use Scalar::Util qw(looks_like_number); 21 22 use PS::IPP::Metadata::Config; 22 23 use PS::IPP::Metadata::List qw( parse_md_list ); … … 244 245 245 246 # cannot use run_command here (no metadata output to parse) 246 my ( $success, $error_ code, $full_buf, $stdout_buf, $stderr_buf ) =247 run(command => $command, verbose => $verbose);247 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 248 my $error_code = &parse_error_message ($success, $error_msg, $command); 248 249 unless ($success) { 249 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 250 &my_die("Unable to perform ppStack: $error_code", $xcstack_id, $error_code); 250 &my_die("Unable to perform $command: $error_msg", $xcstack_id, $error_code); 251 251 } 252 252 … … 259 259 # measure stats 260 260 $command = "$ppStatsFromMetadata $outputStatsReal - XCSTACK_SKYCELL"; 261 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 261 ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 262 my $error_code = &parse_error_message ($success, $error_msg, $command); 262 263 unless ($success) { 263 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 264 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $xcstack_id, $error_code); 264 &my_die("Unable to perform $command: $error_msg", $xcstack_id, $error_code); 265 265 } 266 266 foreach my $line (@$stdout_buf) { $cmdflags .= " $line"; } … … 295 295 $command .= " -dbname $dbname" if defined $dbname; 296 296 297 my ( $success, $error_ code, $full_buf, $stdout_buf, $stderr_buf ) =298 run(command => $command, verbose => $verbose);297 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 298 my $error_code = &parse_error_message ($success, $error_msg, $command); 299 299 unless ($success) { 300 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 301 &my_die("Unable to perform xcstacktool $mode $error_code", $xcstack_id, $error_code); 300 &my_die("Unable to perform $command: $error_msg", $xcstack_id, $error_code); 302 301 } 303 302 } 304 305 303 } 306 304 307 305 print "I've updated the database: $xcstack_id\n"; 308 309 306 print "I've reached the end of processing with a code of $?: $xcstack_id\n"; 310 307 … … 411 408 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 412 409 413 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 410 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 411 my $error_code = &parse_error_message ($success, $error_msg, $command); 414 412 unless ($success) { 415 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 416 &my_die("Unable to perform $command", $xcstack_id, $error_code); 413 &my_die("Unable to perform $command: $error_msg", $xcstack_id, $error_code); 417 414 } 418 415 … … 435 432 } 436 433 434 # if the program exited normally, the exit value is returned 435 # if the program exited with a signal (abort, crash, etc), PS_EXIT_PROG_ERROR (4) is returned 436 # if the program failed to run, -PS_EXIT_PROG_ERROR (-4) is returned 437 sub parse_error_message { 438 my $success = shift; 439 my $error_msg = shift; 440 my $command = shift; 441 442 if ($success) { return 0; } 443 444 print "raw error_msg: $error_msg\n"; 445 print "full command: $command\n"; 446 447 if (&looks_like_number($error_msg)) { return (($error_msg >> 8) or ($PS_EXIT_PROG_ERROR)); } 448 449 # which of these match? 450 my ($error_code) = $error_msg =~ m/exited with value (\d+)/; 451 if (defined $error_code) { return $error_code; } 452 453 ($error_code) = $error_msg =~ m/died with signal (\d+)/; 454 # if (defined $error_code) { return (128 + $error_code); } 455 if (defined $error_code) { return ($PS_EXIT_PROG_ERROR); } 456 457 # probably failed to execute: 458 return (-1*$PS_EXIT_PROG_ERROR); 459 } 460 437 461 __END__ 438 462
Note:
See TracChangeset
for help on using the changeset viewer.
