IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27946


Ignore:
Timestamp:
May 13, 2010, 10:56:50 AM (16 years ago)
Author:
bills
Message:

pass the magicked state of the run to destreak and revert.
At the chip stage if magicked == -1 the camera mask files will not be
touched.

Location:
trunk
Files:
3 edited

Legend:

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

    r27718 r27946  
    4242# Parse the command-line arguments
    4343my ($magic_ds_id, $camera, $streaks, $inv_streaks, $exp_id, $stage, $stage_id, $component, $uri, $path_base, $cam_path_base, $cam_reduction);
    44 my ($outroot, $recoveryroot);
     44my ($outroot, $recoveryroot, $magicked);
    4545my ($replace, $release);
    4646my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
     
    6262           'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels
    6363           'replace=s'      => \$replace,    # replace the input images with the results.
     64           'magicked=s'     => \$magicked,   # magicked state of the run
    6465           'release'        => \$release,    # NAN masked pixels for release
    6566           'save-temps'     => \$save_temps, # Save temporary files?
     
    7273
    7374pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    74 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",
    7576           -exitval => 3) unless
    7677    defined $magic_ds_id and
     
    8384    defined $uri and
    8485    defined $path_base and
    85     defined $outroot;
     86    defined $outroot and
     87    defined $magicked;
    8688
    8789my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    248250            my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
    249251            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    250                 run(command => $command, verbose => $verbose);
     252                    # note verbose == 0 to avoid polluting log files with almost always useless information
     253                run(command => $command, verbose => 0);
    251254            unless ($success) {
    252255                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    267270        $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base);
    268271
    269         if ($dynamicMasks) {
     272        # if magicked is non-zero we are updating a previously magicked component. In this case we don't
     273        # touch the camera mask
     274        if (!$magicked and $dynamicMasks) {
    270275            $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id);
    271276            $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);
  • trunk/ippScripts/scripts/magic_destreak_revert.pl

    r27718 r27946  
    3838
    3939# Parse the command-line arguments
    40 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);
    4141my ($outroot, $recoveryroot, $replace, $release, $bytes, $md5sum);
    4242my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
     
    5555           'replace=s'      => \$replace,    # replace the input images with the results.
    5656           'bothways=s'     => \$bothways,   # run has inverse files (bothways diff)
     57           'magicked=s'     => \$magicked,   # magicked state of the run
    5758           'save-temps'     => \$save_temps, # Save temporary files?
    5859           'dbname=s'       => \$dbname,     # Database name
     
    6465
    6566pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    66 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",
    6768           -exitval => 3) unless
    6869    defined $magic_ds_id and
     
    7273    defined $component and
    7374    defined $path_base and
     75    defined $magicked and
    7476    defined $outroot;
    7577
     
    7779
    7880&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
    7983
    8084my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     
    169173        my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -";
    170174        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    171             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);
    172177        unless ($success) {
    173178            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    182187    }
    183188
     189    $image  = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id);
     190    $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
     191
    184192    # we use the mask output from the camera stage for input and replace
    185193    # the output of the chip stage with that mask as well.
    186     $image  = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id);
    187     $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
    188 
    189     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) {
    190197        $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id);
    191198        $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);
     
    195202
    196203    $bimage  = $ipprc->filename("PPIMAGE.CHIP", $backup_path_base, $class_id);
    197     # This is kludgey but correct
     204    # This is somewhat kludgey but it works whether the mask is camera mask or chip mask
    198205    $bmask   = dirname($backup_path_base) . "/SR_" . basename($mask);
    199206    $bch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $backup_path_base, $class_id);
  • trunk/ippTasks/destreak.pro

    r27879 r27946  
    214214    book getword magicToDS $pageName recoveryroot -var RECROOT
    215215    book getword magicToDS $pageName re_place -var REPLACE
     216    book getword magicToDS $pageName magicked -var MAGICKED
    216217    book getword magicToDS $pageName dbname -var DBNAME
    217218
     
    228229    # TODO: do not add recoveryroot or replace if they are null or zero
    229230
    230     $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE
     231    $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE --magicked $MAGICKED
    231232
    232233    add_standard_args run
     
    414415    book getword magicDSToRevert $pageName re_place -var REPLACE
    415416    book getword magicDSToRevert $pageName bothways -var BOTHWAYS
     417    book getword magicDSToRevert $pageName magicked -var MAGICKED
    416418    book getword magicDSToRevert $pageName dbname -var DBNAME
    417419
     
    426428    end
    427429
    428     $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS
     430    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS --magicked $MAGICKED
    429431
    430432    add_standard_args run
Note: See TracChangeset for help on using the changeset viewer.