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/fix_chip_locations.pl

    r42451 r42462  
    1818# for each chip, target a single host?
    1919
    20 my ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir) = &parse_cmdopts;
     20my ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir, $basedir) = &parse_cmdopts;
    2121my ($neb_dbh, $raw_dbh) = &parse_db_config ("$topdir/nebulous.config");
     22# topdir used for nebulous.config and chiplist.txt, basedir used for night-level data
    2223
    2324# choose ITC machines on which to place backup copies:
     
    4041my $Nfail = 0;
    4142
    42 my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($topdir, $dateword, $stage);
     43my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($basedir, $dateword, $stage);
    4344
    4445# read the list of chip_ids:
     
    8081} else {
    8182
    82     open (OUTFILE, ">$topdir/$dateword/$chipID.stats.$stage.txt");
     83    open (OUTFILE, ">$basedir/$dateword/$chipID.stats.$stage.txt");
    8384
    8485    print OUTFILE "Nchip: $Nchip\n";
     
    106107
    107108    # read from chip_id file, update to next stage number
    108     my $urifile = "$topdir/$dateword/$chip_id.uris.$stage.txt";
     109    my $urifile = "$basedir/$dateword/$chip_id.uris.$stage.txt";
    109110    if (! -e $urifile) { die "missing file $urifile\n"; }
    110111    open (URIFILE,  $urifile);
     
    145146            my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
    146147            unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    147             open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");
     148            open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt");
    148149            print OUTFILE "$newfile $datast $md5sum\n";
    149150            close (OUTFILE);
     
    160161            my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
    161162            unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    162             open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");
     163            open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt");
    163164            print OUTFILE "$newfile $datast $md5sum\n";
    164165            close (OUTFILE);
     
    175176                my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
    176177                unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    177                 open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");
     178                open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt");
    178179                print OUTFILE "$newfile $datast $md5sum\n";
    179180                close (OUTFILE);
     
    197198                my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id);
    198199                unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    199                 open (OUTFILE, ">>$topdir/$dateword/$newhost.$chip_id.inst.$stage.txt");
     200                open (OUTFILE, ">>$basedir/$dateword/$newhost.$chip_id.inst.$stage.txt");
    200201                print OUTFILE "$newfile $datast $md5sum\n";
    201202                close (OUTFILE);
     
    327328sub get_good_or_fail_chiplists {
    328329
    329     my $topdir   = $_[0];
     330    my $basedir   = $_[0];
    330331    my $dateword = $_[1];
    331332    my $stage    = $_[2];
     
    333334    # load the lists of good and fail chips
    334335    my $prev = $stage - 1;
    335     my $goodfile = "$topdir/$dateword/goodchips.$prev.txt";
     336    my $goodfile = "$basedir/$dateword/goodchips.$prev.txt";
    336337    my %goodchips;
    337338    if (-e $goodfile) {
     
    345346        }
    346347    }
    347     my $failfile = "$topdir/$dateword/failchips.$prev.txt";
     348    my $failfile = "$basedir/$dateword/failchips.$prev.txt";
    348349    my %failchips;
    349350    if (-e $failfile) {
     
    464465    my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day);
    465466
    466     return ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir);
     467    my ($yearobs) = substr ($dateword, 0, 4);
     468    my $basedir = "$topdir/$yearobs";
     469
     470    return ($fulldate, $dateword, $chiplist, $chipID, $stage, $topdir, $basedir);
    467471}
    468472
Note: See TracChangeset for help on using the changeset viewer.