IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 12:49:05 PM (16 years ago)
Author:
eugene
Message:

merging changes from trunk into branches/pap

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippScripts/scripts/magic_destreak.pl

    r27396 r28003  
    88use Sys::Hostname;
    99my $host = hostname();
     10my $date = `date`;
    1011print "\n\n";
    11 print "Starting script $0 on $host\n\n";
     12print "Starting script $0 on $host at $date\n\n";
    1213
    1314use vars qw( $VERSION );
     
    4142# Parse the command-line arguments
    4243my ($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);
     44my ($outroot, $recoveryroot, $magicked);
    4445my ($replace, $release);
    4546my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
     
    6162           'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels
    6263           'replace=s'      => \$replace,    # replace the input images with the results.
     64           'magicked=s'     => \$magicked,   # magicked state of the run
    6365           'release'        => \$release,    # NAN masked pixels for release
    6466           'save-temps'     => \$save_temps, # Save temporary files?
     
    7173
    7274pod2usage( -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",
     75pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component --uri --path_base --outroot --magicked",
    7476           -exitval => 3) unless
    7577    defined $magic_ds_id and
     
    8284    defined $uri and
    8385    defined $path_base and
    84     defined $outroot;
     86    defined $outroot and
     87    defined $magicked;
    8588
    8689my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    209212                    &my_die("Unable to parse metadata list", $magic_ds_id, $component, $PS_EXIT_PROG_ERROR);
    210213
    211             $temp_dir = tempdir( CLEANUP => !$save_temps);
    212214            ($sfh, $skycell_list) = tempfile( "/tmp/skycell_list.XXXX", UNLINK => !$save_temps);
    213215
     
    218220                } else {
    219221                    # 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                    }
    220225                    my $skycell_id = $skycell->{skycell_id};
    221226                    $skycell_uri = "$temp_dir/$skycell_id";
     
    247252            my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
    248253            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);
    250256            unless ($success) {
    251257                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    266272        $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base);
    267273
    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) {
    269277            $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id);
    270278            $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);
Note: See TracChangeset for help on using the changeset viewer.