IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9185


Ignore:
Timestamp:
Oct 3, 2006, 6:00:02 PM (20 years ago)
Author:
Paul Price
Message:

Adding path support.

File:
1 edited

Legend:

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

    r9145 r9185  
    66use IPC::Cmd qw( can_run run );
    77use Data::Dumper;
     8
     9use PS::IPP::Config;
     10my $ipprc = PS::IPP::Config->new(); # IPP configuration
     11use File::Spec;
    812
    913use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    5155die "Can't find required tools.\n" if $missing_tools;
    5256
     57my ($vol, $dir, $file) = File::Spec->splitpath( $input );
     58$input = File::Spec->rel2abs( $input, $ipprc->workdir() );
     59
    5360# Output name
    5461my $outputRoot = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter; # Root output name
     62$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    5563my $output = $outputRoot . '.' . $classId . '.fits'; # Main output file
    5664my $b1name = $outputRoot . '.' . $classId . '.b1.fits'; # Output file with binning 1
     
    5866my $statsName = $outputRoot . '.' . $classId . '.stats'; # Statistics file
    5967
    60 # Run ppArith
     68# Run normalisation
    6169{
    6270    my $command = "$ppImage -file $input $outputRoot -norm $value -stat $statsName -recipe PPIMAGE " . RECIPE(); # Command to run
     
    8492}
    8593
    86 
    8794# Update the database
     95$output = File::Spec->abs2rel( $output, $ipprc->workdir() );
     96$b1name = File::Spec->abs2rel( $b1name, $ipprc->workdir() );
     97$b2name = File::Spec->abs2rel( $b2name, $ipprc->workdir() );
    8898unless ($no_update) {
    8999    my $command = "$dettool -addnormalizedimfile -det_id $detId -iteration $iter -class_id $classId ".
     
    102112    die "Unable to perform dettool -addnormalizedimfile: $error_code\n"
    103113        if not $success;
     114
     115    unlink $statsName;
    104116}
Note: See TracChangeset for help on using the changeset viewer.