IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 27, 2006, 9:35:47 AM (20 years ago)
Author:
Paul Price
Message:

Changing name conventions to match those in doc/ippTools/filenames.txt

File:
1 edited

Legend:

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

    r8983 r9004  
    1616
    1717my ($det_id, $iter, $exp_id, $class_id, $det_type, $detrend,
    18         $input_uri, $output_uri);
     18        $input_uri);
    1919GetOptions(
    2020    'det_id|d=s'        => \$det_id,
     
    2525    'detrend=s'         => \$detrend,
    2626    'input_uri|u=s'     => \$input_uri,
    27     'output_uri|o=s'    => \$output_uri,
    2827) or pod2usage( 2 );
    2928
    3029pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3130pod2usage(
    32     -msg => "Required options: --det_id --iteration --exp_id --class_id --det_type --detrend --input_uri --output_uri",
     31    -msg => "Required options: --det_id --iteration --exp_id --class_id --det_type --detrend --input_uri",
    3332    -exitval => 3,
    3433) unless defined $det_id
     
    3837    and defined $det_type
    3938    and defined $detrend
    40     and defined $input_uri
    41     and defined $output_uri;
     39    and defined $input_uri;
    4240
    4341# Recipes to use, as a function of the detrend type
     
    5351    'dark' => '-dark',          # Specify the dark frame
    5452    'flat' => '-flat',          # Specify the flat frame
    55 };
    56 
    57 # Prefix to add to filenames
    58 use constant PREFIX => {
    59     'bias' => 'ob',             # Overscan only
    60     'dark' => 'obd',            # Overscan and bias only
    61     'flat' => 'obdf',           # Overscan, bias and dark only
    6253};
    6354
     
    7768my $detFlag = DETRENDS->{$det_type};
    7869die "Unrecognised detrend type: $det_type\n" if not defined $detFlag;
    79 # Prefix to use for filename
    80 my $prefix = PREFIX->{$det_type};
    81 die  "Unrecognised detrend type: $det_type\n" if not defined $prefix;
    8270
    8371### Output file names --- must match camera configuration!
    84 my $outputRoot = $prefix . '_' . $output_uri;
    85 my $outputName = $outputRoot . '.' . $class_id . '.fit';
     72my $outputRoot = $exp_id . '.detresid.' . $det_id . '.' . $iter; # Root name
     73my $outputName = $outputRoot . '.' . $class_id . '.fits'; # Name for
    8674my $outputStats = $outputRoot . '.' . $class_id . '.stats';
    87 my $bin1Name = $outputRoot . '.' . $class_id . '.b1.fit';
    88 my $bin2Name =  $outputRoot . '.' . $class_id . '.b2.fit';
     75my $bin1Name = $outputRoot . '.' . $class_id . '.b1.fits';
     76my $bin2Name =  $outputRoot . '.' . $class_id . '.b2.fits';
    8977
    9078# Run ppImage
     
    9684    die "Unable to perform ppImage on $input_uri: $error_code\n" if not $success;
    9785    die "Couldn't find expected output file: $outputName\n" if not -f $outputName;
     86    die "Couldn't find expected output file: $outputStats\n" if not -f $outputStats;
    9887    die "Couldn't find expected output file: $bin1Name\n" if not -f $bin1Name;
    9988    die "Couldn't find expected output file: $bin2Name\n" if not -f $bin2Name;
     
    10493{
    10594    my $statsFile;              # File handle
    106     open $statsFile, "$outputStats" or die "Can't open statistics file $outputStats: $!\n";
     95    open $statsFile, $outputStats or die "Can't open statistics file $outputStats: $!\n";
    10796    my @contents = <$statsFile>; # Contents of file
    10897    close $statsFile;
     
    134123}
    135124
    136 unlink "$output_uri.stats" if DELETE_STATS;
     125unlink $outputStats if DELETE_STATS;
    137126
    138127__END__
Note: See TracChangeset for help on using the changeset viewer.