IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8578


Ignore:
Timestamp:
Aug 24, 2006, 3:53:25 PM (20 years ago)
Author:
Paul Price
Message:

Fixing file names.

File:
1 edited

Legend:

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

    r8490 r8578  
    1515    'dark' => 'PPIMAGE_OB',     # Overscan and bias only
    1616    'flat' => 'PPIMAGE_OBD',    # Overscan, bias and dark only
     17};
     18
     19use constant PREFIX => {
     20    'bias' => 'o',              # Overscan only
     21    'dark' => 'ob',             # Overscan and bias only
     22    'flat' => 'obd',            # Overscan, bias and dark only
    1723};
    1824
     
    4046my $recipe = RECIPES->{$detType};
    4147die "Unrecognised detrend type: $detType\n" if not defined $recipe;
     48die "Unrecognised detrend type: $detType\n" if not defined PREFIX->{$detType};
    4249
    4350### Output file name --- must match camera configuration!
    44 my $outputName = $output . "." . $classId . ".fit";
     51my $outputRoot =  PREFIX->{$detType} . '_' . $output;
     52my $outputName = $outputRoot . '.' . $classId ;
     53my $outputImage = $outputName . '.fit';
     54my $outputStats = $outputName . '.stats';
    4555
    4656# Run ppImage
    4757{
    48     my $command = "$ppImage -file $input $output -recipe PPIMAGE $recipe" .
    49         " -stat $output.stats"; # Command to run ppImage
     58    my $command = "$ppImage -file $input $outputRoot -recipe PPIMAGE $recipe" .
     59        " -stat $outputStats"; # Command to run ppImage
    5060    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    5161        run(command => $command, verbose => 1);
    5262    die "Unable to perform ppImage on $input: $error_code\n" if not $success;
    53     die "Couldn't find expected output file: $outputName\n" if not -f $outputName;
     63    die "Couldn't find expected output file: $outputImage\n" if not -f $outputImage;
    5464}
    5565
     
    5868{
    5969    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";
    6171    my @contents = <$statsFile>; # Contents of file
    6272    close $statsFile;
     
    6979# Add the processed file to the database
    7080{
    71     my $command = "dettool -addprocessed -det_id $detId -exp_id $expId " .
    72         "-class_id $classId -recipe $recipe -uri $outputName"; # Command to run dettool
     81    my $command = "$dettool -addprocessed -det_id $detId -exp_id $expId " .
     82        "-class_id $classId -recip $recipe -uri $outputImage"; # Command to run dettool
    7383    $command .= " -bg " . $stats->bg_mean();
    7484    $command .= " -bg_stdev " . $stats->bg_stdev();
     
    8191}
    8292
    83 unlink "$output.stats" if DELETE_STATS;
     93unlink "$outputStats" if DELETE_STATS;
    8494
    8595__END__
Note: See TracChangeset for help on using the changeset viewer.