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_stack.pl

    r8983 r9004  
    1515use Pod::Usage qw( pod2usage );
    1616
    17 my ($det_id, $iter, $class_id, $det_type);
     17my ($det_id, $iter, $class_id, $det_type, $camera);
    1818GetOptions(
    1919    'det_id|d=s'        => \$det_id,
     
    2121    'class_id|i=s'      => \$class_id,
    2222    'det_type|t=s'      => \$det_type,
     23    'camera|c=s'        => \$camera,
    2324) or pod2usage( 2 );
    2425
    2526pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2627pod2usage(
    27     -msg => "Required options: --det_id --iteration --class_id --det_type",
     28    -msg => "Required options: --det_id --iteration --class_id --det_type --camera",
    2829    -exitval => 3,
    2930) unless defined $det_id
    3031    and defined $iter
    3132    and defined $class_id
    32     and defined $det_type;
     33    and defined $det_type
     34    and defined $camera;
    3335
    3436# Recipes to use as a function of detrend type
     
    4446    'dark' => 0,
    4547    'flat' => 1
    46     };   
     48    };
    4749
    48 die "Unrecognised detrend type: $det_type\n" if not defined RECIPES()->{$det_type};
     50die "Unrecognised detrend type: $det_type\n" if not defined RECIPES()->{$det_type}
     51                                             or not defined NORMALISE()->{$det_type};
    4952my $recipe = RECIPES()->{$det_type}; # Recipe to use in stacking
    5053
     
    7073
    7174# Stack the files
    72 my $output = $det_type . '_' . $class_id . '_' . $det_id . '_' . $iter . '.fit'; # Output name
    73 my $outputStats = $det_type . '_' . $class_id . '_' . $det_id . '_' . $iter . '.stats'; # Statistics name
     75my $outputRoot = $camera . '.' . $det_type . '.' . $det_id . '.' . $iter . '.' . $class_id; # Root name
     76my $outputStack = $outputRoot . '.fits'; # Output name
     77my $outputStats = $outputRoot . '.stats'; # Statistics name
    7478{
    75     my $command = "$ppMerge $output"; # Command to run
     79    my $command = "$ppMerge $outputStack"; # Command to run
    7680    foreach my $file (@$files) {
    7781        my $uri = $file->{uri}; # URI for input file
     
    8589        run(command => $command, verbose => 1);
    8690    die "Unable to perform ppMerge: $error_code\n" if not $success;
    87     die "Unable to find expected output file: $output\n" if not -f $output;
     91    die "Unable to find expected output file: $outputStack\n" if not -f $outputStack;
    8892    die "Unable to find expected output file: $outputStats\n" if not -f $outputStats;
    8993}
     
    109113{
    110114    my $command = "$dettool -addstacked -det_id $det_id -iteration $iter -class_id $class_id" .
    111         " -uri $output -recip $recipe"; # Command to run
     115        " -uri $outputStack -recip $recipe"; # Command to run
    112116    $command .= ' -bg ' . $stats->bg_mean();
    113117    if (defined($stats->bg_stdev())) {
Note: See TracChangeset for help on using the changeset viewer.