- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/diff_skycell.pl (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ippScripts/scripts/diff_skycell.pl
r23594 r24244 35 35 } 36 36 37 my ($diff_id, $dbname, $threads, $outroot, $reduction, $ verbose, $no_update, $no_op, $redirect);37 my ($diff_id, $dbname, $threads, $outroot, $reduction, $inverse, $verbose, $no_update, $no_op, $redirect); 38 38 my ($skycell_id, $diff_skyfile_id); 39 39 GetOptions( … … 44 44 'threads=s' => \$threads, # Number of threads to use 45 45 'outroot=s' => \$outroot, # Output root name 46 'inverse' => \$inverse, # Make inverse subtraction? 46 47 'reduction=s' => \$reduction, # Reduction class 47 48 'verbose' => \$verbose, # Print to stdout … … 95 96 my $tess_id; # Tesselation identifier 96 97 my $camera; # Camera 97 my $magicked_0; 98 my $magicked_1; 98 my ($inputMagic, $templateMagic); # Are the inputs been magicked? 99 99 foreach my $file (@$files) { 100 100 if (defined $file->{template} and $file->{template}) { … … 106 106 $templateSources = "PSPHOT.OUT.CMF.MEF"; ## this must be consistent with the value in stack_skycell.pl:161 107 107 # template is a stack so it doesn't need to be magicked 108 $ magicked_1= 1;108 $templateMagic = 1; 109 109 ## use an explicit stack name for psphot output objects 110 110 } else { … … 112 112 $templateVariance = "PSWARP.OUTPUT.VARIANCE"; 113 113 $templateSources = "PSWARP.OUTPUT.SOURCES"; 114 $ magicked_1= $file->{magicked};114 $templateMagic = $file->{magicked}; 115 115 } 116 116 } else { 117 117 $input = $file->{uri}; 118 118 $inputPath = $file->{path_base}; 119 $ magicked_0= $file->{magicked}; # if input is a stack the output can't be "magicked"119 $inputMagic = $file->{magicked}; # if input is a stack the output can't be "magicked" 120 120 if ($file->{warp_id} == 0) { 121 121 $inputMask = "PPSTACK.OUTPUT.MASK"; … … 145 145 $camera = $file->{camera}; 146 146 } 147 148 147 } 149 148 … … 158 157 # note that difftool -inputskyfile outputs the magicked boolean as an int not T or F 159 158 # because the output is constructed from a union of two selects 160 my $magicked = $ magicked_0 && $magicked_1;159 my $magicked = $inputMagic && $templateMagic; 161 160 162 161 # Recipes to use based on reduction class … … 207 206 my $outputMask = $ipprc->filename("PPSUB.OUTPUT.MASK", $outroot); 208 207 my $outputVariance = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $outroot); 208 my $outputSources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $outroot); 209 my $jpeg1Name = $ipprc->filename("PPSUB.OUTPUT.JPEG1", $outroot); 210 my $jpeg2Name = $ipprc->filename("PPSUB.OUTPUT.JPEG2", $outroot); 209 211 my $configuration = $ipprc->filename("PPSUB.CONFIG", $outroot); 210 my $outputSources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $outroot);211 #my $bin1Name = $ipprc->filename("PPSUB.BIN1", $outroot);212 #my $bin2Name = $ipprc->filename("PPSUB.BIN2", $outroot);213 212 my $outputStats = $ipprc->filename("SKYCELL.STATS", $outroot); 214 213 my $traceDest = $ipprc->filename("TRACE.EXP", $outroot); 214 215 my ($inverseName, $inverseMask, $inverseVariance, $inverseSources); 216 if ($inverse) { 217 $inverseName = $ipprc->filename("PPSUB.INVERSE", $outroot); 218 $inverseMask = $ipprc->filename("PPSUB.INVERSE.MASK", $outroot); 219 $inverseVariance = $ipprc->filename("PPSUB.INVERSE.VARIANCE", $outroot); 220 $inverseSources = $ipprc->filename("PPSUB.INVERSE.SOURCES", $outroot); 221 } 215 222 216 223 my $cmdflags; … … 236 243 $command .= " -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF"; 237 244 $command .= " -photometry"; 245 $command .= " -inverse" if $inverse; 238 246 $command .= " -tracedest $traceDest -log $logDest"; 239 247 $command .= " -dumpconfig $configuration"; … … 248 256 &my_die("Unable to perform ppSub: $error_code", $diff_id, $skycell_id, $error_code); 249 257 } 250 &my_die("Couldn't find expected output file: $outputName", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName);251 &my_die("Couldn't find expected output file: $outputMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);252 &my_die("Couldn't find expected output file: $outputVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputVariance);253 # &my_die("Couldn't find expected output file: $outputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);254 # &my_die("Couldn't find expected output file: $bin1Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);255 # &my_die("Couldn't find expected output file: $bin2Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);256 258 257 259 my $outputStatsReal = $ipprc->file_resolve($outputStats); … … 270 272 } 271 273 chomp $cmdflags; 274 275 my ($quality) = $cmdflags =~ /-quality (\d+)/; # Quality flag 276 277 if (!$quality) { 278 &my_die("Couldn't find expected output file: $outputName", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputName); 279 &my_die("Couldn't find expected output file: $outputMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); 280 &my_die("Couldn't find expected output file: $outputVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputVariance); 281 &my_die("Couldn't find expected output file: $outputSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 282 &my_die("Couldn't find expected output file: $jpeg1Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($jpeg1Name); 283 &my_die("Couldn't find expected output file: $jpeg2Name", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($jpeg2Name); 284 if ($inverse) { 285 &my_die("Couldn't find expected output file: $inverseName", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseName); 286 &my_die("Couldn't find expected output file: $inverseMask", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseMask); 287 &my_die("Couldn't find expected output file: $inverseVariance", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseVariance); 288 &my_die("Couldn't find expected output file: $inverseSources", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inverseSources); 289 } 290 } 272 291 } 273 292 … … 276 295 # Add the subtraction result 277 296 { 278 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id - uri $outputName -path_base $outroot";297 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id -path_base $outroot"; 279 298 $command .= " $cmdflags"; 280 299 $command .= " -magicked" if $magicked; … … 304 323 warn($msg); 305 324 if (defined $diff_id and defined $skycell_id and not $no_update) { 306 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id - code$exit_code";325 my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id -fault $exit_code"; 307 326 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 308 327 $command .= " -hostname $host" if defined $host;
Note:
See TracChangeset
for help on using the changeset viewer.
