IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9233


Ignore:
Timestamp:
Oct 4, 2006, 12:40:28 PM (20 years ago)
Author:
Paul Price
Message:

Adding path support.

File:
1 edited

Legend:

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

    r9145 r9233  
    1111use PS::IPP::Metadata::List qw( parse_md_list );
    1212use Statistics::Descriptive;
     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 );
     
    8892}
    8993
     94my $example = ${$files}[0];     # Example file, for path
     95my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     96
    9097# Generate the file list, and get the statistics
    9198my $outputRoot = $camera . '.' . $det_type . '.norm.' . $det_id . '.' . $iter; # Root output name
     99$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    92100my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
    93101my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
     
    97105open my $list2File, '>' . $list2Name;
    98106foreach my $file (@$files) {
    99     print $list1File $file->{b1_uri} . "\n";
    100     print $list2File $file->{b2_uri} . "\n";
     107    print $list1File File::Spec-->rel2abs( $file->{b1_uri}, $ipprc->workdir() ) . "\n";
     108    print $list2File File::Spec-->rel2abs( $file->{b2_uri}, $ipprc->workdir() ) . "\n";
    101109    push @means, $file->{bg};
    102110    push @stdevs, $file->{bg_stdev};
     
    126134
    127135# Add the result into the database
     136$jpeg1Name = File::Spec->abs2rel( $jpeg1Name, $ipprc->workdir() );
     137$jpeg2Name = File::Spec->abs2rel( $jpeg2Name, $ipprc->workdir() );
    128138unless ($no_update) {
    129139    my $command = "$dettool -addnormexp -det_id $det_id -iteration $iter " .
     
    133143        run(command => $command, verbose => 1);
    134144    die "Unable to perform dettool -addnormexp: $error_code\n" if not $success;
     145
     146    unlink $list1File;
     147    unlink $list2File;
    135148}
    136149
Note: See TracChangeset for help on using the changeset viewer.