- Timestamp:
- Oct 1, 2012, 2:32:49 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/ippScripts/scripts/skycell_jpeg.pl
r28403 r34491 268 268 269 269 my %tangents = (); 270 271 my %products = ('image' => "PPSTACK.OUTPUT", 272 'mask' => "PPSTACK.OUTPUT.MASK", 273 'variance' => "PPSTACK.OUTPUT.VARIANCE", 274 'exp' => "PPSTACK.OUTPUT.EXP", 275 'num' => "PPSTACK.OUTPUT.EXPNUM", 276 # 'bkg' => "PPSTACK.OUTPUT.BKG" 277 ); 270 278 271 279 foreach my $imfile (@$imfiles) { … … 281 289 282 290 $projection_cell =~ s/^(.*)\..*$/$1/; 283 291 284 292 unless (exists($tangents{$projection_cell})) { 285 293 # Make a temp file and fill, but be sure to save 286 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 287 UNLINK => !$save_temps); 288 $tangents{$projection_cell}{FILE} = $tempFile; 289 $tangents{$projection_cell}{NAME} = $tempName; 290 if ($masks) { 291 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 292 UNLINK => !$save_temps); 293 $tangents{$projection_cell}{MFILE} = $maskFile; 294 $tangents{$projection_cell}{MNAME} = $maskName; 295 } 296 } 297 print "$skycell_id $projection_cell\n"; 298 my $file = $ipprc->filename("PPSTACK.OUTPUT", $path_base, $skycell_id); 299 print "$file $state $quality\n"; 300 my $f_fh = $tangents{$projection_cell}{FILE}; 301 print $f_fh "$file\n"; 302 if ($masks) { 303 my $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base, $skycell_id); 304 print "$mask\n"; 305 my $m_fh = $tangents{$projection_cell}{MFILE}; 306 print $m_fh "$mask\n"; 294 295 foreach my $key (keys %products) { 296 297 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.$key.XXXX", 298 UNLINK => !$save_temps); 299 $tangents{$projection_cell}{$key}{FILE} = $tempFile; 300 $tangents{$projection_cell}{$key}{NAME} = $tempName; 301 } 302 } 303 foreach my $key (keys %products) { 304 print "$skycell_id $projection_cell\n"; 305 my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id); 306 print "$file $state $quality\n"; 307 my $f_fh = $tangents{$projection_cell}{$key}{FILE}; 308 print $f_fh "$file\n"; 307 309 } 308 310 } 309 311 foreach my $projection_cell (keys %tangents) { 310 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 311 if ($masks) { 312 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 313 } 314 $command .= " ${outroot}.${projection_cell} "; 315 print "$command\n"; 316 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 317 unless ($success) { 318 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 319 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 320 } 312 ## Loop over results here. 313 # Images 314 # Masks 315 # Variances 316 # Nexptime 317 # Nexp 318 # Backgrounds 319 320 foreach my $key (keys %products) { 321 $command = "$ppSkycell -images $tangents{$projection_cell}{$key}{NAME}"; 322 $command .= " ${outroot}.${projection_cell}.${key} "; 323 print "$command\n"; 324 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 325 unless ($success) { 326 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 327 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 328 } 329 } 330 321 331 # Update database: 322 332 $command = "$stacktool -addsummary -sass_id $stage_id -projection_cell $projection_cell -path_base $outroot";
Note:
See TracChangeset
for help on using the changeset viewer.
