예제 #1
0
    )
    # ^ load the EC data (no longer need to use rename_RGA_cols, parse_RGA_header, or timeshift)
    if EC_data["empty"]:
        print("WARNING: tag " + tag + " is empty!")
        continue

    dataset = synchronize([EC_data, MS_data], cut_buffer=120, append=False)
    # ^ combine the EC data with the MS data! To save memory, we don't keep all of the MS data:
    # Instead, we just keep the part that overlaps with the EC data, plus 120 s on either end.

    try:
        trigger_cal(dataset)
    except IndexError:
        print("WARNING!!! " + tag + " couldn't trigger_cal.")

    name = folder + "_" + tag
    with open("./pickles/" + name + ".pkl",
              "wb") as pkl:  # and save it as a pickle
        pickle.dump(dataset, pkl)

    # make the plot:
    ax = plot_experiment(
        dataset,
        tspan=
        "all",  # including this makes the plot include the MS data on the edges
    )
    ax[0].legend()
    ax[1].set_title(name)  # give it a title, so we know what's what
    # ax[0].legend(loc='lower left')
    plt.savefig("./overviews/" + name + ".png")  # and save it in overviews.
예제 #2
0
H2.F_cal = 2  # what it god damn should be. More accurate than that measured in calibration.py because of the tilt.
H2.cal_mat = {
    "M2": 1 / H2.F_cal,
    "M4": -0.0007 / H2.F_cal,
}  # gets rid of the background due to He double-ionization

with open("../pickles/20A31_18O_01.pkl", "rb") as f:
    data = pickle.load(f)

V_str, J_str = sync_metadata(data,
                             RE_vs_RHE=0.715,
                             A_el=0.196
                             # *1e-3, J_str='J / [$\mu$A cm$^{-2}$]'
                             )

plot_experiment(data, mols=mdict)
# a = b
if True:  # plot CO stripping experiment

    tspan_CO_strip = [9700, 10500]
    t_bg_abs = [9900, 9920]

    t_bg = [t - tspan_CO_strip[0] for t in t_bg_abs
            ]  # it should be relative to the start of the interval.

    data_strip = cut_dataset(data, tspan=tspan_CO_strip, t_zero="start")

    # correct_shunt(data_ox, V_DL=[0.4, 0.6]) # not needed because this dataset is f*****g beautiful.

    axes1 = plot_experiment(
        data_strip,
예제 #3
0
CO2_M44, CO2_M46, CO2_M48 = mdict["CO2_M44"], mdict["CO2_M46"], mdict["CO2_M48"]
H2, CO, He = mdict["H2"], mdict["CO"], mdict["He"]
H2.F_cal = 2  # what it god damn should be. More accurate than that measured in calibration.py because of the tilt.
H2.cal_mat = {
    "M2": 1 / H2.F_cal,
    "M4": -0.0007 / H2.F_cal,
}  # gets rid of the background due to He double-ionization


with open("./pickles/20A31_18O_01.pkl", "rb") as f:
    data = pickle.load(f)
V_str, J_str = sync_metadata(
    data, RE_vs_RHE=0.715, A_el=0.196  # *1e-3, J_str='J / [$\mu$A cm$^{-1}$]'
)
t_str = "time/s"
plot_experiment(data)

# get water isotope ratio from O2 signals
getgamma = True
if getgamma:
    # t_bg = [14700, 14750]
    # tspan_O2 = [15000, 16000]
    t_bg = [14650, 14750]
    tspan_O2 = [15400, 15500]
    Y = {}
    for mass in ["M32", "M34", "M36"]:
        x, y = mdict["O2_" + mass].get_flux(
            data, tspan=tspan_O2, unit="nmol/s", t_bg=t_bg
        )
        Y[mass] = np.mean(y)
    if False:  # complex way to do it
예제 #4
0
        He.F_cal = F_cal * ratio

        F = data_directory + folder
        pkl_file_name = [
            f for f in os.listdir(F) if f[0:2] == tag and f[-4:] == '.pkl'
        ][0]
        with open(F + os.sep + pkl_file_name, 'rb') as pkl:
            dataset = pickle.load(pkl)
        V_str, J_str = sync_metadata(dataset, RE_vs_RHE=RE_vs_RHE, A_el=A_el)
        trigger_cal(dataset)
        V_str = correct_ohmic_drop(dataset, R_ohm=R)
        make_selector(dataset)
        datasets[name] = dataset

        data = cut_dataset(dataset, tspan=tspan, t_zero='start')
        ax = plot_experiment(data, mols=mols, removebackground=False)
        #ax[0].set_ylim([1e-1, 3e2])
        plt.savefig('fig2_' + name + '.png')

    if False:  # zoom-in at 90 mV overpotential point
        x, y = mols[2].get_flux(datasets['Reshma1Bi'],
                                tspan=[2940, 3130],
                                unit='pmol/s')
        fig, ax = plt.subplots()
        ax.plot(x - 2965, y - np.mean(y[0:5]), 'g')
        ax.set_xlabel('time / s')
        ax.set_ylabel('flux / [pmol/s]')
        fig.set_figwidth(2)
        fig.set_figheight(1.5)
        fig.savefig('fig2b_inset')