Changeset 35853 for trunk/ippScripts
- Timestamp:
- Jul 24, 2013, 5:29:24 PM (13 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 3 edited
-
background_chip.pl (modified) (3 diffs)
-
lap_science.pl (modified) (2 diffs)
-
skycell_jpeg.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/background_chip.pl
r35681 r35853 34 34 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 35 35 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 36 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 36 37 if ($missing_tools) { 37 38 warn("Can't find required tools."); … … 134 135 } 135 136 my $in_wt = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $in_path, $class_id); 136 my $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id); 137 my $in_bg; 138 if (1) { 139 $in_bg = $ipprc->filename("PPIMAGE.BACKMDL", $cam_path_base, $class_id); 140 } 141 else { 142 $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id); 143 } 137 144 my $in_pattern = $ipprc->filename("PPIMAGE.PATTERN", $in_path, $class_id); 138 145 my $in_config = $ipprc->filename("PPIMAGE.CONFIG", $in_path, $class_id); … … 220 227 } 221 228 229 my $do_binned_images = 1; # Generate the binned images that are useful for making JPEGs 230 if ($do_binned_images) { 231 my $command = "$ppImage -file $out_image -mask $out_mask $outroot -recipe PPIMAGE PPIMAGE_PA -Db PHOTOM F"; 232 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 233 run(command => $command, verbose => $verbose); 234 unless ($success) { 235 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 236 &my_die("Unable to perform ppImage: $error_code", $chip_bg_id, $class_id, $error_code); 237 } 238 } 239 240 222 241 if (!$quality and !$no_op) { 223 242 &my_die("Couldn't find expected output file: $out_image", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($out_image); -
trunk/ippScripts/scripts/lap_science.pl
r35810 r35853 309 309 my $magicDS_update_cmd = "magicdstool -setfiletoupdate -magic_ds_id $chip_magicDS_id -set_label $label"; 310 310 $magicDS_update_cmd .= " -dbname $dbname " if defined $dbname; 311 my $warptool_preupdate_cmd = "warptool -revertwarped -warp_id $warp_id -fault 26"; 312 $warptool_preupdate_cmd .= " -dbname $dbname " if defined $dbname; 311 313 my $warptool_update_cmd = "warptool -setskyfiletoupdate -warp_id $warp_id -set_label $label"; 312 314 $warptool_update_cmd .= " -dbname $dbname " if defined $dbname; … … 339 341 # } 340 342 # } 343 } 344 345 346 ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 347 run(command => $warptool_preupdate_cmd, verbose => $verbose); 348 unless ($success) { 349 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 350 &my_die("Unable to perform warptool --revertwarped: $error_code", $exposure->{exp_id}, $data_group); 341 351 } 342 352 -
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.
