Пример #1
0
def test_readGamry():
    f, Z = readGamry(os.path.join(directory, example_files['gamry']))
    f_abort, Z_abort = readGamry(
        os.path.join(directory, example_files['gamry_abort']))

    assert (f == f_gamry).all() and (Z == Z_gamry).all()
    assert (f_abort == f_gamry).all() and (Z_abort == Z_gamry).all()
def file_select(
):  #Allows the user to select EIS data to load in the calculator. Exports real and imaginary impedence
    filename = filedialog.askopenfilename(filetypes=[("BioLogic or Gamry",
                                                      ".mpr .DTA")])
    if ".mpr" in filename:
        mpr_file = BioLogic.MPRfile(filename)
        df = pd.DataFrame(mpr_file.data)
        freq = df.iloc[:, 0]
        real_imp = df.iloc[:, 1]
        img_imp = df.iloc[:, 2]
        Z = []
        for i in range(len(real_imp)):
            Z.append(complex(float(real_imp[i]), -1 * float(img_imp[i])))
        Z = np.array(Z)
        freq = np.array(freq)

    if ".DTA" in filename:
        freq, Z = preprocessing.readGamry(filename)
    return Z, freq
Пример #3
0
def test_readGamry():

    f, Z = readGamry('./data/Chalco-in-buffer-50mV.DTA')

    assert (f == f_gamry).all() and (Z == Z_gamry).all()