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_revert.pl

    r27598 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 );
     
    3738
    3839# Parse the command-line arguments
    39 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base, $cam_reduction);
     40my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base, $cam_reduction, $magicked);
    4041my ($outroot, $recoveryroot, $replace, $release, $bytes, $md5sum);
    4142my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
     
    5455           'replace=s'      => \$replace,    # replace the input images with the results.
    5556           'bothways=s'     => \$bothways,   # run has inverse files (bothways diff)
     57           'magicked=s'     => \$magicked,   # magicked state of the run
    5658           'save-temps'     => \$save_temps, # Save temporary files?
    5759           'dbname=s'       => \$dbname,     # Database name
     
    6365
    6466pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    65 pod2usage( -msg => "Required options: --magic_ds_id --camera --stage --stage_id --component --path_base --outroot",
     67pod2usage( -msg => "Required options: --magic_ds_id --camera --stage --stage_id --component --path_base --outroot --magicked",
    6668           -exitval => 3) unless
    6769    defined $magic_ds_id and
     
    7173    defined $component and
    7274    defined $path_base and
     75    defined $magicked and
    7376    defined $outroot;
    7477
     
    7679
    7780&my_die("cam_path_base is required for chip stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($stage eq 'chip' and !$cam_path_base);
     81
     82
    7883
    7984my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    168173        my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
    169174        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    170             run(command => $command, verbose => $verbose);
     175            # note verbose == 0 to keep from polluting log file with lots of usually useless information
     176            run(command => $command, verbose => 0);
    171177        unless ($success) {
    172178            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    181187    }
    182188
     189    $image  = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id);
     190    $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
     191
    183192    # we use the mask output from the camera stage for input and replace
    184193    # the output of the chip stage with that mask as well.
    185     $image  = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id);
    186     $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
    187 
    188     if ($dynamicMasks) {
     194    # Note that when destreaking as part of an update $magicked is non-zero.
     195    # In this case we do not touch the camera stage mask so there is no need to revert it
     196    if (!$magicked and $dynamicMasks) {
    189197        $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id);
    190198        $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);
     
    194202
    195203    $bimage  = $ipprc->filename("PPIMAGE.CHIP", $backup_path_base, $class_id);
    196     # This is kludgey but correct
     204    # This is somewhat kludgey but it works whether the mask is camera mask or chip mask
    197205    $bmask   = dirname($backup_path_base) . "/SR_" . basename($mask);
    198206    $bch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $backup_path_base, $class_id);
Note: See TracChangeset for help on using the changeset viewer.