Changeset 36419
- Timestamp:
- Jan 3, 2014, 1:56:07 PM (13 years ago)
- Location:
- branches/bills_branches/bills_201312/ippScripts
- Files:
-
- 1 added
- 2 edited
-
Build.PL (modified) (1 diff)
-
scripts/psphot_fullforce_summary.pl (added)
-
scripts/psphot_fullforce_warp.pl (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/bills_branches/bills_201312/ippScripts/Build.PL
r36374 r36419 133 133 scripts/queuestaticsky.pl 134 134 scripts/psphot_fullforce_warp.pl 135 scripts/psphot_fullforce_summary.pl 135 136 )], 136 137 dist_abstract => 'Scripts for running the Pan-STARRS IPP', -
branches/bills_branches/bills_201312/ippScripts/scripts/psphot_fullforce_warp.pl
r36394 r36419 60 60 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 61 61 pod2usage( 62 -msg => "Required options: --ff_id -- sourceroot --skycell_id --warp_path_base --outroot --camera",62 -msg => "Required options: --ff_id --warp_id --sourceroot --skycell_id --warp_path_base --outroot --camera", 63 63 -exitval => 3, 64 64 ) unless defined $ff_id, 65 65 and defined $sourceroot 66 and (defined $path_base or defined $warp_id) # if we don't have warp's path_base we need warp_id 66 and defined $path_base 67 and defined $warp_id 67 68 and defined $skycell_id 68 69 and defined $camera 69 70 and defined $outroot; 70 71 71 my $ipprc = PS::IPP::Config->new($camera) or my_die( "Unable to set up", $ff_id, $ skycell_id, $PS_EXIT_CONFIG_ERROR );72 my $ipprc = PS::IPP::Config->new($camera) or my_die( "Unable to set up", $ff_id, $warp_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); 72 73 73 74 my $neb; … … 80 81 81 82 $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", 82 $ff_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect; 83 84 if (!$path_base) { 83 $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect; 84 85 if (0) { 86 # if (!$path_base) { 85 87 # If path_base is not supplied, look it up in the database. 86 88 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files … … 94 96 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 95 97 &my_die("Unable to perform warptool -warpskyfile -inputskyfile: $error_code", 96 $ff_id, $ skycell_id, $error_code);98 $ff_id, $warp_id, $skycell_id, $error_code); 97 99 } 98 100 99 101 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 100 &my_die("Unable to parse metadata config doc", $ff_id, $ skycell_id, $PS_EXIT_PROG_ERROR);102 &my_die("Unable to parse metadata config doc", $ff_id, $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 101 103 $files = parse_md_list($metadata) or 102 &my_die("Unable to parse metadata list", $ff_id, $ skycell_id, $PS_EXIT_PROG_ERROR);103 } 104 105 &my_die("Input list does not contain exactly one elements", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR)104 &my_die("Unable to parse metadata list", $ff_id, $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 105 } 106 107 &my_die("Input list does not contain exactly one elements", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) 106 108 unless scalar @$files == 1; 107 109 … … 109 111 110 112 $path_base = $warp->{path_base}; 111 &my_die("Couldn't find input path in warptool output", $ff_id, $ skycell_id, $PS_EXIT_UNKNOWN_ERROR)113 &my_die("Couldn't find input path in warptool output", $ff_id, $warp_id, $skycell_id, $PS_EXIT_UNKNOWN_ERROR) 112 114 unless defined $path_base; 113 115 … … 119 121 unless ($recipe_psphot) { 120 122 &my_die("Couldn't find selected reduction for PSPHOT: $reduction\n", 121 $ff_id, $ skycell_id, $PS_EXIT_CONFIG_ERROR);123 $ff_id, $warp_id, $skycell_id, $PS_EXIT_CONFIG_ERROR); 122 124 } 123 125 … … 149 151 150 152 # check that the inputs exist (and have non-zero size) 151 &my_die("Couldn't find input: $input", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input);152 &my_die("Couldn't find input: $inputMask", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask);153 &my_die("Couldn't find input: $inputVariance", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance);154 &my_die("Couldn't find input: $inputPSF", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR) if ($inputPSF && !$ipprc->file_exists($inputPSF));155 &my_die("Couldn't find input: $inputSources", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources);153 &my_die("Couldn't find input: $input", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input); 154 &my_die("Couldn't find input: $inputMask", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask); 155 &my_die("Couldn't find input: $inputVariance", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance); 156 &my_die("Couldn't find input: $inputPSF", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) if ($inputPSF && !$ipprc->file_exists($inputPSF)); 157 &my_die("Couldn't find input: $inputSources", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources); 156 158 157 159 my $dump_config = 1; … … 192 194 unless ($success) { 193 195 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 194 &my_die("Unable to perform ppSub: $error_code", $ff_id, $ skycell_id, $error_code);196 &my_die("Unable to perform ppSub: $error_code", $ff_id, $warp_id, $skycell_id, $error_code); 195 197 } 196 198 … … 206 208 unless ($success) { 207 209 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 208 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $ff_id, $ skycell_id, $error_code);210 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $ff_id, $warp_id, $skycell_id, $error_code); 209 211 } 210 212 foreach my $line (@$stdout_buf) { … … 225 227 # Add the result to the database 226 228 { 227 my $command = "$fftool -ff_id $ff_id ";229 my $command = "$fftool -ff_id $ff_id -warp_id $warp_id"; 228 230 $command .= " -addresult -path_base $outroot"; 229 231 $command .= " $cmdflags"; … … 238 240 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 239 241 my $err_message = "Unable to perform fftool -addwarped" ; 240 &my_die("$err_message: $error_code", $ff_id, $ skycell_id, $error_code);242 &my_die("$err_message: $error_code", $ff_id, $warp_id, $skycell_id, $error_code); 241 243 } 242 244 } else { … … 261 263 my $error; 262 264 my $output = $ipprc->prepare_output($filerule, $outroot, undef, $delete, \$error) 263 or &my_die("failed to prepare output file for: $filerule", $ff_id, $ skycell_id, $error);265 or &my_die("failed to prepare output file for: $filerule", $ff_id, $warp_id, $skycell_id, $error); 264 266 return $output; 265 267 } … … 274 276 } 275 277 276 &my_die("Couldn't find expected output file: $file", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file);278 &my_die("Couldn't find expected output file: $file", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file); 277 279 278 280 # Funpack to confirm we've really made things correctly 279 281 my $diskfile = $ipprc->file_resolve($file); 280 282 if ($diskfile =~ /fits/) { 281 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR);283 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR); 282 284 my $check_command = "$funpack -S $diskfile > /dev/null"; 283 285 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 284 286 run(command => $check_command, verbose => $verbose); 285 287 if (!$success) { 286 &my_die("Output file not a valid fits file: $file", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR);288 &my_die("Output file not a valid fits file: $file", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR); 287 289 } 288 290 } … … 290 292 291 293 if ($replicate and $neb) { 292 $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n", $ff_id, $ skycell_id, $PS_EXIT_SYS_ERROR);294 $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR); 293 295 } 294 296 } … … 298 300 { 299 301 my $msg = shift; # Warning message on die 300 my $ff_id = shift; # full force warp identifier 302 my $ff_id = shift; # full force run identifier 303 my $warp_id = shift; # full force warp id 301 304 my $skycell_id = shift; # Skycell identifier 302 305 my $exit_code = shift; # Exit code to add … … 306 309 warn($msg); 307 310 if (defined $ff_id and defined $skycell_id) { 308 my $command = "$fftool -ff_id $ff_id - fault $exit_code";311 my $command = "$fftool -ff_id $ff_id -warp_id $warp_id -fault $exit_code"; 309 312 $command .= " -addresult"; 310 313 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
Note:
See TracChangeset
for help on using the changeset viewer.
