Example #1
0
energy = np.linspace(np.log10(5), np.log10(100), 500)
energy = 10 ** energy

t_b = np.linspace(np.log10(1000), np.log10(100e3), 500)
t_b = 10 ** t_b

t_f = 0.1

feature_den = 1.35

sample = Composite(matrix_compound='H2O', matrix_density=0.92, feature_compound='H48.6C32.9N8.9O8.9S0.6',
                   feature_density=feature_den, matrix_eloss=39.3, feature_eloss=37.5, matrix_thickness=50,
                   feature_thickness=t_f, variable='t_b')
measure = Measurement(pixel_size=0.1, n_ccd=1024, working_distance=1e4)
simulator_thickness = CompositeSimulator(sample)
output = Output(sample, step=0.001)
output.t_b = t_b
output.t = t_b + t_f
simulator = CompositeSimulator(sample)

arr_zpc = np.zeros([t_b.size, energy.size])
arr_abs = np.zeros([t_b.size, energy.size])

for i, kev in enumerate(energy):
    print('energy = {}'.format(kev))
    x_beam = XrayBeam(kev)
    i_matrix, i_feature, i_ftf, i_btb, i_btf = simulator.get_xray_categories(x_beam, measure, output, return_aux=True)
    theta_zpc_complete = simulator.get_xray_theta_complete(i_matrix, i_feature, i_ftf, i_btb, i_btf, contrast_mode='zpc')
    theta_abs_complete = simulator.get_xray_theta_complete(i_matrix, i_feature, i_ftf, i_btb, i_btf, contrast_mode='abs')
    nprobe_x_zpc = 25. / theta_zpc_complete ** 2
Example #2
0
from sample import Composite
from measurement import *
from output import *

# grimm_jmic_1996 (1)
sample = Composite(matrix_compound='H2O',
                   matrix_density=0.92,
                   feature_compound='H48.6C32.9N8.9O8.9S0.6',
                   feature_density=1.35,
                   matrix_eloss=39.3,
                   feature_eloss=37.5,
                   matrix_thickness=0.1,
                   feature_thickness=0.004,
                   variable='none')
measure = Measurement(pixel_size=0.004, n_ccd=1024, working_distance=1e4)
simulator = CompositeSimulator(sample)
output_e = Output(sample, step=None, overflow_limit=11)
e_beam = ElectronBeam(120)
i_matrix, i_feature = simulator.get_e_categories(e_beam, measure, output_e)
simulator.get_e_dose(i_matrix, i_feature)

# grimm_jmic_1996 (2)
sample = Composite(matrix_compound='H2O',
                   matrix_density=0.92,
                   feature_compound='H48.6C32.9N8.9O8.9S0.6',
                   feature_density=1.35,
                   matrix_eloss=39.3,
                   feature_eloss=37.5,
                   matrix_thickness=0.1,
                   feature_thickness=0.0007,
                   variable='none')
Example #3
0
t_b = 0
step = 0.1
sample = Composite(matrix_compound='H2O',
                   matrix_density=0.92,
                   feature_compound='H48.6C32.9N8.9O8.9S0.6',
                   feature_density=1.35,
                   matrix_eloss=39.3,
                   feature_eloss=37.5,
                   matrix_thickness=t_b,
                   feature_thickness=t_f_max,
                   variable='t_f',
                   feature_alias='protein',
                   matrix_alias='ice')
# =============================================================================================

simulator = CompositeSimulator(sample)
output = Output(sample, step=step)
x_beam = XrayBeam(energy)
i_matrix, i_feature, i_ftf, i_btb, i_btf = simulator.get_xray_categories(
    x_beam, measure, output, return_aux=True)
theta_zpc_complete = simulator.get_xray_theta_complete(i_matrix,
                                                       i_feature,
                                                       i_ftf,
                                                       i_btb,
                                                       i_btf,
                                                       contrast_mode='zpc',
                                                       numerical=False)
theta_zpc_simple = simulator.get_xray_theta_simple(i_matrix,
                                                   i_feature,
                                                   contrast_mode='zpc')
theta_zpc_thin = simulator.get_xray_theta_thin(i_matrix,
# | ice + protein |  ice  | ice + protein |
# -----------------------------------------
# |             ice + protein             |
# |                                       |
# -----------------------------------------

# sample_protein = Composite(matrix_compound='H2O', matrix_density=0.92, feature_compound='H48.6C32.9N8.9O8.9S0.6',
#                      feature_density=feature_den, matrix_eloss=39.3, feature_eloss=37.5, matrix_thickness=50,
#                      feature_thickness=t_f, variable='t_b')
# sample_ice = Composite(matrix_compound='H2O', matrix_density=0.92, feature_compound='H2O',
#                      feature_density=0.92, matrix_eloss=39.3, feature_eloss=37.5, matrix_thickness=50,
#                      feature_thickness=t_f, variable='t_b')

measure = Measurement(pixel_size=t_f, n_ccd=1024, working_distance=1e4)

simulator_thickness_protein = CompositeSimulator(sample_protein)
output_protein = Output(sample_protein, step=0.001)
output_protein.t_b = t_b
output_protein.t = t_b + t_f
simulator_protein = CompositeSimulator(sample_protein)

simulator_thickness_ice = CompositeSimulator(sample_ice)
output_ice = Output(sample_ice, step=0.001)
output_ice.t_b = t_b
output_ice.t = t_b + t_f
simulator_ice = CompositeSimulator(sample_ice)

arr_zpc = np.zeros([t_b.size, energy.size])
arr_abs = np.zeros([t_b.size, energy.size])
n_zpc = np.zeros([t_b.size, energy.size])
n_abs = np.zeros([t_b.size, energy.size])