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

    r42457 r42462  
    1616# USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt --stage 0
    1717
    18 my ($fulldate, $dateword, $chiplist, $stage, $topdir) = &parse_cmdopts;
     18my ($fulldate, $dateword, $chiplist, $stage, $topdir, $basedir) = &parse_cmdopts;
    1919my ($neb_dbh, $gpc_dbh, $raw_dbh) = &parse_db_config ("$topdir/nebulous.config");
    2020
     
    2727
    2828# put output files in a directory defined by the night
    29 mkdir "$topdir/$dateword";
     29mkdir "$basedir/$dateword";
    3030
    3131# output files:
     
    4848my $Nfail = 0;
    4949
    50 my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($topdir, $dateword, $stage);
     50my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($basedir, $dateword, $stage);
    5151
    5252foreach my $chip_id (@chip_ids) {
    5353
    5454    my $outfh;
    55     open ($outfh, ">$topdir/$dateword/$chip_id.uris.$stage.txt");
    56 
    57     # print "open $topdir/$dateword/$chip_id.uris.$stage.txt\n";
     55    open ($outfh, ">$basedir/$dateword/$chip_id.uris.$stage.txt");
     56
     57    # print "open $basedir/$dateword/$chip_id.uris.$stage.txt\n";
    5858
    5959    # get the list of chip neb paths for one chip
     
    8787    # now save the host count for this chip
    8888    my $hostfh;
    89     open ($hostfh, ">$topdir/$dateword/$chip_id.hosts.txt");
     89    open ($hostfh, ">$basedir/$dateword/$chip_id.hosts.txt");
    9090
    9191    # save the host count for this chip
     
    277277
    278278        if (not defined $hostfile{$hostname}) {
    279             open ($hostfile{$hostname}, ">$topdir/$dateword/$hostname.inst.$stage.txt");
     279            open ($hostfile{$hostname}, ">$basedir/$dateword/$hostname.inst.$stage.txt");
    280280            ## XXX deal with open failure here
    281281        }
     
    408408sub get_good_or_fail_chiplists {
    409409
    410     my $topdir   = $_[0];
     410    my $basedir   = $_[0];
    411411    my $dateword = $_[1];
    412412    my $stage    = $_[2];
     
    414414    # load the lists of good and fail chips
    415415    my $prev = $stage - 1;
    416     my $goodfile = "$topdir/$dateword/goodchips.$prev.txt";
     416    my $goodfile = "$basedir/$dateword/goodchips.$prev.txt";
    417417    my %goodchips;
    418418    if (-e $goodfile) {
     
    426426        }
    427427    }
    428     my $failfile = "$topdir/$dateword/failchips.$prev.txt";
     428    my $failfile = "$basedir/$dateword/failchips.$prev.txt";
    429429    my %failchips;
    430430    if (-e $failfile) {
     
    466466    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    467467
    468     return ($fulldate, $dateword, $chiplist, $stage, $topdir)
     468    my $yearobs = substr ($dateword, 0, 4);
     469    my $basedir = "$topdir/$yearobs";
     470
     471    return ($fulldate, $dateword, $chiplist, $stage, $topdir, $basedir)
    469472}
    470473
Note: See TracChangeset for help on using the changeset viewer.