IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 3, 2006, 3:44:37 PM (20 years ago)
Author:
Paul Price
Message:

Adding path support

File:
1 edited

Legend:

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

    r9099 r9166  
    1010use PS::IPP::Metadata::Config;
    1111use PS::IPP::Metadata::Stats;
     12
     13use PS::IPP::Config;
     14my $ipprc = PS::IPP::Config->new(); # IPP configuration
     15use File::Spec;
    1216
    1317use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    4246};
    4347
    44 use constant DELETE_STATS => 0; # Delete the statistics file when done?
    45 
    4648# Look for programs we need
    4749my $missing_tools;
     
    5557
    5658### Output file name --- must match camera configuration!
    57 my $outputRoot =  $exp_tag . '.detproc.' . $det_id;
    58 my $outputName = $outputRoot . '.' . $class_id ;
    59 my $outputImage = $outputName . '.fits';
    60 my $outputStats = $outputName . '.stats';
     59my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri );
     60my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root name
     61$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
     62$input_uri = File::Spec->rel2abs( $input_uri, $ipprc->workdir() );
     63my $outputImage = $outputRoot . '.' . $class_id . '.fits';
     64my $outputStats = $outputRoot . '.' . $class_id . '.stats';
    6165
    6266# Run ppImage
     
    8589}
    8690
     91# Take off the absolute path, to stuff into the database
     92$outputImage = File::Spec->abs2rel( $outputImage, $ipprc->workdir() );
     93
    8794# Add the processed file to the database
    8895unless ($no_update) {
     
    102109    die "Unable to perform dettool -addprocessedimfile for $det_id/$exp_tag/$class_id: $error_code\n"
    103110        if not $success;
     111
     112    unlink $outputStats;
    104113}
    105114
    106 unlink "$outputStats" if DELETE_STATS;
    107115
    108116__END__
Note: See TracChangeset for help on using the changeset viewer.