Changeset 8578
- Timestamp:
- Aug 24, 2006, 3:53:25 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_process.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_process.pl
r8490 r8578 15 15 'dark' => 'PPIMAGE_OB', # Overscan and bias only 16 16 'flat' => 'PPIMAGE_OBD', # Overscan, bias and dark only 17 }; 18 19 use constant PREFIX => { 20 'bias' => 'o', # Overscan only 21 'dark' => 'ob', # Overscan and bias only 22 'flat' => 'obd', # Overscan, bias and dark only 17 23 }; 18 24 … … 40 46 my $recipe = RECIPES->{$detType}; 41 47 die "Unrecognised detrend type: $detType\n" if not defined $recipe; 48 die "Unrecognised detrend type: $detType\n" if not defined PREFIX->{$detType}; 42 49 43 50 ### Output file name --- must match camera configuration! 44 my $outputName = $output . "." . $classId . ".fit"; 51 my $outputRoot = PREFIX->{$detType} . '_' . $output; 52 my $outputName = $outputRoot . '.' . $classId ; 53 my $outputImage = $outputName . '.fit'; 54 my $outputStats = $outputName . '.stats'; 45 55 46 56 # Run ppImage 47 57 { 48 my $command = "$ppImage -file $input $output -recipe PPIMAGE $recipe" .49 " -stat $output .stats"; # Command to run ppImage58 my $command = "$ppImage -file $input $outputRoot -recipe PPIMAGE $recipe" . 59 " -stat $outputStats"; # Command to run ppImage 50 60 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 51 61 run(command => $command, verbose => 1); 52 62 die "Unable to perform ppImage on $input: $error_code\n" if not $success; 53 die "Couldn't find expected output file: $output Name\n" if not -f $outputName;63 die "Couldn't find expected output file: $outputImage\n" if not -f $outputImage; 54 64 } 55 65 … … 58 68 { 59 69 my $statsFile; # File handle 60 open $statsFile, "$output .stats" or die "Can't open statistics file $output.stats: $!\n";70 open $statsFile, "$outputStats" or die "Can't open statistics file $outputStats: $!\n"; 61 71 my @contents = <$statsFile>; # Contents of file 62 72 close $statsFile; … … 69 79 # Add the processed file to the database 70 80 { 71 my $command = " dettool -addprocessed -det_id $detId -exp_id $expId " .72 "-class_id $classId -recip e $recipe -uri $outputName"; # Command to run dettool81 my $command = "$dettool -addprocessed -det_id $detId -exp_id $expId " . 82 "-class_id $classId -recip $recipe -uri $outputImage"; # Command to run dettool 73 83 $command .= " -bg " . $stats->bg_mean(); 74 84 $command .= " -bg_stdev " . $stats->bg_stdev(); … … 81 91 } 82 92 83 unlink "$output .stats" if DELETE_STATS;93 unlink "$outputStats" if DELETE_STATS; 84 94 85 95 __END__
Note:
See TracChangeset
for help on using the changeset viewer.
