Commit 0b715613 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

unify local var name sample <- multi_layer etc

parent 925465c8
#!/usr/bin/env python3
"""
Compute radiation trajectories through multilayer sample
Compute radiation trajectories through sample sample
for use in figure that explains the Green function.
"""
......
# perform neutron reflectivity calculation for a lipid multilayer
# perform neutron reflectivity calculation for a lipid sample
import ba_anaklasis
project = 'lipid_multilayer'
project = 'lipid_sample'
patches = [1.0] # single laterally uniform layer
......
......@@ -45,13 +45,13 @@ def get_sample(ni_thickness, ti_thickness):
ni_layer = ba.Layer(m_ni, ni_thickness)
ti_layer = ba.Layer(m_ti, ti_thickness)
substrate_layer = ba.Layer(m_substrate)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
for _ in range(n_repetitions):
multi_layer.addLayer(ti_layer)
multi_layer.addLayer(ni_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample.addLayer(ti_layer)
sample.addLayer(ni_layer)
sample.addLayer(substrate_layer)
return sample
# Source the real data and add an uncertainty to the ordinate
......
......@@ -34,10 +34,10 @@ def get_sample(params):
vacuum_layer.addLayout(layout)
substrate_layer = ba.Layer(m_substrate, 0)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(params):
......
......@@ -82,7 +82,7 @@ def get_sample(params):
ptfe_layer = ba.Layer(m_PTFE, ptfe_thickness)
substrate_layer = ba.Layer(m_Si)
# assembling multilayer
# assembling sample
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayerWithTopRoughness(hmdso_layer, r_hmdso)
......
......@@ -35,10 +35,10 @@ def get_sample(params):
vacuum_layer = ba.Layer(m_vacuum)
vacuum_layer.addLayout(layout)
substrate_layer = ba.Layer(m_substrate, 0)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(params):
......
......@@ -33,10 +33,10 @@ def get_sample(params):
vacuum_layer.addLayout(layout)
substrate_layer = ba.Layer(m_substrate)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(params):
......
......@@ -44,13 +44,13 @@ def get_sample(params):
ni_layer = ba.Layer(m_ni, ni_thickness)
ti_layer = ba.Layer(m_ti, ti_thickness)
substrate_layer = ba.Layer(m_substrate)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
for _ in range(n_repetitions):
multi_layer.addLayer(ti_layer)
multi_layer.addLayer(ni_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample.addLayer(ti_layer)
sample.addLayer(ni_layer)
sample.addLayer(substrate_layer)
return sample
def get_real_data(filename):
......
......@@ -45,13 +45,13 @@ def get_sample(params):
r_si = ba.LayerRoughness(params["r_si/nm"])
r_pt = ba.LayerRoughness(params["r_pt/nm"])
multi_layer = ba.MultiLayer()
multi_layer.addLayer(ambient_layer)
multi_layer.addLayerWithTopRoughness(layer, r_pt)
sample = ba.MultiLayer()
sample.addLayer(ambient_layer)
sample.addLayerWithTopRoughness(layer, r_pt)
multi_layer.addLayerWithTopRoughness(substrate_layer, r_si)
sample.addLayerWithTopRoughness(substrate_layer, r_si)
return multi_layer
return sample
def get_simulation(q_axis, parameters):
......
......@@ -124,13 +124,13 @@ def buildSample(arg_dict):
oxide_layer = ba.Layer(m_si_o2, arg_dict["thickness"])
substrate_layer = ba.Layer(m_si)
# assembling multilayer
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayerWithTopRoughness(oxide_layer, r_si)
multi_layer.addLayerWithTopRoughness(substrate_layer, r_si)
# assembling sample
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayerWithTopRoughness(oxide_layer, r_si)
sample.addLayerWithTopRoughness(substrate_layer, r_si)
return multi_layer
return sample
def run_simulation(arg_dict, bin_start=0, bin_end=-1):
......
......@@ -69,11 +69,11 @@ def get_sample():
vacuum_layer.addLayout(particle_layout)
substrate_layer = ba.Layer(m_substrate)
# assemble multilayer
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
# assemble sample
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(sample):
......
......@@ -34,11 +34,11 @@ def get_sample(cyl_height=5*nm):
intermediate_layer.addLayout(particle_layout)
substrate_layer = ba.Layer(m_substrate)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(intermediate_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(intermediate_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(sample):
......
......@@ -45,10 +45,10 @@ def get_sample(lattice_rotation_angle=0*deg):
sigma, hurst, corrLength = 5*nm, 0.5, 10*nm
roughness = ba.LayerRoughness(sigma, hurst, corrLength)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayerWithTopRoughness(substrate_layer, roughness)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayerWithTopRoughness(substrate_layer, roughness)
return sample
def get_simulation(sample):
......
......@@ -46,10 +46,10 @@ def get_sample(lattice_rotation_angle=0*deg):
sigma, hurst, corrLength = 5*nm, 0.5, 10*nm
roughness = ba.LayerRoughness(sigma, hurst, corrLength)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayerWithTopRoughness(substrate_layer, roughness)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayerWithTopRoughness(substrate_layer, roughness)
return sample
def get_simulation(sample):
......
......@@ -33,10 +33,10 @@ def get_sample(cylinder_radius, cylinder_height):
substrate_layer = ba.Layer(m_substrate)
# Define sample
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(sample, integration_flag):
......
......@@ -36,10 +36,10 @@ def get_sample(hasVariance, xi):
l_substrate = ba.Layer(m_substrate)
# Define sample
multilayer = ba.MultiLayer()
multilayer.addLayer(l_air)
multilayer.addLayer(l_substrate)
return multilayer
sample = ba.MultiLayer()
sample.addLayer(l_air)
sample.addLayer(l_substrate)
return sample
def get_simulation(sample):
......
......@@ -43,10 +43,10 @@ def get_sample(lattice_rotation_angle=0*deg):
sigma, hurst, corrLength = 5*nm, 0.5, 10*nm
roughness = ba.LayerRoughness(sigma, hurst, corrLength)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayerWithTopRoughness(substrate_layer, roughness)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayerWithTopRoughness(substrate_layer, roughness)
return sample
def get_simulation(sample):
......
......@@ -30,10 +30,10 @@ def get_sample():
vacuum_layer.addLayout(particle_layout)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(vacuum_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
sample = ba.MultiLayer()
sample.addLayer(vacuum_layer)
sample.addLayer(substrate_layer)
return sample
def get_simulation(sample):
......
......@@ -40,14 +40,14 @@ def get_sample(*, magnetization=magnetizationVector):
roughness = ba.LayerRoughness(20*angstrom)
# create sample
multi_layer = ba.MultiLayer()
sample = ba.MultiLayer()
multi_layer.addLayer(layer_vacuum)
multi_layer.addLayerWithTopRoughness(layer_Pd, roughness)
multi_layer.addLayerWithTopRoughness(layer_Fe, roughness)
multi_layer.addLayerWithTopRoughness(layer_substrate, roughness)
sample.addLayer(layer_vacuum)
sample.addLayerWithTopRoughness(layer_Pd, roughness)
sample.addLayerWithTopRoughness(layer_Fe, roughness)
sample.addLayerWithTopRoughness(layer_substrate, roughness)
return multi_layer
return sample
def get_simulation(sample, scan_size=1500):
......
......@@ -55,12 +55,12 @@ def get_sample(params):
r_Mafo = ba.LayerRoughness(params["r_Mafo"]*angstrom)
r_substrate = ba.LayerRoughness(params["r_Mao"]*angstrom)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(ambient_layer)
multi_layer.addLayerWithTopRoughness(layer, r_Mafo)
multi_layer.addLayerWithTopRoughness(substrate_layer, r_substrate)
sample = ba.MultiLayer()
sample.addLayer(ambient_layer)
sample.addLayerWithTopRoughness(layer, r_Mafo)
sample.addLayerWithTopRoughness(substrate_layer, r_substrate)
return multi_layer
return sample
def get_simulation(sample, q_axis, parameters, polarizer_dir, analyzer_dir):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment