Changeset 35853 for trunk/ippScripts/scripts/skycell_jpeg.pl
- Timestamp:
- Jul 24, 2013, 5:29:24 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/skycell_jpeg.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/skycell_jpeg.pl
r34800 r35853 17 17 my ($help,$masks); 18 18 my ($tempFile,$tempName,$maskFile,$maskName); 19 $verbose = 0; 19 20 my $ppSkycell = can_run('ppSkycell') or (warn "Can't find ppSkycell" and $missing_tools = 1); 20 21 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); … … 38 39 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV; 39 40 pod2usage( 40 -msg => "Required options: --stage --stage_id -- path_base\nHelpful options: --camera --dbname",41 -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname", 41 42 -exitval => 3, 42 43 ) unless … … 100 101 } 101 102 } 102 print "$skycell_id $projection_cell\n";103 # print "$skycell_id $projection_cell\n"; 103 104 my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id); 104 print "$file $state $quality\n";105 # print "$file $state $quality\n"; 105 106 my $f_fh = $tangents{$projection_cell}{FILE}; 106 107 print $f_fh "$file\n"; 107 108 if ($masks) { 108 109 my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id); 109 print "$mask\n";110 # print "$mask\n"; 110 111 my $m_fh = $tangents{$projection_cell}{MFILE}; 111 112 print $m_fh "$mask\n"; … … 118 119 } 119 120 $command .= " ${outroot}.${projection_cell} "; 120 print "$command\n";121 # print "$command\n"; 121 122 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 122 123 unless ($success) { … … 197 198 } 198 199 } 199 print "$skycell_id $projection_cell\n";200 # print "$skycell_id $projection_cell\n"; 200 201 my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id); 201 print "$file $state $quality\n";202 # print "$file $state $quality\n"; 202 203 my $f_fh = $tangents{$projection_cell}{FILE}; 203 204 print $f_fh "$file\n"; 204 205 if ($masks) { 205 206 my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id); 206 print "$mask\n";207 # print "$mask\n"; 207 208 my $m_fh = $tangents{$projection_cell}{MFILE}; 208 209 print $m_fh "$mask\n"; … … 215 216 } 216 217 $command .= " ${outroot}.${projection_cell} "; 217 print "$command\n";218 # print "$command\n"; 218 219 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 219 220 unless ($success) { … … 297 298 $tangents{$projection_cell}{$key}{FILE} = $tempFile; 298 299 $tangents{$projection_cell}{$key}{NAME} = $tempName; 300 $tangents{$projection_cell}{$key}{N} = 0; 299 301 } 300 302 } 301 303 foreach my $key (keys %products) { 302 print "$skycell_id $projection_cell\n";304 # print "$skycell_id $projection_cell\n"; 303 305 my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id); 304 print "$file $state $quality\n";306 # print "$file $state $quality\n"; 305 307 my $f_fh = $tangents{$projection_cell}{$key}{FILE}; 306 print $f_fh "$file\n"; 308 if ($ipprc->file_exists($file)) { 309 print $f_fh "$file\n"; 310 $tangents{$projection_cell}{$key}{N} ++; 311 } 307 312 } 308 313 } … … 322 327 $command .= " -Di BIN1 1 -Di BIN2 1 "; 323 328 } 324 elsif ($key eq 'image') { 325 $command .= " -masks $tangents{$projection_cell}{mask}{NAME} "; 326 } 327 elsif ($key eq 'mask') { 328 next; # This should be made with the images. 329 } 330 print "$command\n"; 331 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 332 unless ($success) { 333 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 334 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 329 # elsif ($key eq 'image') { 330 # $command .= " -masks $tangents{$projection_cell}{mask}{NAME} "; 331 # } 332 # elsif ($key eq 'mask') { 333 # next; # This should be made with the images. 334 # } 335 else { 336 # Append the image list to other objects, in case the WCS information is unpopulated 337 $command .= " -wcsref $tangents{$projection_cell}{image}{NAME} "; 338 } 339 if ($tangents{$projection_cell}{$key}{N} > 0) { 340 print "$command\n"; 341 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 342 unless ($success) { 343 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 344 # print "Was unable to perform ppSkycell $stage_id $error_code $key\n"; 345 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 346 } 335 347 } 336 348 }
Note:
See TracChangeset
for help on using the changeset viewer.
