Changeset 9166
- Timestamp:
- Oct 3, 2006, 3:44:37 PM (20 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 2 edited
-
detrend_process_imfile.pl (modified) (5 diffs)
-
phase0_imfile.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_process_imfile.pl
r9099 r9166 10 10 use PS::IPP::Metadata::Config; 11 11 use PS::IPP::Metadata::Stats; 12 13 use PS::IPP::Config; 14 my $ipprc = PS::IPP::Config->new(); # IPP configuration 15 use File::Spec; 12 16 13 17 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 42 46 }; 43 47 44 use constant DELETE_STATS => 0; # Delete the statistics file when done?45 46 48 # Look for programs we need 47 49 my $missing_tools; … … 55 57 56 58 ### 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'; 59 my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri ); 60 my $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() ); 63 my $outputImage = $outputRoot . '.' . $class_id . '.fits'; 64 my $outputStats = $outputRoot . '.' . $class_id . '.stats'; 61 65 62 66 # Run ppImage … … 85 89 } 86 90 91 # Take off the absolute path, to stuff into the database 92 $outputImage = File::Spec->abs2rel( $outputImage, $ipprc->workdir() ); 93 87 94 # Add the processed file to the database 88 95 unless ($no_update) { … … 102 109 die "Unable to perform dettool -addprocessedimfile for $det_id/$exp_tag/$class_id: $error_code\n" 103 110 if not $success; 111 112 unlink $outputStats; 104 113 } 105 114 106 unlink "$outputStats" if DELETE_STATS;107 115 108 116 __END__ -
trunk/ippScripts/scripts/phase0_imfile.pl
r9098 r9166 11 11 use PS::IPP::Metadata::Stats; 12 12 use Data::Dumper; 13 14 use PS::IPP::Config; 15 my $ipprc = PS::IPP::Config->new(); # IPP configuration 16 use File::Spec; 13 17 14 18 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 31 35 and defined $class_id 32 36 and defined $uri; 33 34 # XXX the uri should be processed either here or by ppImage35 my $file = $uri;36 37 37 38 use constant RECIPE => "PPSTATS_PHASE0"; # Recipe to use for ppStats … … 72 73 die "Can't find required tools.\n" if $missing_tools; 73 74 75 # Resolve the input URI 76 $uri = File::Spec->rel2abs( $uri, $ipprc->workdir() ); 77 74 78 # Run ppStats on the input file 75 79 my $stats; 76 80 { 77 my $command = "$ppStats $ file-recipe PPSTATS " . RECIPE; # Command to run ppStats81 my $command = "$ppStats $uri -recipe PPSTATS " . RECIPE; # Command to run ppStats 78 82 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 79 83 run(command => $command, verbose => 1);
Note:
See TracChangeset
for help on using the changeset viewer.
