Changeset 25027 for branches/pap/ippScripts/scripts/magic_process.pl
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/magic_process.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippScripts/scripts/magic_process.pl
r23908 r25027 136 136 } 137 137 138 $command .= " --detect --image $image --mask $mask --weight $weight"; 139 140 # set threshold to 4 sigma 141 $command .= ' -t 4'; 142 143 # add -S 138 my $template = resolve_template($innode); 139 &my_die("failed to resolve template", $magic_id, $node, $PS_EXIT_DATA_ERROR) 140 unless defined $template; 141 142 $command .= " --detect --image $image --mask $mask --weight $weight -k $template"; 143 144 # XXX: get all of these parameters from a recipe 145 146 # set threshold to 2.3 sigma (Default specified by Paul Sydney) 147 $command .= ' -t 2.3'; 148 149 # set threshold to 2.75 sigma (Test by EAM : uncorrelated noise is typically ~20% higher than expected) 150 # XXX we have fixed the output variance to address this 151 # $command .= ' -t 2.75'; 152 153 # set threshold to 4 sigma (for testing) 154 # $command .= ' -t 4'; 155 156 # set Minimum percent visible required between pixels clusters in a valid streak [0.0 - 1.0] 157 # default is 0.2 158 $command .= ' -P 0.2'; 159 160 #$command .= ' -t 4' . ' -P 0.25'; 161 162 # add -S "Number of pixels to shift for determining maximum differences in mean images default:8" 144 163 $command .= ' -S'; 164 165 # add 3 x 3 binning 166 $command .= ' -b 3'; 145 167 146 168 # create the list of inputs used at this stage. At higher levels the … … 183 205 foreach my $innode (@$inputs) { 184 206 # root for inputs from previous stage 185 my $in_ uri = $innode->{uri};186 print $sfh "$in_ uri\n";187 188 cat_list_to_list($in_fh, $in_ uri, "input.list");207 my $in_path_base = $innode->{magic_path_base}; 208 print $sfh "$in_path_base\n"; 209 210 cat_list_to_list($in_fh, $in_path_base, "input.list"); 189 211 # build input lists by combining the lists from 190 212 # previous stages 191 cat_list_to_list($ifh, $in_ uri, "image.list");192 cat_list_to_list($mfh, $in_ uri, "mask.list");193 cat_list_to_list($wfh, $in_ uri, "weight.list");213 cat_list_to_list($ifh, $in_path_base, "image.list"); 214 cat_list_to_list($mfh, $in_path_base, "mask.list"); 215 cat_list_to_list($wfh, $in_path_base, "weight.list"); 194 216 } 195 217 close $in_fh; … … 202 224 $command .= " --images $image_list --masks $mask_list --weights $weight_list" ; 203 225 $command .= " --inputstreaks $streaks_list"; 226 # new option to "merge duplicate streaks into unique streaks" 227 $command .= " --duplicates"; 204 228 }; 205 229 if ($@) { … … 235 259 $command .= " -magic_id $magic_id"; 236 260 $command .= " -node $node"; 237 $command .= " - uri$outroot";261 $command .= " -path_base $outroot"; 238 262 $command .= " -dbname $dbname" if defined $dbname; 239 263 … … 254 278 my $resolved = $ipprc->file_resolve($streaks_file); 255 279 256 my $fh; 257 open $fh, "<$resolved" or 258 &my_die("failed to open streaks file $streaks_file", $magic_id, $node, $PS_EXIT_UNKNOWN_ERROR); 259 # the first line in the streaks file contains the number of streaks found 260 my $num_streaks = <$fh>; 261 chomp $num_streaks; 262 close $fh; 263 print "$num_streaks streaks found on magicRun $magic_id\n" if $verbose; 280 my $num_streaks = -1; 281 unless ($no_op) { 282 my $fh; 283 open $fh, "<$resolved" or 284 &my_die("failed to open streaks file $streaks_file", $magic_id, $node, $PS_EXIT_UNKNOWN_ERROR); 285 # the first line in the streaks file contains the number of streaks found 286 $num_streaks = <$fh>; 287 chomp $num_streaks; 288 close $fh; 289 print "$num_streaks streaks found on magicRun $magic_id\n" if $verbose; 290 } 264 291 265 292 my $command = "$magictool -addmask"; … … 301 328 sub cat_list_to_list { 302 329 my $out = shift; # output file handle 303 my $ uri = shift; # urito append ...330 my $path_base = shift; # path_base to append ... 304 331 my $extension = shift; # ... the extension to 305 332 306 my $filename = "$ uri.$extension";333 my $filename = "$path_base.$extension"; 307 334 308 335 my $in; … … 313 340 } 314 341 315 sub resolve_inputs {316 342 sub resolve_inputs 343 { 317 344 my $node = shift; 318 my $input_base = $node->{path_base}; 319 320 my $image = $ipprc->file_resolve($ipprc->filename("PPSUB.OUTPUT", $input_base)); 321 my $mask = $ipprc->file_resolve($ipprc->filename("PPSUB.OUTPUT.MASK", $input_base)); 322 my $weight= $ipprc->file_resolve($ipprc->filename("PPSUB.OUTPUT.VARIANCE", $input_base)); 323 324 return ($image, $mask, $weight); 345 my $input_base = $node->{diff_path_base}; 346 347 my ($image, $mask, $variance); # Names to return 348 if ($node->{inverse}) { 349 $image = "PPSUB.INVERSE"; 350 $mask = "PPSUB.INVERSE.MASK"; 351 $variance = "PPSUB.INVERSE.VARIANCE"; 352 } else { 353 $image = "PPSUB.OUTPUT"; 354 $mask = "PPSUB.OUTPUT.MASK"; 355 $variance = "PPSUB.OUTPUT.VARIANCE"; 356 } 357 358 $image = $ipprc->file_resolve($ipprc->filename($image, $input_base)); 359 $mask = $ipprc->file_resolve($ipprc->filename($mask, $input_base)); 360 $variance= $ipprc->file_resolve($ipprc->filename($variance, $input_base)); 361 362 return ($image, $mask, $variance); 363 } 364 365 sub resolve_template 366 { 367 my $node = shift; 368 369 my $path_base = $node->{diff_path_base}; # Base name for name 370 my $image = $node->{inverse} ? "PPSUB.INPUT.CONV" : "PPSUB.REF.CONV"; # File rule of interest 371 372 $image = $ipprc->file_resolve($ipprc->filename($image, $path_base)); 373 374 return $image 325 375 } 326 376
Note:
See TracChangeset
for help on using the changeset viewer.
