Changeset 27987 for trunk/ippScripts/scripts/magic_process.pl
- Timestamp:
- May 17, 2010, 5:17:19 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_process.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_process.pl
r27718 r27987 99 99 } 100 100 101 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or101 $inputs = $mdcParser->parse_list(join "", @$stdout_buf) or 102 102 &my_die("Unable to parse metadata config doc", $magic_id, $node, $PS_EXIT_PROG_ERROR); 103 104 $inputs = parse_md_list($metadata) or105 &my_die("Unable to parse metadata list", $magic_id, $node, $PS_EXIT_PROG_ERROR);106 103 } 107 104 108 105 109 106 my @outputs; 107 my $inverse; # Using inverse diff? 110 108 ### Do the heavy lifting 111 109 { … … 263 261 cat_list_to_list($mfh, $in_path_base, "mask.list"); 264 262 cat_list_to_list($wfh, $in_path_base, "weight.list"); 263 264 if ($innode->{inverse}) { 265 $inverse = 1; 266 } 265 267 } 266 268 close $in_fh; … … 330 332 } 331 333 } 334 332 335 if ($node eq "root") { 333 336 my $streaks_file = "$outroot.streaks"; … … 348 351 &run_verifystreaks($baseroot); 349 352 350 my $command = "$magictool -addmask"; 351 $command .= " -magic_id $magic_id"; 352 $command .= " -uri $streaks_file"; 353 $command .= " -streaks $num_streaks"; 354 $command .= " -dbname $dbname" if defined $dbname; 355 356 # Add the processed file to the database 357 unless ($no_update) { 353 my $exp_id; # Exposure identifier 354 my $cam_path; # Camera stage path_base 355 { 356 my $command = "magictool -exposure -magic_id $magic_id"; 357 $command .= " -inverse" if defined $inverse; 358 $command .= " -dbname $dbname" if defined $dbname; 358 359 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 359 360 run(command => $command, verbose => $verbose); 360 unless ($success) { 361 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 362 # This isn't going to work because our result was already entered. 363 &my_die("Unable to perform magictool -addmask: $error_code", $magic_id, $node, $error_code); 364 } 365 } else { 366 print "Skipping command: $command\n"; 361 my $exposures = $mdcParser->parse_list(join "", @$stdout_buf); 362 my $exp = $$exposures[0]; # Exposure of interest (should only be one) 363 364 $exp_id = $exp->{exp_id}; 365 $cam_path = $exp->{path_base}; 366 } 367 368 { 369 my $astrom = $ipprc->filename("PSASTRO.OUTPUT", $cam_path); # Astrometry file 370 my $streaks = "$outroot.streaks"; # Streaks file 371 my $clusters = "$baseroot.verify/${exp_id}_clusterPos.txt"; # Clusters file 372 373 my $command = "ppCoord -astrom $astrom -streaks $streaks"; 374 if ($ipprc->file_exists($clusters)) { 375 $command .= " -clusters $clusters"; 376 } 377 378 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 379 run(command => $command, verbose => $verbose); 380 open my $coords, "> $outroot.coords"; 381 print $coords join("", @$stdout_buf); 382 close $coords; 383 } 384 385 386 { 387 my $command = "$magictool -addmask"; 388 $command .= " -magic_id $magic_id"; 389 $command .= " -uri $streaks_file"; 390 $command .= " -streaks $num_streaks"; 391 $command .= " -dbname $dbname" if defined $dbname; 392 393 # Add the processed file to the database 394 unless ($no_update) { 395 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 396 run(command => $command, verbose => $verbose); 397 unless ($success) { 398 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 399 # This isn't going to work because our result was already entered. 400 &my_die("Unable to perform magictool -addmask: $error_code", $magic_id, $node, $error_code); 401 } 402 } else { 403 print "Skipping command: $command\n"; 404 } 367 405 } 368 406 }
Note:
See TracChangeset
for help on using the changeset viewer.
