Skip to content
Snippets Groups Projects
Commit 08a9fa8d authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

corr run_and_plot, persistence..py

parent 983aae48
Branches
Tags
No related merge requests found
......@@ -33,7 +33,7 @@ def get_simulation_DepthProbe():
"""
Returns custom simulation in the case of depth probe.
"""
simulation = example.get_simulation()
simulation = example.get_simulation(example.get_sample())
beam = simulation.beam()
wavelength = beam.wavelength()
incl_axis = simulation.getAlphaAxis()
......@@ -50,7 +50,7 @@ def get_simulation_RectangularGrating():
Returns custom simulation for RectangularGrating.py.
Contains smaller detector to make MC integration happy on all platforms
"""
simulation = example.get_simulation()
simulation = example.get_simulation(example.get_sample())
simulation.setDetectorParameters(5, -0.01*ba.deg, 0.01*ba.deg, 6, 0.0, 0.02*ba.deg)
return simulation
......@@ -61,7 +61,7 @@ def get_simulation_GenericExample():
The idea is that all other example's setting related to the simulation (MC integration flags,
threads settings etc) remains intact.
"""
simulation = example.get_simulation()
simulation = example.get_simulation(example.get_sample())
detector = simulation.detector()
# preserving axes range, making less bins
......@@ -107,11 +107,12 @@ def run_simulation():
# create minified simulation object
global simulationObject
simulationObject = get_minified_simulation()
simulation = get_minified_simulation()
# INJECTION HERE: replacing get_simulation() method of example with local method
example.get_simulation = adjusted_simulation
return example.run_simulation()
simulation.runSimulation()
return simulation.result()
def get_reffile_name(example_name):
......
......@@ -213,6 +213,6 @@ def plot_simulation_result(result, **kwargs):
if not (postpone_show):
plt.show()
def run_and_plot(simulation):
def run_and_plot(simulation, **kwargs):
simulation.runSimulation()
ba.plot_simulation_result(simulation.result())
plot_simulation_result(simulation.result(), **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment