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

PlotterSpecular + fct show(), + arg pause

parent 483c3721
No related branches found
No related tags found
1 merge request!1745refactor fit dirs and fit monitor
...@@ -145,8 +145,9 @@ class PlotterSpecular: ...@@ -145,8 +145,9 @@ class PlotterSpecular:
Draws fit progress, for specular simulation. Draws fit progress, for specular simulation.
""" """
def __init__(self, units=ba.Coords_UNDEFINED): def __init__(self, units=ba.Coords_UNDEFINED, pause=0.0):
self.units = units self.units = units
self.pause = pause
self._fig = plt.figure(figsize=(10, 7)) self._fig = plt.figure(figsize=(10, 7))
self._fig.canvas.draw() self._fig.canvas.draw()
...@@ -191,4 +192,8 @@ class PlotterSpecular: ...@@ -191,4 +192,8 @@ class PlotterSpecular:
plt.xlabel(xlabel, fontdict=font) plt.xlabel(xlabel, fontdict=font)
plt.ylabel("Intensity", fontdict=font) plt.ylabel("Intensity", fontdict=font)
if bp.do_show: if bp.do_show:
plt.pause(0.3) plt.pause(self.pause)
def show(self):
if bp.do_show:
plt.show()
...@@ -58,7 +58,7 @@ if __name__ == '__main__': ...@@ -58,7 +58,7 @@ if __name__ == '__main__':
fit_objective = ba.FitObjective() fit_objective = ba.FitObjective()
fit_objective.addSimulationAndData(get_simulation, exp_y, 1) fit_objective.addSimulationAndData(get_simulation, exp_y, 1)
plot_observer = ba_fitmonitor.PlotterSpecular() plot_observer = ba_fitmonitor.PlotterSpecular(pause=0.5)
fit_objective.initPrint(10) fit_objective.initPrint(10)
fit_objective.initPlot(10, plot_observer) fit_objective.initPlot(10, plot_observer)
...@@ -70,5 +70,4 @@ if __name__ == '__main__': ...@@ -70,5 +70,4 @@ if __name__ == '__main__':
fit_objective.finalize(result) fit_objective.finalize(result)
if ba.ba_plot.do_show: plot_observer.show()
plt.show()
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