Exemplo n.º 1
0
def analyse(data):
    config = data.config
    vcc = data.vcc
    m = data.measurements
    grouped = segmented_measurements(m, ["charge", "R"], as_index=1)

    def voltage(measurement):
        return u_an2v(measurement.Amiddle, vcc)

    def first(ls):
        return ls.values[0]

    def last(ls):
        return ls.values[-1]

    t = grouped["t"].agg(dict(t1=first, t2=last))
    A = grouped["Amiddle"].agg(dict(A1=first, A2=last))
    mreg = DataFrame([(charge, R, regc(g, R)) for (charge, R), g in grouped], columns=["charge", "R", "Creg"])

    df = A.join(t)
    df = df.reset_index()

    df = df[df["charge"] == 0]
    del df["charge"]

    col = ColsProxy(df)

    col.Creg = mreg["Creg"]
    col.dt = col.t2 - col.t1
    col.C = calculate_c(col.A1, col.A2, col.R, col.t1, col.t2)

    movecol(df, "Creg", 0)
    movecol(df, "C", 0)

    return df
Exemplo n.º 2
0
def analyse(data):
    config = data.config
    vcc = data.vcc

    m = filter_measurements(data.measurements, ['B', 'C', 'E', 'polarity'],
                            ['Ab', 'Ac'])
    calculate_beta(m, vcc)
    movecol(m, 'beta', 0)
    m = m.sort_index(by='polarity')
    candidates = m[np.logical_and(m.Ube > 0.1, m.Ube < 1)]
    s = candidates.groupby(['polarity', 'B'], sort=False).size()
    ok = s[s == 2]
    if len(ok) == 1:
        polarity, B = ok.index[0]
        m = m[np.logical_and(m.polarity == polarity, m.B == B)]

    del m['Ue']
    del m['Urc']
    del m['Urb']
    del m['Ub']
    del m['Uc']
    del m['Ab']
    del m['Ac']
    del m['t']
    #     del m['Ib']
    del m['Ic']
    del m['Ie']
    del m['Rb']
    del m['Rc']

    return m
Exemplo n.º 3
0
def analyse(data):
    config = data.config
    vcc = data.vcc

    m = filter_measurements(
            data.measurements,
            ['B', 'C', 'E', 'polarity'],
            ['Ab', 'Ac'])
    calculate_beta(m, vcc)
    movecol(m, 'beta', 0)
    m = m.sort_index(by='polarity')
    candidates = m[np.logical_and(m.Ube > 0.1, m.Ube < 1)]
    s = candidates.groupby(['polarity', 'B'], sort=False).size()
    ok = s[s==2]
    if len(ok)==1:
        polarity,B=ok.index[0]
        m=m[np.logical_and(m.polarity==polarity,m.B==B)]
 
    del m['Ue']
    del m['Urc']
    del m['Urb']
    del m['Ub']
    del m['Uc']
    del m['Ab']
    del m['Ac']
    del m['t']
#     del m['Ib']
    del m['Ic']
    del m['Ie']
    del m['Rb']
    del m['Rc']
         
    return m
Exemplo n.º 4
0
def analyse(data):
    config = data.config
    vcc = data.vcc
    m = data.measurements
    grouped = segmented_measurements(m, ['charge', 'R'], as_index=1)

    def voltage(measurement):
        return u_an2v(measurement.Amiddle, vcc)

    def first(ls):
        return ls.values[0]

    def last(ls):
        return ls.values[-1]

    t = grouped['t'].agg(dict(t1=first, t2=last))
    A = grouped['Amiddle'].agg(dict(A1=first, A2=last))
    mreg = DataFrame([(charge, R, regc(g, R)) for (charge, R), g in grouped],
                     columns=['charge', 'R', 'Creg'])

    df = A.join(t)
    df = df.reset_index()

    df = df[df['charge'] == 0]
    del df['charge']

    col = ColsProxy(df)

    col.Creg = mreg['Creg']
    col.dt = col.t2 - col.t1
    col.C = calculate_c(col.A1, col.A2, col.R, col.t1, col.t2)

    movecol(df, 'Creg', 0)
    movecol(df, 'C', 0)

    return df