IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2023, 2:05:41 PM (3 years ago)
Author:
eugene
Message:

adding advance task, fix the logs

File:
1 edited

Legend:

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

    r42415 r42430  
    1313use Getopt::Long qw( GetOptions :config auto_help auto_version );
    1414
    15 # USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file)
    16 # USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt
    17 
    18 my ($fulldate, $dateword, $chiplist) = &parse_cmdopts;
     15# USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc)
     16# USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt --stage v0
     17
     18my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts;
    1919my ($neb_dbh, $gpc_dbh) = &parse_db_config ('nebulous.config');
    2020
     
    3030
    3131# output files:
    32 # instance lists by host: YYYYMMDD/HOSTNAME.inst.txt
     32# instance lists by host: YYYYMMDD/HOSTNAME.inst.STAGE.txt
    3333# chip states by chip: YYYYMMDD/CHIPNAME.uris.txt
    3434
     
    7979    my @hostnames = keys %hostcount;
    8080    foreach my $myname (@hostnames) {
    81         print $hostfh "host $myname = $hostcount{$myname}\n";
     81        print $hostfh "$myname $hostcount{$myname}\n";
    8282    }
    8383    close ($hostfh);
     
    231231
    232232        if (not defined $hostfile{$hostname}) {
    233             open ($hostfile{$hostname}, ">$dateword/$hostname.inst.txt");
     233            open ($hostfile{$hostname}, ">$dateword/$hostname.inst.$stage.txt");
    234234            ## XXX deal with open failure here
    235235        }
     
    330330sub parse_cmdopts {
    331331
    332     my ($dateobs, $chiplist);
    333     GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist) || pod2usage(2);
     332    my ($dateobs, $chiplist, $stage);
     333    GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2);
    334334   
    335335    pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs;
    336336    pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist;
     337    pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage;
    337338   
    338339    # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
     
    343344    pod2usage( -msg => "Cannot interpret date, use YYYY/MM/DD", -exitval => 2) if ($date_month < 1) or ($date_month > 12);
    344345    pod2usage( -msg => "Cannot interpret date, use YYYY/MM/DD", -exitval => 2) if ($date_day < 1) or ($date_day > 31);
     346
    345347    my $fulldate = "$date_year/$date_month/$date_day";
    346    
    347348    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    348349
    349     return ($fulldate, $dateword, $chiplist)
     350    return ($fulldate, $dateword, $chiplist, $stage)
    350351}
    351352
Note: See TracChangeset for help on using the changeset viewer.