IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9180


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

Adding path handling.

Location:
trunk/ippScripts/scripts
Files:
2 edited

Legend:

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

    r9145 r9180  
    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 );
     
    8488}
    8589
     90my $example = ${$files}[0]->{b1_uri}; # Example filename
     91my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     92
    8693# Generate the file list, and get the statistics
    8794my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root output name
     95$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    8896my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
    8997my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
     
    93101open my $list2File, '>' . $list2Name;
    94102foreach my $file (@$files) {
    95     print $list1File $file->{b1_uri} . "\n";
    96     print $list2File $file->{b2_uri} . "\n";
     103    print $list1File File::Spec->rel2abs( $file->{b1_uri}, $ipprc->workdir() ) . "\n";
     104    print $list2File File::Spec->rel2abs( $file->{b2_uri}, $ipprc->workdir() ) . "\n";
    97105    push @means, $file->{bg};
    98106    push @stdevs, $file->{bg_stdev};
     
    121129}
    122130
     131
    123132# Add the result into the database
     133$outputRoot = File::Spec->abs2rel( $outputRoot, $ipprc->workdir() );
    124134unless ($no_update) {
    125135    my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag " .
  • 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.