IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 3, 2006, 5:47:25 PM (20 years ago)
Author:
Paul Price
Message:

Adding path handling.

File:
1 edited

Legend:

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

    r9145 r9180  
    1111use PS::IPP::Metadata::List qw( parse_md_list );
    1212use PS::IPP::Metadata::Stats;
     13
     14use PS::IPP::Config;
     15my $ipprc = PS::IPP::Config->new(); # IPP configuration
     16use File::Spec;
    1317
    1418use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    7377}
    7478
     79my $example = ${$files}[0]->{uri}; # Example file
     80my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     81
    7582# Stack the files
    7683my $outputRoot = $camera . '.' . $det_type . '.' . $det_id . '.' . $iter . '.' . $class_id; # Root name
     84$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    7785my $outputStack = $outputRoot . '.fits'; # Output name
    7886my $outputStats = $outputRoot . '.stats'; # Statistics name
     
    8189    foreach my $file (@$files) {
    8290        my $uri = $file->{uri}; # URI for input file
     91        $uri = File::Spec->rel2abs( $uri, $ipprc->workdir() );
    8392        $command .= ' ' . $uri;
    8493    }
     
    93102    die "Unable to find expected output file: $outputStats\n" if not -f $outputStats;
    94103}
    95 
    96 ### Could do some sort of JPEG generation here.
    97104
    98105# Get the statistics on the stacked image
     
    112119
    113120# Add the resultant into the database
     121$outputStack = File::Spec->abs2rel( $outputStack, $ipprc->workdir() );
    114122unless ($no_update) {
    115123    my $command = "$dettool -addstacked -det_id $det_id -iteration $iter -class_id $class_id" .
Note: See TracChangeset for help on using the changeset viewer.