IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 12, 2023, 9:21:20 AM (3 years ago)
Author:
eugene
Message:

changing directory structure to place nights in years

File:
1 edited

Legend:

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

    r42452 r42462  
    1414# USAGE: check_md5s_dateobs.pl --dateobs (night) --topdir (topdir)
    1515
    16 my ($dateword, $stage, $topdir) = &parse_cmdopts;
    17 
    18 my $instlist_r = &load_instlist_filenames ($topdir, $dateword, $stage);
    19 my $md5slist_r = &load_md5slist_filenames ($topdir, $dateword, $stage, $instlist_r);
     16my ($dateword, $stage, $topdir, $basedir) = &parse_cmdopts;
     17# basedir used only for night-level files
     18
     19my $instlist_r = &load_instlist_filenames ($basedir, $dateword, $stage);
     20my $md5slist_r = &load_md5slist_filenames ($basedir, $dateword, $stage, $instlist_r);
    2021
    2122my $Nfail = 0;
     
    3637    close (FILE);
    3738
    38     my $instdata_r = &load_instance_list ($topdir, $dateword, $stage, $instfile);
     39    my $instdata_r = &load_instance_list ($basedir, $dateword, $stage, $instfile);
    3940
    4041    # if these do not match, complain and move on
     
    9495
    9596# save both good and fail chip lists
    96 open (OUTFILE, ">$topdir/$dateword/goodchips.$stage.txt");
     97open (OUTFILE, ">$basedir/$dateword/goodchips.$stage.txt");
    9798my @goodchipURIs = keys %goodchips;
    9899foreach my $uri (@goodchipURIs) {
     
    101102close (OUTFILE);
    102103
    103 open (OUTFILE, ">$topdir/$dateword/failchips.$stage.txt");
     104open (OUTFILE, ">$basedir/$dateword/failchips.$stage.txt");
    104105my @failchipURIs = keys %failchips;
    105106foreach my $uri (@failchipURIs) {
     
    120121}
    121122
    122 # use global $topdir, $dateword, $myhost, $stage
     123# use global $basedir, $dateword, $myhost, $stage
    123124sub load_instance_list {
    124     my $topdir   = $_[0];
     125    my $basedir   = $_[0];
    125126    my $dateword = $_[1];
    126127    my $stage    = $_[2];
     
    134135    # there may be additional instances in files with names like HOSTNAME.XYnn.inst.STAGE
    135136    my ($myhost) = $instfile =~ m|$dateword/([0-9a-zA-Z]*).inst.$stage.txt|;
    136     my @instlist = glob ("$topdir/$dateword/$myhost.XY??.inst.$stage.txt");
     137    my @instlist = glob ("$basedir/$dateword/$myhost.XY??.inst.$stage.txt");
    137138    foreach my $infile  (@instlist) {
    138139        &load_instance_list_onefile ($infile, \@instdata_list);
     
    160161sub load_instlist_filenames {
    161162   
    162     my $topdir   = $_[0];
     163    my $basedir   = $_[0];
    163164    my $dateword = $_[1];
    164165    my $stage    = $_[2];
    165166
    166     my @instlist_all = glob ("$topdir/$dateword/*.inst.$stage.txt");
     167    my @instlist_all = glob ("$basedir/$dateword/*.inst.$stage.txt");
    167168
    168169    my @instlist = ();
     
    181182sub load_md5slist_filenames {
    182183
    183     my $topdir     = $_[0];
     184    my $basedir     = $_[0];
    184185    my $dateword   = $_[1];
    185186    my $stage      = $_[2];
    186187    my $instlist_r = $_[3];
    187188
    188     my @md5slist = glob ("$topdir/$dateword/*.md5s.txt");
     189    my @md5slist = glob ("$basedir/$dateword/*.md5s.txt");
    189190
    190191    my %md5shash;
     
    252253    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    253254
    254     return ($dateword, $stage, $topdir);
     255    my $yearobs = substr ($dateword, 0, 4);
     256    my $basedir = "$topdir/$yearobs";
     257
     258    return ($dateword, $stage, $topdir, $basedir);
    255259}
    256260
Note: See TracChangeset for help on using the changeset viewer.