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

    r8850 r8887  
    99use Data::Dumper;
    1010
     11use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     12use Pod::Usage qw( pod2usage );
     13
     14
    1115use constant STATISTIC => 'bg'; # Background statistic to use from the database
    1216
     17# Parse command-line arguments
     18my ($detId,   # Detrend id
     19    $iter      # Iteration
     20    );
     21GetOptions(
     22        'det_id|d=s'    => \$detId,
     23        'iteration|i=s' => \$iter,
     24        ) or pod2usage( 2 );
    1325
    14 # Parse the command-line
    15 die "Calculate the detrend normalisations.\n\n" .
    16     "Usage: $0 DET_ID ITER\n\n"
    17     if scalar @ARGV != 2;
    18 my $detId = shift @ARGV;        # Detrend ID
    19 my $iter = shift @ARGV;         # Iteration
     26pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     27pod2usage( -msg => "Required options --det_id --iteration",
     28           -exitval => 3,
     29         ) unless defined $detId
     30              and defined $iter;
    2031
     32
     33use constant STATISTIC => 'bg'; # Background statistic to use from the database
    2134
    2235# Look for programs we need
Note: See TracChangeset for help on using the changeset viewer.