IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 13, 2023, 2:17:26 PM (3 years ago)
Author:
eugene
Message:

better handle fail chips (bad md5sum)

File:
1 edited

Legend:

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

    r42449 r42450  
    2424my @vol_copy = &get_neb_volumes_copy; # array of neb hosts to copy data to at ITC
    2525my %vol_good = &get_neb_volumes_good; # hash of valid neb hosts
     26
     27my $Nchip = 0; # counts the number of instances
    2628
    2729my $Ngood = 0;
     
    3840my $Nfail = 0;
    3941
    40 my $Nchip = 0; # counts the number of instances
    41 
    42 # load the lists of good and fail chips
    43 my $prev = $stage - 1;
    44 my $goodfile = "$topdir/$dateword/goodchips.$prev.txt";
    45 my %goodchips;
    46 if (-e $goodfile) {
    47     open (GOODFILE,  $goodfile);
    48     my @lines = <GOODFILE>;
    49     close (GOODFILE);
    50    
    51     foreach my $line (@lines) {
    52         chomp $line;
    53         $goodchips{$line} = 1;
    54     }
    55 }
    56 my $failfile = "$topdir/$dateword/failchips.$prev.txt";
    57 my %failchips;
    58 if (-e $failfile) {
    59     open (FAILFILE,  $failfile);
    60     my @lines = <FAILFILE>;
    61     close (FAILFILE);
    62    
    63     foreach my $line (@lines) {
    64         chomp $line;
    65         $failchips{$line} = 1;
    66     }
    67 }
     42my ($goodchips_r, $failchips_r) = &get_good_or_fail_chiplists ($topdir, $dateword, $stage);
    6843
    6944# read the list of chip_ids:
     
    153128        my $haveMD5 = 0;
    154129        my $goodMD5 = 0;
    155         if ($goodchips{$ext_id}) { $haveMD5 = 1; $goodMD5 = 1; }
    156         if ($failchips{$ext_id}) { $haveMD5 = 1; }
     130        if ($goodchips_r->{$ext_id}) { $haveMD5 = 1; $goodMD5 = 1; }
     131        if ($failchips_r->{$ext_id}) { $haveMD5 = 1; $goodMD5 = 0; }
    157132
    158133        $Nchip ++;
     
    350325}
    351326
     327sub get_good_or_fail_chiplists {
     328
     329    my $topdir   = $_[0];
     330    my $dateword = $_[1];
     331    my $stage    = $_[2];
     332
     333    # load the lists of good and fail chips
     334    my $prev = $stage - 1;
     335    my $goodfile = "$topdir/$dateword/goodchips.$prev.txt";
     336    my %goodchips;
     337    if (-e $goodfile) {
     338        open (GOODFILE,  $goodfile);
     339        my @lines = <GOODFILE>;
     340        close (GOODFILE);
     341       
     342        foreach my $line (@lines) {
     343            chomp $line;
     344            $goodchips{$line} = 1;
     345        }
     346    }
     347    my $failfile = "$topdir/$dateword/failchips.$prev.txt";
     348    my %failchips;
     349    if (-e $failfile) {
     350        open (FAILFILE,  $failfile);
     351        my @lines = <FAILFILE>;
     352        close (FAILFILE);
     353       
     354        foreach my $line (@lines) {
     355            chomp $line;
     356            $failchips{$line} = 1;
     357        }
     358    }
     359    return (\%goodchips, \%failchips);
     360}
     361
    352362# get the list of neb hosts to copy data to at ITC
    353363sub get_neb_volumes_copy {
Note: See TracChangeset for help on using the changeset viewer.