IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 25, 2012, 11:11:08 AM (14 years ago)
Author:
bills
Message:

use prepare_output to avoid lost nebulous files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/background_warp.pl

    r33054 r34592  
    8888my $logDest = $ipprc->filename("LOG.EXP", $outroot, $skycell_id) or my_die( "Unable to get log filename", $warp_bg_id, $skycell_id, $PS_EXIT_SYS_ERROR );
    8989
    90 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $warp_bg_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect;
     90$ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $warp_bg_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect;
    9191
    9292# Recipes to use based on reduction class
     
    158158&my_die("Can't find input astrometry: $astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR) unless $ipprc->file_exists($astrometry);
    159159
    160 my $out_image = $ipprc->filename("PSWARP.OUTPUT", $outroot, $skycell_id );
    161 my $out_mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $outroot, $skycell_id);
    162 my $out_stats = $ipprc->filename("SKYCELL.STATS", $outroot, $skycell_id );
    163 my $out_config = $ipprc->filename("PSWARP.CONFIG", $outroot, $skycell_id);
    164 my $traceDest = $ipprc->filename("TRACE.EXP", $outroot, $skycell_id);
    165 
    166 my $skyFile = $ipprc->filename("SKYCELL.TEMPLATE", $outroot, $skycell_id );
     160#my $out_image = $ipprc->filename("PSWARP.OUTPUT", $outroot, $skycell_id );
     161#my $out_mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $outroot, $skycell_id);
     162#my $out_stats = $ipprc->filename("SKYCELL.STATS", $outroot, $skycell_id );
     163#my $out_config = $ipprc->filename("PSWARP.CONFIG", $outroot, $skycell_id);
     164#my $traceDest = $ipprc->filename("TRACE.EXP", $outroot, $skycell_id);
     165
     166my $out_image = prepare_output("PSWARP.OUTPUT", $outroot, $skycell_id,  1);
     167my $out_mask = prepare_output("PSWARP.OUTPUT.MASK", $outroot, $skycell_id, 1);
     168my $out_stats = prepare_output("SKYCELL.STATS", $outroot, $skycell_id, 1);
     169my $out_config = prepare_output("PSWARP.CONFIG", $outroot, $skycell_id, 1);
     170my $traceDest = prepare_output("TRACE.EXP", $outroot, $skycell_id, 1);
     171
     172my $skyFile = prepare_output("SKYCELL.TEMPLATE", $outroot, $skycell_id, 1);
     173
    167174$ipprc->skycell_file( $tess_dir, $skycell_id, $skyFile, $verbose ) or &my_die("Unable to generate template skycell", $warp_bg_id, $skycell_id, $PS_EXIT_SYS_ERROR);
    168175
     
    239246### Pau.
    240247
     248sub prepare_output
     249{
     250    my $filerule = shift;
     251    my $outroot  = shift;
     252    my $skycell_id = shift;
     253    my $delete = shift;
     254    $delete = 0 if !defined $delete;
     255
     256    my $error;
     257    my $output = $ipprc->prepare_output($filerule, $outroot, $skycell_id, $delete, \$error)
     258                    or &my_die("failed to prepare output file for: $filerule", $warp_bg_id, $skycell_id, $error);
     259    return $output;
     260}
     261
    241262
    242263sub my_die
Note: See TracChangeset for help on using the changeset viewer.