IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25016


Ignore:
Timestamp:
Aug 7, 2009, 10:54:46 AM (17 years ago)
Author:
bills
Message:

destreaking of 'bothways' diffs was completely broken. Fixed by having one destreak run
for the diffRun instead of 2. Do both the forward and inverse outputs together

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/magic_destreak.pl

    r25005 r25016  
    3838
    3939# Parse the command-line arguments
    40 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $inverse, $cam_path_base);
     40my ($magic_ds_id, $camera, $streaks, $inv_streaks, $stage, $stage_id, $component, $uri, $path_base, $cam_path_base);
    4141my ($outroot, $recoveryroot);
    4242my ($replace, $release);
     
    4747           'camera=s'       => \$camera,     # camera for evaluating file rules
    4848           'streaks=s'      => \$streaks,    # file containing the list of streaks
     49           'inv_streaks=s'  => \$inv_streaks,# file containing the list of streaks from the inverse diff
    4950           'stage=s'        => \$stage,      # raw, chip, warp, or diff
    5051           'stage_id=s'     => \$stage_id,   # exp_id, chip_id, warp_id, or diff_id
     
    5253           'uri=s'          => \$uri,        # uri of the input image
    5354           'path_base=s'    => \$path_base,  # path_base of the input
    54            'inverse'        => \$inverse,    # Inverse subtraction?
    5555           'cam_path_base=s'=> \$cam_path_base,  # path_base from camera stage (for chip and raw)
    5656           'outroot=s'      => \$outroot,     # "directory" for temporary images (may be nebulous)
     
    9494} elsif ($stage ne "camera") {
    9595    &my_die("Invalid value for stage: $stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    96 }
     96}   
     97$inv_streaks = undef if defined($inv_streaks) and ($inv_streaks eq "NULL");
    9798
    9899my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
     
    234235        $sources    = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $path_base);
    235236    } elsif ($stage eq "diff") {
    236         my $name = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; # Base name for images
    237         $image  = $ipprc->filename($name, $path_base);
    238         $mask   = $ipprc->filename("$name.MASK", $path_base);
    239         $weight = $ipprc->filename("$name.VARIANCE", $path_base);
    240         $sources    = $ipprc->filename("$name.SOURCES", $path_base);
     237        $image  = $ipprc->filename("PPSUB.OUTPUT", $path_base);
     238        $mask   = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base);
     239        $weight = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $path_base);
     240        $sources    = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $path_base);
    241241    }
    242242
     
    266266        }
    267267    }
     268    if (($stage eq "diff") and $inv_streaks) {
     269        $image   = $ipprc->filename("PPSUB.INVERSE", $path_base);
     270        $mask    = $ipprc->filename("PPSUB.INVERSE.MASK", $path_base);
     271        $weight  = $ipprc->filename("PPSUB.INVERSE.VARIANCE", $path_base);
     272        $sources = $ipprc->filename("PPSUB.INVERSE.SOURCES", $path_base);
     273
     274        my $command = "$streaksremove -stage $stage -tmproot $tmproot -streaks $inv_streaks -image $image";
     275
     276        $command .= " -recovery $recoveryroot" if defined $recoveryroot;
     277        $command .= " -mask $mask" if defined $mask;
     278        $command .= " -weight $weight" if defined $weight;
     279        $command .= " -sources $sources" if defined $sources;
     280        $command .= " -replace" if $replace;
     281        $command .= " -release" if $release;
     282        $command .= " -dbname $dbname" if defined $dbname;
     283        unless (defined $no_op) {
     284            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     285                run(command => $command, verbose => $verbose);
     286            unless ($success) {
     287                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     288                &my_die("Unable to perform streaksremove: $error_code", $magic_ds_id, $component, $error_code);
     289            }
     290        } else {
     291            print "skipping command $command\n";
     292        }
     293    }
    268294} else {
    269295    # camera stage. The only work to do is to censor the detections file
Note: See TracChangeset for help on using the changeset viewer.