plt.rc("text", usetex=True) plt.rc("font", family="sans-serif") plt.rc("font", size=8) plt.rc("lines", linewidth=0.5) else: plt.style.use("default") extraction_dir = os.path.abspath( os.path.join(os.path.split(__file__)[0], "../extractions")) data_dir = os.path.abspath( os.path.join(os.path.split(__file__)[0], "../../pickles")) file_A = os.path.join(extraction_dir, "Jazz8_all.json") file_B = os.path.join(extraction_dir, "Jazz7_all.json") extraction_A = Extraction.load(file_A, data_dir=data_dir) # Ir^{18}O in H2^{16}O extraction_B = Extraction.load(file_B, data_dir=data_dir) # Ir^{18}O in H2^{16}O for extraction in [extraction_A, extraction_B]: if True: # correct H2 signal extraction.mdict["H2"].cal_mat["M4"] = ( -8.5e-4 * extraction.mdict["H2"].cal_mat["M2"]) if True: # correct calibration tspan_steady = extraction.tspan_ratio # extraction.tspan_ratio O2 = extraction.point_calibration(mol="O2", mass="M32", tspan=tspan_steady, n_el=4) # since we use cal_mat but point_calibration gives F_cal, this is the comparison # to make. We should then adjust such that it makes sense. correction = O2.F_cal * extraction.mdict["O2_M32"].cal_mat["M32"]
calibration_file = calibration_dir / "20A25_sniffer_fixed.json" mdict = mdict_from_SI2020_calibration_file(calibration_file) fig, ax1 = plt.subplots() ax2 = ax1.twinx() extractions = {} xticks = [] xticklabels = [] for name, spec in extraction_specs.items(): path_to_extraction = EXTRACTION_DIR / spec["file"] extraction = Extraction.load(path_to_extraction, data_dir=DATA_DIR, mdict=mdict) if "tspan_ratio" in spec: extraction.get_alpha(tspan=spec["tspan_ratio"], ax=None) extraction.tspan_ratio = spec["tspan_ratio"] if True: # correct calibration tspan_steady = extraction.tspan_ratio # extraction.tspan_ratio O2 = extraction.point_calibration(mol="O2", mass="M32", tspan=tspan_steady, n_el=4) # since we use cal_mat but point_calibration gives F_cal, this is the comparison # to make. We should then adjust such that it makes sense. correction = O2.F_cal / extraction.mdict["O2_M32"].F_cal
mpl.rcParams["figure.figsize"] = (3.25, 2.75) plt.rc("text", usetex=True) plt.rc("font", family="sans-serif") plt.rc("font", size=8) plt.rc("lines", linewidth=0.5) else: plt.style.use("default") extraction_dir = os.path.abspath( os.path.join(os.path.split(__file__)[0], "../extractions")) data_dir = os.path.abspath( os.path.join(os.path.split(__file__)[0], "../../pickles")) file = os.path.join(extraction_dir, "Jazz8b_all.json") extraction = Extraction.load(file, data_dir=data_dir) # Ir^{18}O2 in H2^{16}O if True: # correct H2 signal and ^{16}O^{18}O signal for CO, and ratio extraction.mdict["H2"].cal_mat["M4"] = ( -8.5e-4 * extraction.mdict["H2"].cal_mat["M2"]) extraction.mdict["O2_M34"].cal_mat["M28"] = ( -2.3e-5 * extraction.mdict["H2"].cal_mat["M2"]) extraction.set_background(t_bg=[60, 100]) # extraction.get_alpha(tspan=[750, 850], ax=None) if True: # correct calibration tspan_steady = extraction.tspan_ratio # extraction.tspan_ratio O2 = extraction.point_calibration(mol="O2", mass="M32", tspan=tspan_steady, n_el=4) # since we use cal_mat but point_calibration gives F_cal, this is the comparison
} extractions = {} # run_list = ["Decade1C_all", "Jazz8b_all"] run_list = "all" # run_list = ["Jazz7_all", "Jazz7_18O", "Jazz6_18O"] calibration_file = "20A25_sniffer_fixed.json" for name, spec in extraction_specs.items(): if not run_list == "all": if not name in run_list: continue spec.update(data_dir=data_dir, calibration_file=calibration_file, name=name) print(f"---------- working on {name} ------------") extraction = Extraction(**spec) extraction.sync_metadata(RE_vs_RHE=0.715, A_el=0.196) # extraction.get_alpha(simple=False, ax=None) # why was this here??? axes = extraction.plot_exchange(mol="O2") if True: # name in ["Decade1C_all", "Jazz8b_all"]: extraction.plot_flux(extraction.mdict["H2"], ax=axes[-1], unit="pmol/s") axes[-1].set_yscale("linear") extraction.plot_exchange(mol="CO2", axes=axes) axes[1].set_title(name) # plt.savefig(f"fig_Ir_extraction_{name}.png") # continue # extraction.plot_extraction_vs_potential(mol="CO2")
plt.rc("font", family="sans-serif") plt.rc("font", size=6) plt.rc("lines", linewidth=0.5) else: plt.style.use("default") extraction_dir = Path(r"../extractions").absolute() data_dir = Path(r"../../pickles").absolute() file_A = extraction_dir / "scanned.json" file_B = extraction_dir / "scanned_B.json" extraction_A = Extraction.load( file_A, data_dir=data_dir, mdict=mdict, ) # Pt^{18}O in H2^{16}O extraction_B = Extraction.load( file_B, data_dir=data_dir, mdict=mdict, ) # Pt^{18}O in H2^{16}O extraction_B.sort_time() extraction_A.timeshift(100) extraction_B.timeshift(350) tspan_experiment = [0, 1800] t_str = "time / [s]"
run_list = [ "scanned", "paused", "drift", # "scanned_B", "contaminated_B", "paused_B" ] run_list = "all" for name in extraction_specs.keys(): spec = extraction_specs[name] if not run_list == "all": if name not in run_list: continue spec.update(data_dir=data_dir, calibration_file=calibration_file) print(f"---------- working on {name} ------------") extraction = Extraction(**spec) extraction.plot_experiment(tspan="all") continue # continue # so that I can test just the Extraction initiation extraction.sync_metadata(RE_vs_RHE=0.715, A_el=0.196) # extraction.get_alpha(simple=False, ax=None) axes = extraction.plot_exchange(mol="O2") extraction.plot_exchange(mol="CO2", axes=axes) plt.savefig(f"fig_Pt_extraction_{name}.png") # extraction.plot_extraction_vs_potential(mol="CO2") # plt.savefig(f"fig_Pt_extraction_{name}_vs_U.png")