IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 22, 2006, 11:45:02 AM (20 years ago)
Author:
Paul Price
Message:

Moving detrend_calc_norm.pl and detrend_apply_norm.pl to use GetOpt::Long

File:
1 edited

Legend:

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

    r8856 r8887  
    99use Data::Dumper;
    1010
     11use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     12use Pod::Usage qw( pod2usage );
     13
    1114# Parse the command-line
    12 die "Apply the detrend normalisations.\n\n" .
    13     "Usage: $0 DET_ID ITER CLASS_ID MULTIPLICATION_VALUE INPUT OUTPUT\n\n"
    14     if scalar @ARGV != 6;
    15 my $detId = shift @ARGV;        # Detrend ID
    16 my $iter = shift @ARGV;         # Iteration
    17 my $classId = shift @ARGV;      # Class ID
    18 my $value = shift @ARGV;        # Value to multiply
    19 my $input = shift @ARGV;        # Input file
    20 my $output = shift @ARGV;       # Output file
     15my ($detId,                     # Detrend ID
     16    $iter,                      # Iteration
     17    $classId,                   # Class ID
     18    $value,                     # Value to multiple (for normalisation)
     19    $input,                     # Input file
     20    $output                     # Output file
     21    );
     22GetOptions(
     23    'det_id|d=s'        => \$detId,
     24    'iteration|n=s'     => \$iter,
     25    'class_id|i=s'      => \$classId,
     26    'value|v=s'         => \$value,
     27    'input_uri|u=s'     => \$input,
     28    'output_uri|o=s'    => \$output,
     29    ) or pod2usage( 2 );
     30   
     31pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     32pod2usage(     -msg => "Required options: --det_id --iteration --class_id --value --input_uri --output_uri",
     33    -exitval => 3,
     34    ) unless defined $detId
     35        and defined $iter
     36            and defined $classId
     37                and defined $value
     38                    and defined $input
     39                        and defined $output;
     40                       
    2141
    2242# Look for programs we need
Note: See TracChangeset for help on using the changeset viewer.