IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2023, 6:00:06 PM (3 years ago)
Author:
eugene
Message:

big re-work to allow repeat, iterated fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/check_night_status.pl

    r42415 r42444  
    1111use Getopt::Long qw( GetOptions :config auto_help auto_version );
    1212
    13 # USAGE: check_night_status.pl --dateobs (night) --chiplist (file)
     13# USAGE: check_night_status.pl --dateobs (night) --chiplist (file) --stage (0,1,etc)
    1414
    1515# we need to select targets for ITC copies of files currently only at ATRC:
     
    1717# for each chip, target a single host?
    1818
    19 my ($fulldate, $dateword, $chiplist) = &parse_cmdopts;
     19my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts;
    2020
    2121# read the list of chip_ids:
     
    3636foreach my $chip_id (@chip_ids) {
    3737
    38     my $urifile = "$dateword/$chip_id.uris.txt";
     38    my $urifile = "$dateword/$chip_id.uris.$stage.txt";
    3939    open (FILE, "$urifile");
    4040    my @lines = <FILE>;
     
    110110sub parse_cmdopts {
    111111
    112     my ($dateobs, $chiplist);
    113     GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist) || pod2usage(2);
     112    my ($dateobs, $chiplist, $stage);
     113    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2);
    114114   
    115115    pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
    116116    pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
     117    pod2usage( -msg => "Define the stage (0, 1, etc) with --stage", -exitval => 2) unless defined $stage;
     118   
     119    # check that stage is an integer
     120    unless (is_integer ($stage)) { die "stage must be a non-negative integer\n"; }
     121    unless ($stage >= 0) { die "stage must be a non-negative integer\n"; }
     122
    117123   
    118124    # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
     
    127133    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    128134
    129     return ($fulldate, $dateword, $chiplist);
     135    return ($fulldate, $dateword, $chiplist, $stage);
    130136}
    131137
     138
     139sub is_integer {
     140   defined $_[0] && $_[0] =~ /^[+-]?\d+$/;
     141}
     142   
Note: See TracChangeset for help on using the changeset viewer.