IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9166


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

Adding path support

Location:
trunk/ippScripts/scripts
Files:
2 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__
  • trunk/ippScripts/scripts/phase0_imfile.pl

    r9098 r9166  
    1111use PS::IPP::Metadata::Stats;
    1212use Data::Dumper;
     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 );
     
    3135    and defined $class_id
    3236    and defined $uri;
    33 
    34 # XXX the uri should be processed either here or by ppImage
    35 my $file = $uri;
    3637
    3738use constant RECIPE => "PPSTATS_PHASE0"; # Recipe to use for ppStats
     
    7273die "Can't find required tools.\n" if $missing_tools;
    7374
     75# Resolve the input URI
     76$uri = File::Spec->rel2abs( $uri, $ipprc->workdir() );
     77
    7478# Run ppStats on the input file
    7579my $stats;
    7680{
    77     my $command = "$ppStats $file -recipe PPSTATS " . RECIPE; # Command to run ppStats
     81    my $command = "$ppStats $uri -recipe PPSTATS " . RECIPE; # Command to run ppStats
    7882    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    7983        run(command => $command, verbose => 1);
Note: See TracChangeset for help on using the changeset viewer.