Changeset 26929
- Timestamp:
- Feb 12, 2010, 2:13:07 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/diff_skycell.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/diff_skycell.pl
r26901 r26929 1 #!/usr/bin/env perl1 >>#!/usr/bin/env perl 2 2 3 3 use warnings; … … 37 37 my ($diff_id, $dbname, $threads, $outroot, $reduction, $inverse, $run_state, $verbose, $no_update, $no_op, $redirect); 38 38 my ($skycell_id, $diff_skyfile_id); 39 my ($use_convolved); 39 40 GetOptions( 40 41 'diff_id=s' => \$diff_id, # Diff identifier … … 47 48 'inverse' => \$inverse, # Make inverse subtraction? 48 49 'reduction=s' => \$reduction, # Reduction class 50 'use_convolved' => \$use_convolved, # Use convolved stacks instead of unconvolved. 49 51 'verbose' => \$verbose, # Print to stdout 50 52 'no-update' => \$no_update, # Don't update the database? … … 100 102 my $camera; # Camera 101 103 my ($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. 105 if ((${ $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 } 112 else { 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 102 117 foreach my $file (@$files) { 103 118 if (defined $file->{template} and $file->{template}) { 104 $template = $file->{uri};119 # $template = $file->{uri}; 105 120 $templatePath = $file->{path_base}; 106 121 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 } 109 132 $templateSources = "PSPHOT.OUT.CMF.MEF"; ## this must be consistent with the value in stack_skycell.pl:161 110 133 # template is a stack so it doesn't need to be magicked … … 112 135 ## use an explicit stack name for psphot output objects 113 136 } else { 137 $template = "PSWARP.OUTPUT"; 114 138 $templateMask = "PSWARP.OUTPUT.MASK"; 115 139 $templateVariance = "PSWARP.OUTPUT.VARIANCE"; … … 118 142 } 119 143 } else { 120 $input = $file->{uri};144 # $input = $file->{uri}; 121 145 $inputPath = $file->{path_base}; 122 146 $inputMagic = $file->{magicked}; # if input is a stack the output can't be "magicked" 123 147 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 } 126 158 $inputSources = "PSPHOT.OUT.CMF.MEF"; ## this must be consistent with the value in stack_skycell.pl:161 127 159 } else { 160 $input = "PSWARP.OUTPUT"; 128 161 $inputMask = "PSWARP.OUTPUT.MASK"; 129 162 $inputVariance = "PSWARP.OUTPUT.VARIANCE"; … … 180 213 # print "inputSources: $inputSources\n"; 181 214 215 $input = $ipprc->filename($input, $inputPath); 182 216 $inputMask = $ipprc->filename($inputMask, $inputPath); 183 217 $inputVariance = $ipprc->filename($inputVariance, $inputPath); 184 218 $inputSources = $ipprc->filename($inputSources, $inputPath); 185 219 220 $template = $ipprc->filename($template, $templatePath); 186 221 $templateMask = $ipprc->filename($templateMask, $templatePath); 187 222 $templateVariance = $ipprc->filename($templateVariance, $templatePath); 188 223 $templateSources = $ipprc->filename($templateSources, $templatePath); 189 224 225 print "template: $template\n"; 190 226 print "templateMask: $templateMask\n"; 191 227 print "templatePath: $templatePath\n"; 228 print "input: $input\n"; 192 229 print "inputMask: $inputMask\n"; 193 230 print "inputPath: $inputPath\n";
Note:
See TracChangeset
for help on using the changeset viewer.
