def test_ei_marrs(): """ based on Marrs experimental EI CSs # reference EI cross section represented as # [charge state, electron energy, reference cross section cm2]""" ei_reference = { 'Mo': [[41, 31500, 15.9E-24], [41, 36100, 21.2E-24], [41, 64800, 30.8E-24], [41, 95600, 34.7E-24]] } error_list = [] elem = csd.get_element_data('Mo') error_list = [ abs(csd.ei_lotz_cs(elem, case[0], case[1]) - case[2]) / case[2] for case in ei_reference['Mo'] ]
def test_rr_trzhaskovskaya(): """" based on Trzhaskovskaya calculated RR CSs reference RR cross section represented as [charge state, electron energy, reference cross section cm2]""" rr_reference = { 'Fe': [[8, 2964.00, 1.040E-23], [8, 9645.96, 1.1780E-24], [8, 15464.38, 4.797E-25], [8, 31391.56, 1.2E-25], [8, 50326.87, 4.632E-26], [16, 2964.00, 5.267E-23], [16, 9645.96, 6.551E-24], [16, 15464.38, 2.698E-24], [16, 31391.56, 6.786E-25], [16, 50326.87, 2.622E-25], [24, 2964.00, 2.304E-22], [24, 9645.96, 3.022E-23], [24, 15464.38, 1.268E-23], [24, 31391.56, 3.261E-24], [24, 50326.87, 1.272E-24], [26, 2964.00, 7.076E-22], [26, 9645.96, 1.291E-22], [26, 15464.38, 6.088E-23], [26, 31391.56, 1.790E-23], [26, 50326.87, 7.427E-24]] } elem = csd.get_element_data('Fe') error_list = [ abs(csd.rr_pk_cs(elem, case[0], case[1]) - case[2]) / case[2] for case in rr_reference['Fe'] ]
import numpy as np from bokeh.palettes import Category20_20 as palette # import bokeh palette for from bokeh.plotting import show from scipy.integrate import odeint # import odeint to integrate system of ODE from bokeh.models import ColumnDataSource, Label, LabelSet import numba import csd #uncommet for Jupyter notebook use #from bokeh.io import push_notebook, show, output_notebook #output_notebook() # -----------------------define simulation variables startTime = datetime.now() ELEMENT_NAME = 'Au' ELEM = csd.get_element_data(ELEMENT_NAME) ch_states = np.linspace(0, len(ELEM), len(ELEM) + 1) # define charge states ENERGY = 32500 # electron energy eV IP = 13.6 # ionization potential of rest gas P_VAC = 1E-10 # vacuum pressure mbar J = 5000 # A/cm2 T_ion = 300 # ion temperature in eV # ------------------ define time independent reaction rates----------------- rates = csd.get_reaction_rates(elem=ELEM, j_e=J, e_e=ENERGY, t_ion=T_ion, p_vac=P_VAC, ip=IP, ch_states=ch_states) #--------------- define initial conditions and time frame----------------
def test_element_stat(): """ based on Watanabe and Marrs papers on H-like Molybdenum""" elem = csd.get_element_data('Ar') shell_data = csd.shell_stat(elem, 0) assert shell_data == [3, 18, 8]
def test_hydrogen(): """test importing data from elements.json""" elem = csd.get_element_data('H') assert elem[0]['1s']['E'] == pytest.approx(13.5984487)