IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 12, 2010, 2:13:07 PM (16 years ago)
Author:
watersc1
Message:

Added option to choose between convolved and unconvolved stacks:

if warp-warp diff { no stacks involved, no change }
if warp-stack diff{ choose convolved stack. }
if stack-stack diff{ choose unconvolved stack by default. manual set with --use_convolved option }

File:
1 edited

Legend:

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

    r26901 r26929  
    1 #!/usr/bin/env perl
     1>>#!/usr/bin/env perl
    22
    33use warnings;
     
    3737my ($diff_id, $dbname, $threads, $outroot, $reduction, $inverse, $run_state, $verbose, $no_update, $no_op, $redirect);
    3838my ($skycell_id, $diff_skyfile_id);
     39my ($use_convolved);
    3940GetOptions(
    4041    'diff_id=s'         => \$diff_id, # Diff identifier
     
    4748    'inverse'           => \$inverse, # Make inverse subtraction?
    4849    'reduction=s'       => \$reduction, # Reduction class
     50    'use_convolved'     => \$use_convolved, # Use convolved stacks instead of unconvolved.
    4951    'verbose'           => \$verbose,   # Print to stdout
    5052    'no-update'         => \$no_update, # Don't update the database?
     
    100102my $camera;                     # Camera
    101103my ($inputMagic, $templateMagic); # Are the inputs been magicked?
     104# Prescan to decide if this is or is not a stack stack diff. The check above confirms we only have two entries.
     105if ((${ $files }[0]->{warp_id} == 0)&&
     106    (${ $files }[1]->{warp_id} == 0)) {
     107    # Both are zero, so stack stack diff;
     108    unless ($use_convolved) {
     109        $use_convolved = 0;
     110    }
     111}
     112else {
     113    # We're in some sort of warp stack or warp warp (don't care about the last one.)
     114    $use_convolved = 1;
     115}
     116
    102117foreach my $file (@$files) {
    103118    if (defined $file->{template} and $file->{template}) {
    104         $template = $file->{uri};
     119#        $template = $file->{uri};
    105120        $templatePath = $file->{path_base};
    106121        if ($file->{warp_id} == 0) {
    107             $templateMask = "PPSTACK.OUTPUT.MASK";
    108             $templateVariance = "PPSTACK.OUTPUT.VARIANCE";
     122            if ($use_convolved) {
     123                $template = "PPSTACK.OUTPUT";
     124                $templateMask = "PPSTACK.OUTPUT.MASK";
     125                $templateVariance = "PPSTACK.OUTPUT.VARIANCE";
     126            }
     127            else {
     128                $template     = "PPSTACK.UNCONV";
     129                $templateMask = "PPSTACK.UNCONV.MASK";
     130                $templateVariance = "PPSTACK.UNCONV.VARIANCE";
     131            }
    109132            $templateSources = "PSPHOT.OUT.CMF.MEF";  ## this must be consistent with the value in stack_skycell.pl:161
    110133            # template is a stack so it doesn't need to be magicked
     
    112135            ## use an explicit stack name for psphot output objects
    113136        } else {
     137            $template     = "PSWARP.OUTPUT";
    114138            $templateMask = "PSWARP.OUTPUT.MASK";
    115139            $templateVariance = "PSWARP.OUTPUT.VARIANCE";
     
    118142        }
    119143    } else {
    120         $input = $file->{uri};
     144#        $input = $file->{uri};
    121145        $inputPath = $file->{path_base};
    122146        $inputMagic = $file->{magicked};    # if input is a stack the output can't be "magicked"
    123147        if ($file->{warp_id} == 0) {
    124             $inputMask = "PPSTACK.OUTPUT.MASK";
    125             $inputVariance = "PPSTACK.OUTPUT.VARIANCE";
     148            if ($use_convolved) {
     149                $input = "PPSTACK.OUTPUT";
     150                $inputMask = "PPSTACK.OUTPUT.MASK";
     151                $inputVariance = "PPSTACK.OUTPUT.VARIANCE";
     152            }
     153            else {
     154                $input     = "PPSTACK.UNCONV";
     155                $inputMask = "PPSTACK.UNCONV.MASK";
     156                $inputVariance = "PPSTACK.UNCONV.VARIANCE";
     157            }
    126158            $inputSources = "PSPHOT.OUT.CMF.MEF";  ## this must be consistent with the value in stack_skycell.pl:161
    127159        } else {
     160            $input     = "PSWARP.OUTPUT";
    128161            $inputMask = "PSWARP.OUTPUT.MASK";
    129162            $inputVariance = "PSWARP.OUTPUT.VARIANCE";
     
    180213# print "inputSources: $inputSources\n";
    181214
     215$input     = $ipprc->filename($input, $inputPath);
    182216$inputMask = $ipprc->filename($inputMask, $inputPath);
    183217$inputVariance = $ipprc->filename($inputVariance, $inputPath);
    184218$inputSources = $ipprc->filename($inputSources, $inputPath);
    185219
     220$template     = $ipprc->filename($template, $templatePath);
    186221$templateMask = $ipprc->filename($templateMask, $templatePath);
    187222$templateVariance = $ipprc->filename($templateVariance, $templatePath);
    188223$templateSources = $ipprc->filename($templateSources, $templatePath);
    189224
     225print "template:     $template\n";
    190226print "templateMask: $templateMask\n";
    191227print "templatePath: $templatePath\n";
     228print "input:     $input\n";
    192229print "inputMask: $inputMask\n";
    193230print "inputPath: $inputPath\n";
Note: See TracChangeset for help on using the changeset viewer.