- Timestamp:
- Nov 8, 2011, 2:44:12 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110906
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/warp_skycell.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110906
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20110906/ippScripts/scripts/warp_skycell.pl
r31941 r32630 38 38 39 39 my ($warp_id, $skycell_id, $warp_skyfile_id, $tess_dir, $reduction, $camera, $dbname, $outroot, $threads, $run_state, $magicked, $verbose, $no_update, $no_op, $redirect, $save_temps); 40 my $zaplog = 0;41 40 42 41 GetOptions( … … 55 54 'no-update' => \$no_update, # Don't update the database? 56 55 'no-op' => \$no_op, # Don't do any operations? 57 'zaplog' => \$zaplog, # delete previous logfile58 56 'redirect-output' => \$redirect, 59 57 'save-temps' => \$save_temps, # Save temporary files? … … 77 75 my $do_stats; 78 76 if ($run_state eq 'new') { 79 $logDest = prepare_output("LOG.EXP", $outroot, $skycell_id, $zaplog);77 $logDest = $ipprc->filename("LOG.EXP", $outroot, $skycell_id); 80 78 $traceDest = prepare_output("TRACE.EXP", $outroot, $skycell_id, 1); 81 79 $do_stats = 1; 82 80 } elsif ($run_state eq 'update') { 83 $logDest = prepare_output("LOG.EXP.UPDATE", $outroot, $skycell_id, 1);81 $logDest = $ipprc->filename("LOG.EXP.UPDATE", $outroot, $skycell_id); 84 82 $traceDest = prepare_output("TRACE.EXP.UPDATE", $outroot, $skycell_id, 1); 85 83 } else { … … 93 91 } 94 92 95 $ipprc->redirect_ output($logDest) or my_die( "Unable to redirect output", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR ) if $redirect;93 $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR ) if $redirect; 96 94 97 95 # Recipes to use based on reduction class … … 333 331 } 334 332 } 335 333 print "Quality: $quality\n"; 336 334 unless ($no_update) { 337 335 # XXX change -tess_id to -tess_dir when db is updated … … 358 356 } 359 357 } else { 358 359 my $quality = 0; 360 361 unless ($ipprc->file_exists($outputPSF)) { 362 $quality = 8006; # bad data. 363 } 364 # if (!$quality) { 365 # check_output($outputImage, 0); 366 # check_output($outputMask, 0); 367 # check_output($outputWeight, 0); 368 # check_output($outputSources, 1); 369 # check_output($outputPSF, 1) if metadataLookupBool($recipe, 'PSF') ; 370 # } 371 print "Quality: $quality\n"; 372 360 373 # $run_state eq 'update' 361 374 unless ($no_update) { … … 364 377 $command .= " -skycell_id $skycell_id"; 365 378 $command .= " -set_magicked $magicked" if $magicked; 379 $command .= " -set_quality $quality" if $quality; 366 380 $command .= " -dbname $dbname" if defined $dbname; 367 381 … … 407 421 408 422 &my_die("Couldn't find expected output file: $file", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file); 423 424 # Funpack to confirm we've really made things correctly 425 my $diskfile = $ipprc->file_resolve($file); 426 if ($diskfile =~ /fits/) { 427 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR); 428 my $check_command = "$funpack -S $diskfile > /dev/null"; 429 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 430 run(command => $check_command, verbose => $verbose); 431 if (!$success) { 432 &my_die("Output file not a valid fits file: $file", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR); 433 } 434 } 435 ##### 409 436 410 437 if ($replicate and $neb) {
Note:
See TracChangeset
for help on using the changeset viewer.
