IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 12, 2013, 3:59:34 PM (12 years ago)
Author:
watersc1
Message:

Add option to delete convolved images at the end of the script.

File:
1 edited

Legend:

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

    r35950 r36397  
    4040}
    4141
    42 my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps);
     42my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps, $delete_convolved_images);
    4343GetOptions(
    4444    'stack_id|d=s'      => \$stack_id, # Stack identifier
     
    5555    'redirect-output'   => \$redirect,
    5656    'save-temps'        => \$save_temps, # Save temporary files?
     57    'delete-convolved'  => \$delete_convolved_images,
    5758) or pod2usage( 2 );
    5859
     
    9293);
    9394
     95
    9496my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $stack_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    9597$| = 1;
     
    360362
    361363    if (!$quality) {
     364       
     365
    362366        check_outputs(\@outputFiles, $replicate_outputs);
     367
     368        if (($convolve)&&($delete_convolved_images)) { # We made convolved products, but do not wish to keep them anymore
     369            my @products_to_clear = ('PPSTACK.OUTPUT',
     370                                     'PPSTACK.OUTPUT.MASK',
     371                                     'PPSTACK.OUTPUT.VARIANCE',
     372                                     'PPSTACK.OUTPUT.EXP',
     373                                     'PPSTACK.OUTPUT.EXPNUM',
     374                                     'PPSTACK.OUTPUT.EXPWT');
     375            foreach my $product (@products_to_clear) {
     376                my $file = $ipprc->filename($product,$outroot,$skycell_id);
     377                print "Deleting unwanted convolved product: $file\n";
     378                my $error= $ipprc->kill_file($file);
     379                if ($error_code) {
     380                    print "Failed to delete unwanted convolved product: $error_code\n";
     381                }
     382            }
     383        }
     384
    363385    }
    364386
Note: See TracChangeset for help on using the changeset viewer.