Changeset 20301
- Timestamp:
- Oct 21, 2008, 3:25:14 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/warp_skycell.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/warp_skycell.pl
r20284 r20301 203 203 if ($do_stats) { 204 204 # Check first for the stats file, and if the ACCEPT flag is set. 205 my $outputStatsReal = $ipprc->file_resolve($outputStats);205 my $outputStatsReal = $ipprc->file_resolve($outputStats); 206 206 &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal; 207 207 208 # measure chip stats 209 $command = "$ppStatsFromMetadata $outputStatsReal - WARP_SKYCELL"; 210 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 211 run(command => $command, verbose => $verbose); 212 unless ($success) { 213 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 214 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR); 215 } 216 foreach my $line (@$stdout_buf) { 217 $cmdflags .= " $line"; 218 } 219 chomp $cmdflags; 220 221 # the stats includes ACCEPT as a boolean: convert the T/F value to 0/1 222 my $acceptFlag = &value_for_flag ($cmdflags, "-accept"); 223 $accept = ($acceptFlag eq "T") ? 1 : 0; 224 if ($accept && !$ipprc->file_exists($outputPSF)) { 225 $accept = 0; 226 } 227 228 if ($accept) { 208 # measure chip stats 209 $command = "$ppStatsFromMetadata $outputStatsReal - WARP_SKYCELL"; 210 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 211 run(command => $command, verbose => $verbose); 212 unless ($success) { 213 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 214 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR); 215 } 216 foreach my $line (@$stdout_buf) { 217 $cmdflags .= " $line"; 218 } 219 chomp $cmdflags; 220 221 if ($cmdflags =~ /-accept/) { 229 222 &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage); 230 223 &my_die("Couldn't find expected output file: $outputMask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); … … 240 233 $command .= " -tess_id $tess_dir"; 241 234 $command .= " -path_base $outroot"; # needed for logfile lookups 242 $command .= " -ignore" if not $accept; # Completed succesfully, but can't produce product 235 243 236 $command .= " -uri $outputImage" if $accept; 244 237 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); … … 272 265 } 273 266 } 274 }275 276 sub value_for_flag277 {278 my $cmdflags = shift;279 my $flag = shift;280 281 my $value = 0.0;282 if ($cmdflags =~ m|$flag|) {283 ($value) = $cmdflags =~ m|$flag\s+(\S+)|;284 }285 $value;286 267 } 287 268
Note:
See TracChangeset
for help on using the changeset viewer.
