- Timestamp:
- Mar 29, 2009, 6:15:31 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/diff_skycell.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/ippScripts/scripts/diff_skycell.pl
r23352 r23594 91 91 92 92 # Identify the input and the template 93 my ($input, $inputMask, $inputVariance, $inputPath ); # Input files and path93 my ($input, $inputMask, $inputVariance, $inputPath, $inputSources); # Input files and path 94 94 my ($template, $templateMask, $templateVariance, $templatePath, $templateSources); # Template files and path 95 95 my $tess_id; # Tesselation identifier 96 96 my $camera; # Camera 97 my $magicked_0; 98 my $magicked_1; 97 99 foreach my $file (@$files) { 98 100 if (defined $file->{template} and $file->{template}) { … … 103 105 $templateVariance = "PPSTACK.OUTPUT.VARIANCE"; 104 106 $templateSources = "PSPHOT.OUT.CMF.MEF"; ## this must be consistent with the value in stack_skycell.pl:161 107 # template is a stack so it doesn't need to be magicked 108 $magicked_1 = 1; 105 109 ## use an explicit stack name for psphot output objects 106 110 } else { … … 108 112 $templateVariance = "PSWARP.OUTPUT.VARIANCE"; 109 113 $templateSources = "PSWARP.OUTPUT.SOURCES"; 114 $magicked_1 = $file->{magicked}; 110 115 } 111 116 } else { 112 117 $input = $file->{uri}; 113 118 $inputPath = $file->{path_base}; 119 $magicked_0 = $file->{magicked}; # if input is a stack the output can't be "magicked" 114 120 if ($file->{warp_id} == 0) { 115 121 $inputMask = "PPSTACK.OUTPUT.MASK"; 116 122 $inputVariance = "PPSTACK.OUTPUT.VARIANCE"; 123 $inputSources = "PSPHOT.OUT.CMF.MEF"; ## this must be consistent with the value in stack_skycell.pl:161 117 124 } else { 118 125 $inputMask = "PSWARP.OUTPUT.MASK"; 119 126 $inputVariance = "PSWARP.OUTPUT.VARIANCE"; 127 $inputSources = "PSWARP.OUTPUT.SOURCES"; 120 128 } 121 129 } … … 144 152 &my_die("Unable to identify camera", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless defined $camera; 145 153 $ipprc->define_camera($camera); 154 155 # Compute the magicked status of the output. 156 # The output file will be considered magicked if the input has been magicked and the 157 # template is either a stack or a warp that has been magicked. 158 # note that difftool -inputskyfile outputs the magicked boolean as an int not T or F 159 # because the output is constructed from a union of two selects 160 my $magicked = $magicked_0 && $magicked_1; 146 161 147 162 # Recipes to use based on reduction class … … 160 175 # print "inputVariance: $inputVariance\n"; 161 176 # print "templateSources: $templateSources\n"; 177 # print "inputSources: $inputSources\n"; 178 179 $inputMask = $ipprc->filename($inputMask, $inputPath); 180 $inputVariance = $ipprc->filename($inputVariance, $inputPath); 181 $inputSources = $ipprc->filename($inputSources, $inputPath); 162 182 163 183 $templateMask = $ipprc->filename($templateMask, $templatePath); 164 $inputMask = $ipprc->filename($inputMask, $inputPath);165 184 $templateVariance = $ipprc->filename($templateVariance, $templatePath); 166 $inputVariance = $ipprc->filename($inputVariance, $inputPath);167 185 $templateSources = $ipprc->filename($templateSources, $templatePath); 168 186 … … 174 192 print "inputVariance: $inputVariance\n"; 175 193 print "templateSources: $templateSources\n"; 194 print "inputSources: $inputSources\n"; 176 195 177 196 &my_die("Couldn't find input: $template", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($template); 178 197 &my_die("Couldn't find input: $templateMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($templateMask); 179 198 &my_die("Couldn't find input: $templateVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($templateVariance); 199 &my_die("Couldn't find input: $templateSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($templateSources); 180 200 &my_die("Couldn't find input: $input", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input); 181 201 &my_die("Couldn't find input: $inputMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask); 182 202 &my_die("Couldn't find input: $inputVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance); 183 &my_die("Couldn't find input: $ templateSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($templateSources);203 &my_die("Couldn't find input: $inputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources); 184 204 185 205 # Get the output filenames … … 198 218 # Perform subtraction 199 219 unless ($no_op) { 200 my $command = "$ppSub $input $template $outroot"; 220 my $command = "$ppSub $outroot"; 221 $command .= " -inimage $input"; 222 $command .= " -refimage $template"; 201 223 $command .= " -inmask $inputMask"; 202 224 $command .= " -refmask $templateMask"; 203 225 $command .= " -invariance $inputVariance"; 204 226 $command .= " -refvariance $templateVariance"; 227 $command .= " -insources $inputSources"; 228 $command .= " -refsources $templateSources"; 205 229 $command .= " -stats $outputStats"; 206 230 $command .= " -threads $threads" if defined $threads; … … 211 235 $command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF"; 212 236 $command .= " -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF"; 213 $command .= " -sources $templateSources";214 237 $command .= " -photometry"; 215 238 $command .= " -tracedest $traceDest -log $logDest"; … … 255 278 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id -uri $outputName -path_base $outroot"; 256 279 $command .= " $cmdflags"; 280 $command .= " -magicked" if $magicked; 257 281 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 258 282 $command .= " -hostname $host" if defined $host;
Note:
See TracChangeset
for help on using the changeset viewer.
