Skip to content
Snippets Groups Projects
Commit 2cb7c75f authored by Yurov, Dmitry's avatar Yurov, Dmitry
Browse files

Add time of flight reflectometry to PyPersitence

parent 40d3bb7b
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,6 @@ import numpy as np
import bornagain as ba
from bornagain import angstrom
qzs = np.linspace(0.01, 1.0, 500, dtype=float) # qz-values
def get_sample():
"""
......@@ -44,27 +42,29 @@ def get_sample():
return multi_layer
def get_simulation():
def get_simulation(scan_size=500):
"""
Defines and returns specular simulation
with a qz-defined beam
"""
qzs = np.linspace(0.01, 1.0, scan_size, dtype=float) # qz-values
scan = ba.QSpecScan(qzs)
simulation = ba.SpecularSimulation()
simulation.setScan(scan)
return simulation
def run_simulation(simulation):
def run_simulation():
"""
Runs simulation and returns its result.
"""
sample = get_sample()
simulation = get_simulation()
simulation.setSample(sample)
simulation.runSimulation()
return simulation.result()
if __name__ == '__main__':
result = run_simulation(get_simulation())
result = run_simulation()
ba.plot_simulation_result(result)
......@@ -59,6 +59,7 @@ test_example("simulation/ex05_BeamAndDetector/ConstantBackground" 2e-10)
test_example("simulation/ex06_Reflectometry/BasicSpecularSimulation" 2e-10)
test_example("simulation/ex06_Reflectometry/BeamAngularDivergence" 2e-10)
test_example("simulation/ex06_Reflectometry/BeamFullDivergence" 2e-10)
test_example("simulation/ex06_Reflectometry/TimeOfFlightReflectometry" 2e-10)
test_example("simulation/ex07_Miscellaneous/CylindersInAverageLayer" 2e-10)
test_example("simulation/ex07_Miscellaneous/DepthProbe" 2e-10)
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment