Ejemplo n.º 1
0
def profile_rows(sdata,rows):
     li = []
     for col in range (0,12):
         li.append(0)
         for row in range (0, len(rows)):
             wellname = rows[row] + str(col+1)
             welldata = clas.findRowByWellName(wellname, sdata)
             if welldata:
                 value = clas.getBBValue(welldata)
                 li[col] += value
         li[col] = round (li[col]/len(rows),3)
     return li
Ejemplo n.º 2
0
def profile_ToF(sdata):
     li = []
     for col in range (1,25):
         Hwell = 'H' + str(col)
         Iwell = 'I' + str(col)

         Hdata = clas.findRowByWellName(Hwell, sdata)
         Idata = clas.findRowByWellName(Iwell, sdata)

         H_val = clas.getBBToF (Hdata)
         I_val = clas.getBBToF (Idata)
         if H_val and I_val:
             avgval = round((H_val + I_val)/2,3)
             li.append(avgval)
     return li   
Ejemplo n.º 3
0
def findKernel2(flist, Ptype, Resin):
    AvgList = [
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    ]
    numfiles = 0
    if not (Ptype == 'BBV' or Ptype == 'Thk' or Ptype == 'BBV_Comp'):
        #        print ('Profile type not recognized.  Type is \'BBV\' or \'Thk' or \'BBV_Comp')
        return None
    for f in flist:
        if len(f) < 215:
            sdata = clas.ReadEchoPlateSurveyLisa(f, checkfilename=False)
            if Ptype == 'BBV':
                lis = plate.profile(sdata)
            elif Ptype == 'Thk':
                lis = plate.profile_Thk(sdata)
            elif Ptype == 'BBV_Comp':
                if Resin == 'PPL':
                    lis = plate.profile_corrBBVpp(sdata, PPL_fit, PPL_xlimits)
                if Resin == 'PPG':
                    lis = plate.profile_corrBBVpp(sdata, PPG_fit, PPG_xlimits)
            if (len(lis) == 24):
                numfiles += 1
                for l in range(0, len(lis)):
                    AvgList[l] += lis[l]
    for l in range(0, len(AvgList)):
        AvgList[l] = AvgList[l] / numfiles
        AvgList[l] = (round(AvgList[l], 4))
    return (AvgList)
Ejemplo n.º 4
0
def findKernel(flist, Ptype, Ncol):
    AvgList = [
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    ]
    AvgList = AvgList[0:Ncol]
    numfiles = 0
    Ptypes = ('BBV', 'Thk', 'BBV_Comp')
    if not Ptype in Ptypes:
        print("""Profile type not regognized.  Types are {0}, {1}, {2} """.
              format(Ptypes[0], Ptypes[1], Ptypes[2]))
        return None
    for f in flist:
        if len(f) < 215:
            sdata = clas.ReadEchoPlateSurveyLisa(f, checkfilename=False)
            if Ptype == 'BBV':
                lis = plate.profile(sdata)
            elif Ptype == 'Thk':
                lis = plate.profile_Thk(sdata)
            elif Ptype == 'BBV_Comp':
                lis = plate.profile_corrBBVpp(sdata, PPL_fit, PPL_xlimits)
            if (len(lis) == Ncol):
                numfiles += 1
                for l in range(0, len(lis)):
                    AvgList[l] += lis[l]
# divide by length of List:
    print(len(AvgList), 'AvgList length', numfiles, ' Files included')
    for l in range(0, len(AvgList)):
        AvgList[l] = AvgList[l] / numfiles
        AvgList[l] = (round(AvgList[l], 4))
    return (AvgList)
Ejemplo n.º 5
0
def findKernelN(flist, Ptype):
    AvgList = [
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    ]
    numfiles = 0
    if not (Ptype == 'BBV' or Ptype == 'Thk' or Ptype == 'BBV_Comp'):
        #        print ('Profile type not recognized.  Type is \'BBV\' or \'Thk' or \'BBV_Comp')
        return None
    for f in flist:
        if len(f) < 215:
            sdata = clas.ReadEchoPlateSurveyLisa(f, checkfilename=False)
            if Ptype == 'BBV':
                lis = plate.profile(sdata)
            elif Ptype == 'Thk':
                lis = plate.profile_Thk(sdata)
            elif Ptype == 'BBV_Comp':
                lis = plate.profile_corrBBVpp(sdata, PPL_fit, PPL_xlimits)
            if (len(lis) == 24):
                numfiles += 1
                for l in range(0, len(lis)):
                    AvgList[l] += lis[l]

# divide by length of List:
    for l in range(0, len(AvgList)):
        AvgList[l] = AvgList[l] / numfiles


#    return (AvgList)

#normalize list to mean = 1:
    listAve = np.mean(AvgList)
    for l in range(0, len(AvgList)):
        AvgList[l] = AvgList[l] / listAve
        AvgList[l] = (round(AvgList[l], 4))
    return (AvgList)
Ejemplo n.º 6
0
def profile_TBV(sdata):
    
     li = []
     for col in range (1,25):
         Hwell = 'H' + str(col)
         Iwell = 'I' + str(col)

         Hdata = clas.findRowByWellName(Hwell, sdata)
         Idata = clas.findRowByWellName(Iwell, sdata)

         H_Vpp = clas.getTBValue (Hdata)
         I_Vpp = clas.getTBValue (Idata)
#   print (H_Vpp, I_Vpp)   Test because not all platesurvey files contain all wells
         if H_Vpp and I_Vpp:
             avgVpp = round((H_Vpp + I_Vpp)/2,4)
             li.append(avgVpp)
     return li
Ejemplo n.º 7
0
def profile_ToF_12(sdata):
     li = []
     for col in range (1,13):
         Hwell = 'H' + str(col)
         Iwell = 'I' + str(col)

         Hdata = clas.findRowByWellName(Hwell, sdata)
         Idata = clas.findRowByWellName(Iwell, sdata)

         H_val = clas.getBBToF (Hdata)
         I_val = clas.getBBToF (Idata)
 #   print (H_Vpp, I_Vpp)  Test because not all platesurvey files contain all wells
         if H_val and I_val:
             avgval = round((H_val + I_val)/2,3)
             li.append(avgval)
         if H_val and not I_val:
             li.append(H_val)
     return li
Ejemplo n.º 8
0
def profile_Thk(sdata):
     li = []
     for col in range (1,25):
         Hwell = 'H' + str(col)
         Iwell = 'I' + str(col)

         Hdata = clas.findRowByWellName(Hwell, sdata)
         Idata = clas.findRowByWellName(Iwell, sdata)

         H_val = clas.getMembraneThickness (Hdata)
         I_val = clas.getMembraneThickness (Idata)
 #   print (H_Vpp, I_Vpp)  Test because not all platesurvey files contain all wells
         avgval = 0
         if H_val and I_val:
             avgval = round((H_val + I_val)/2,3)
         elif H_val:
             avgval = H_val
         elif I_val:
             avgval = I_val
         li.append(avgval)
     return li
Ejemplo n.º 9
0
def profile_corrBBVpp (sdata, fitFunction, xLimits):

    li = []
    scaleFactor = fitFunction(xLimits[1])

    for col in range (1,25):
        Hwell = 'H' + str(col)
        Iwell = 'I' + str(col)
        
        Hdata = clas.findRowByWellName(Hwell, sdata)
        Idata = clas.findRowByWellName(Iwell, sdata)

        if Hdata and Idata:

            H_BBToF = (clas.getBBToF (Hdata))
            I_BBToF = (clas.getBBToF (Hdata))
               
            HFactor = fitFunction(H_BBToF)
            IFactor = fitFunction(I_BBToF)
        
            Hraw = clas.getBBValue (Hdata)
            Iraw = clas.getBBValue (Idata)
        
            Hcorr = Hraw * scaleFactor/HFactor
            Icorr = Iraw * scaleFactor/IFactor
#       print (Hwell, Hraw, H_BBToF, scaleFactor, HFactor, Hcorr)
            avg_corr = round((Hcorr + Icorr)/2,4)
            li.append(avg_corr)
    return li
    
    
Ejemplo n.º 10
0
def profile(sdata):
    
     li = []; pctDeltaList = []
     for col in range (1,25):
         Hwell = 'H' + str(col)
         Iwell = 'I' + str(col)

         Hdata = clas.findRowByWellName(Hwell, sdata)
         Idata = clas.findRowByWellName(Iwell, sdata)

         H_Vpp = clas.getBBValue (Hdata)
         I_Vpp = clas.getBBValue (Idata)
#   print (H_Vpp, I_Vpp)   Test because not all platesurvey files contain all wells
         if H_Vpp and I_Vpp:
             avgVpp = round((H_Vpp + I_Vpp)/2,4)
             pctDelta = abs((H_Vpp - I_Vpp)/avgVpp); pctDeltaList.append (pctDelta)
             li.append(avgVpp)
         if H_Vpp and not I_Vpp:
              avgVpp = H_Vpp
              li.append(avgVpp)
#     maxPctDelta = max(pctDeltaList)  #;   print ("%.4f"%maxPctDelta, f)
     return li       #, maxPctDelta 
Ejemplo n.º 11
0
def profile_exclude_outliers(sdata,rows):
     li = []
     for col in range (0,12):
         li.append ([])
         for row in range (0, len(rows)):
             wellname = rows[row] + str(col+1)
             welldata = clas.findRowByWellName(wellname, sdata)
             if welldata:
                 value = clas.getBBValue(welldata)
                 li[col].append (value)
         wellMean = numpy.mean(li[col])
         fivesig = 5* numpy.std(li[col])
         if fivesig > wellMean:
             print (wellMean, f)
             li[col].remove(min(li[col]))
         for v in li[col]:             
                 oneError = abs((v - wellMean)/wellMean)
                 if oneError > (0.10):
#                     print (col, v)
                     li[col].remove(v)
         li[col] = numpy.mean(li[col])
#         li[col] = round (li[col]/len(rows),3)
     return li
Ejemplo n.º 12
0
def profile_imped(sdata):
    li = []
    for col in range (1,25):
         Hwell = 'H' + str(col)
         Iwell = 'I' + str(col)

         Hdata = clas.findRowByWellName(Hwell, sdata)
         Idata = clas.findRowByWellName(Iwell, sdata)

         H_num = clas.getTBValue (Hdata)
         I_num = clas.getTBValue (Idata)
         H_denom = clas.getBBValue(Hdata)
         I_denom = clas.getBBValue(Idata)
         if (H_num and I_num and H_denom and I_denom):           
             H_ratio = H_num/H_denom
             I_ratio = I_num/I_denom
             avgval = round((H_ratio + I_ratio)/2,3)
             li.append(avgval)
    return li