예제 #1
0
# data_dir = os.path.expanduser('~/o/FYSIK/list-SurfCat/setups/sniffer/Data/pc Cu') # linux
data_dir = r"C:\EC_data\scott\CO_and_lattice_O_project"  # Windows
# U:\FYSIK\list-SurfCat\setups\sniffer\Data\single_crystal_Cu\19J08_Ruben
MSset = {"comment": "20A30%"}  #'time':'2020-01-26%',
folder = "20A30_16O"

if not os.path.isdir("pickles"):
    os.mkdir("pickles")  # to put the synchronized data, as pickle files
if not os.path.isdir("overviews"):
    os.mkdir("overviews")  # to put the overview plots

# -------- first, we get all the MS data from the folder and combine it -------- #
if True:  # it's a bit slow...

    MS_data = download_cinfdata_set(**MSset)

    # now, as a sanity check, and to find our way around the experiment, we plot all of the MS data!
    ax = plot_signal(MS_data)
    ax.legend()
    plt.savefig("./overviews/" + folder +
                "_MS_data.png")  # and save it as an overview plot.

    # also, save the combined MS data as a pickle!
    with open("./pickles/" + folder + "_MS_data.pkl",
              "wb") as pkl:  # defines the file, 'wb' means 'write binary'.
        pickle.dump(MS_data, pkl)  # save MS_data into the file

# -------- Then, we load each EC experiment and combining it with MS data -------- #

# figure out which files correspond to EC data:
"""
Created on Thu Jun  6 14:01:33 2019

@author: scott
"""

import numpy as np
from matplotlib import pyplot as plt

from EC_MS import download_cinfdata_set, plot_signal, plot_signal_vs_temperature, compare_signal_to_temperature
from EC_MS import load_calibration_results
from EC_MS import plot_flux

plt.close('all')

data = download_cinfdata_set(setup='microreactorNG',
                             time='2019-06-25 09:52:30')

#plot_signal(data, leg=True, meta_data=['TC temperature'], rh_label='Temperature [C]')
#plot_signal_vs_temperature(data, leg=True, reciprocal=True)
compare_signal_to_temperature(MS_data=data)
plt.show()
exit()

mdict = load_calibration_results('19F04_calibration.pkl')

O2, CO2, CO, Ar = mdict['O2'], mdict['CO2'], mdict['CO'], mdict['Ar']

if True:  # take background from CO2 cracking into account when calculating CO flux
    # NOTE below on why cal_mat is used exactly this way.
    CO.cal_mat = {'M28': 1 / CO.F_cal}
    CO.cal_mat[
"""

from matplotlib import pyplot as plt

from EC_MS import download_cinfdata_set, plot_signal
from EC_MS import chip_calibration, point_calibration, recalibrate
from EC_MS import load_calibration_results, save_calibration_results

plt.close('all')


mdict = load_calibration_results('19B22_calibration.pkl')

O2 = mdict['O2']

data = download_cinfdata_set(setup='microreactorNG', time='2019-06-04 17:29:26')

plot_signal(data, leg=True)


chip = chip_calibration(data, mol=O2, gas='O2', composition=1, chip='microreactor', tspan=[8200, 8350])

chip.save('MR12')

print('\nAir flux through the chip in mol/s: ' + str(chip.capillary_flow(gas='air') / 6.02e23))


Ar = point_calibration(data, mol='Ar', mass='M40', cal_type='external', tspan=[10000, 10200], carrier='Ar', chip=chip)
CO = point_calibration(data, mol='CO', mass='M28', cal_type='external', tspan=[15400, 15600], carrier='CO', chip=chip)
H2 = point_calibration(data, mol='H2', mass='M2', cal_type='external', tspan=[20000, 20200], carrier='H2', chip=chip)
예제 #4
0
Created on Thu Jun  6 14:01:33 2019

@author: scott
"""

import numpy as np
from matplotlib import pyplot as plt

from EC_MS import download_cinfdata_set, plot_signal
from EC_MS import load_calibration_results
from EC_MS import plot_flux

#plt.close('all')


data = download_cinfdata_set(setup='microreactorNG', time='2019-06-05 13:11:18')

plot_signal(data, leg=True)


mdict = load_calibration_results('19F04_calibration.pkl')



O2, CO2, CO, Ar = mdict['O2'], mdict['CO2'], mdict['CO'], mdict['Ar']

if True: # take background from CO2 cracking into account when calculating CO flux
    # NOTE below on why cal_mat is used exactly this way.
    CO.cal_mat = {'M28':1/CO.F_cal}
    CO.cal_mat['M44'] = - CO.cal_mat['M28'] * CO2.spectrum['M28']/CO2.spectrum['M44']
예제 #5
0
from matplotlib import pyplot as plt

from EC_MS import download_cinfdata_set, plot_signal, plot_flux
from EC_MS import Chip, point_calibration, recalibrate
from EC_MS import save_calibration_results

plt.close('all')


chip = Chip('SI-3iv1-14-B4')

print('\nAir flux through the chip in mol/s: ' + str(chip.capillary_flow(gas='air') / 6.02e23))


data = download_cinfdata_set(setup='microreactorNG', time='2019-02-22 14:05:27', use_caching=True)


ax = plot_signal(data, unit='A')
ax.legend()


O2 = point_calibration(data, mol='O2', mass='M32', cal_type='external', tspan=[2000, 3000], carrier='air', chip=chip)
Ar = point_calibration(data, mol='Ar', mass='M40', cal_type='external', tspan=[2000, 3000], carrier='air', chip=chip)
N2 = point_calibration(data, mol='N2', mass='M28', cal_type='external', tspan=[2000, 3000], carrier='air', chip=chip)

quantify = {'CH4':'M15', 'CO2':'M44', 'CO':'M28',
            #'CH3OH':'M31'
            }

def T(M):