Changeset 28003 for branches/pap/ippScripts/scripts/magic_destreak.pl
- Timestamp:
- May 18, 2010, 12:49:05 PM (16 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/magic_destreak.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippScripts/scripts/magic_destreak.pl
r27396 r28003 8 8 use Sys::Hostname; 9 9 my $host = hostname(); 10 my $date = `date`; 10 11 print "\n\n"; 11 print "Starting script $0 on $host \n\n";12 print "Starting script $0 on $host at $date\n\n"; 12 13 13 14 use vars qw( $VERSION ); … … 41 42 # Parse the command-line arguments 42 43 my ($magic_ds_id, $camera, $streaks, $inv_streaks, $exp_id, $stage, $stage_id, $component, $uri, $path_base, $cam_path_base, $cam_reduction); 43 my ($outroot, $recoveryroot );44 my ($outroot, $recoveryroot, $magicked); 44 45 my ($replace, $release); 45 46 my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile); … … 61 62 'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels 62 63 'replace=s' => \$replace, # replace the input images with the results. 64 'magicked=s' => \$magicked, # magicked state of the run 63 65 'release' => \$release, # NAN masked pixels for release 64 66 'save-temps' => \$save_temps, # Save temporary files? … … 71 73 72 74 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 73 pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component --uri --path_base --outroot ",75 pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component --uri --path_base --outroot --magicked", 74 76 -exitval => 3) unless 75 77 defined $magic_ds_id and … … 82 84 defined $uri and 83 85 defined $path_base and 84 defined $outroot; 86 defined $outroot and 87 defined $magicked; 85 88 86 89 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 209 212 &my_die("Unable to parse metadata list", $magic_ds_id, $component, $PS_EXIT_PROG_ERROR); 210 213 211 $temp_dir = tempdir( CLEANUP => !$save_temps);212 214 ($sfh, $skycell_list) = tempfile( "/tmp/skycell_list.XXXX", UNLINK => !$save_temps); 213 215 … … 218 220 } else { 219 221 # diff run must have been cleaned up, need to create this skycell file on the fly 222 if (!defined $temp_dir ) { 223 $temp_dir = tempdir( CLEANUP => !$save_temps); 224 } 220 225 my $skycell_id = $skycell->{skycell_id}; 221 226 $skycell_uri = "$temp_dir/$skycell_id"; … … 247 252 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -"; 248 253 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 249 run(command => $command, verbose => $verbose); 254 # note verbose == 0 to avoid polluting log files with almost always useless information 255 run(command => $command, verbose => 0); 250 256 unless ($success) { 251 257 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 266 272 $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base); 267 273 268 if ($dynamicMasks) { 274 # if magicked is non-zero we are updating a previously magicked component. In this case we don't 275 # touch the camera mask 276 if (!$magicked and $dynamicMasks) { 269 277 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id); 270 278 $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);
Note:
See TracChangeset
for help on using the changeset viewer.
