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

    r42441 r42444  
    1313use Getopt::Long qw( GetOptions :config auto_help auto_version );
    1414
    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
     15# USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file) --stage (0,1,etc)
     16# USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt --stage 0
    1717
    1818my ($fulldate, $dateword, $chiplist, $stage, $topdir) = &parse_cmdopts;
     
    3131# output files:
    3232# instance lists by host: YYYYMMDD/HOSTNAME.inst.STAGE.txt
    33 # chip states by chip: YYYYMMDD/CHIPNAME.uris.txt
     33# chip states by chip: YYYYMMDD/CHIPNAME.uris.STAGE.txt
    3434
    3535foreach my $chip_id (@chip_ids) {
    3636
    3737    my $outfh;
    38     open ($outfh, ">$topdir/$dateword/$chip_id.uris.txt");
     38    open ($outfh, ">$topdir/$dateword/$chip_id.uris.$stage.txt");
    3939
    4040    # get the list of chip neb paths for one chip
     
    182182    my $sql_chip_instances = "SELECT uri, host, available, xattr, cab_id from instance join storage_object using (so_id) join volume using (vol_id) where ext_id = '$ext_id'";
    183183    my $rowref   = $neb_dbh->selectall_arrayref( $sql_chip_instances );
    184  
     184   
    185185    return ($rowref, $ext_id);
    186186}
     
    338338    pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir;
    339339   
     340    # check that stage is an integer
     341    unless (&is_integer ($stage)) { die "stage must be a non-negative integer\n"; }
     342    unless ($stage >= 0) { die "stage must be a non-negative integer\n"; }
     343
    340344    # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?)
    341345
     
    405409}
    406410
    407    
     411sub is_integer {
     412    defined $_[0] && $_[0] =~ /^[+-]?\d+$/;
     413}
     414
    408415# example of using the return value of arrayref:
    409416
Note: See TracChangeset for help on using the changeset viewer.