diff --git a/auto/Examples/fit/scatter2d/fit_along_slices.py b/auto/Examples/fit/scatter2d/fit_along_slices.py index 6d90bb0b86f5286b2d425a238b3f0b051ec599fc..cd2c292d659b762df2f8d4329576d807ced45155 100755 --- a/auto/Examples/fit/scatter2d/fit_along_slices.py +++ b/auto/Examples/fit/scatter2d/fit_along_slices.py @@ -28,7 +28,7 @@ def get_masked_simulation(P): return simulation -def create_real_data(): +def fake_data(): """ Generating "real" data by adding noise to the simulated data. """ @@ -57,7 +57,7 @@ class PlotObserver: self.update(fit_objective) @staticmethod - def plot_real_data(data): + def plot_data(data): """ Plot experimental data as heatmap with horizontal/vertical lines representing slices on top. @@ -121,15 +121,15 @@ class PlotObserver: """ self.fig.clf() - real_data = fit_objective.experimentalData() + data = fit_objective.experimentalData() simul_data = fit_objective.simulationResult() # plot real data plt.subplot(2, 2, 1) - self.plot_real_data(real_data) + self.plot_data(data) # horizontal slices - slices = [("real", real_data.xProjection(alpha_slice_value)), + slices = [("real", data.xProjection(alpha_slice_value)), ("simul", simul_data.xProjection(alpha_slice_value))] title = ("Horizontal slice at alpha =" + '{:3.1f}'.format(alpha_slice_value)) @@ -137,7 +137,7 @@ class PlotObserver: self.plot_slices(slices, title) # vertical slices - slices = [("real", real_data.yProjection(phi_slice_value)), + slices = [("real", data.yProjection(phi_slice_value)), ("simul", simul_data.yProjection(phi_slice_value))] title = "Vertical slice at phi =" + '{:3.1f}'.format( phi_slice_value) @@ -154,13 +154,13 @@ def run_fitting(): main function to run fitting """ - real_data = create_real_data() + data = fake_data() fit_objective = ba.FitObjective() - fit_objective.addSimulationAndData(get_masked_simulation, real_data, 1) + fit_objective.addSimulationAndData(get_masked_simulation, data, 1) fit_objective.initPrint(10) - # creating custom observer which will draw fit progress + # creating custom observer which will draw fit progress plotter = PlotObserver() fit_objective.initPlot(10, plotter) diff --git a/auto/MiniExamples/fit/scatter2d/fit_along_slices.py b/auto/MiniExamples/fit/scatter2d/fit_along_slices.py index c4d3b3fd4573a6baade358e61182b87115e61bec..7b1ae23e3973ecceaf028d116b203132be427576 100755 --- a/auto/MiniExamples/fit/scatter2d/fit_along_slices.py +++ b/auto/MiniExamples/fit/scatter2d/fit_along_slices.py @@ -28,7 +28,7 @@ def get_masked_simulation(P): return simulation -def create_real_data(): +def fake_data(): """ Generating "real" data by adding noise to the simulated data. """ @@ -57,7 +57,7 @@ class PlotObserver: self.update(fit_objective) @staticmethod - def plot_real_data(data): + def plot_data(data): """ Plot experimental data as heatmap with horizontal/vertical lines representing slices on top. @@ -121,15 +121,15 @@ class PlotObserver: """ self.fig.clf() - real_data = fit_objective.experimentalData() + data = fit_objective.experimentalData() simul_data = fit_objective.simulationResult() # plot real data plt.subplot(2, 2, 1) - self.plot_real_data(real_data) + self.plot_data(data) # horizontal slices - slices = [("real", real_data.xProjection(alpha_slice_value)), + slices = [("real", data.xProjection(alpha_slice_value)), ("simul", simul_data.xProjection(alpha_slice_value))] title = ("Horizontal slice at alpha =" + '{:3.1f}'.format(alpha_slice_value)) @@ -137,7 +137,7 @@ class PlotObserver: self.plot_slices(slices, title) # vertical slices - slices = [("real", real_data.yProjection(phi_slice_value)), + slices = [("real", data.yProjection(phi_slice_value)), ("simul", simul_data.yProjection(phi_slice_value))] title = "Vertical slice at phi =" + '{:3.1f}'.format( phi_slice_value) @@ -154,13 +154,13 @@ def run_fitting(): main function to run fitting """ - real_data = create_real_data() + data = fake_data() fit_objective = ba.FitObjective() - fit_objective.addSimulationAndData(get_masked_simulation, real_data, 1) + fit_objective.addSimulationAndData(get_masked_simulation, data, 1) fit_objective.initPrint(10) - # creating custom observer which will draw fit progress + # creating custom observer which will draw fit progress plotter = PlotObserver() plt.close() # (hide plot) fit_objective.initPlot(10, plotter) diff --git a/rawEx/fit/scatter2d/fit_along_slices.py b/rawEx/fit/scatter2d/fit_along_slices.py index 3de58250cdef41e1d8960be336ea11ba194b642a..3d1e12380d78e31df0e52639e0be5bb76344c561 100755 --- a/rawEx/fit/scatter2d/fit_along_slices.py +++ b/rawEx/fit/scatter2d/fit_along_slices.py @@ -28,7 +28,7 @@ def get_masked_simulation(P): return simulation -def create_real_data(): +def fake_data(): """ Generating "real" data by adding noise to the simulated data. """ @@ -57,7 +57,7 @@ class PlotObserver: self.update(fit_objective) @staticmethod - def plot_real_data(data): + def plot_data(data): """ Plot experimental data as heatmap with horizontal/vertical lines representing slices on top. @@ -121,15 +121,15 @@ class PlotObserver: """ self.fig.clf() - real_data = fit_objective.experimentalData() + data = fit_objective.experimentalData() simul_data = fit_objective.simulationResult() # plot real data plt.subplot(2, 2, 1) - self.plot_real_data(real_data) + self.plot_data(data) # horizontal slices - slices = [("real", real_data.xProjection(alpha_slice_value)), + slices = [("real", data.xProjection(alpha_slice_value)), ("simul", simul_data.xProjection(alpha_slice_value))] title = ("Horizontal slice at alpha =" + '{:3.1f}'.format(alpha_slice_value)) @@ -137,7 +137,7 @@ class PlotObserver: self.plot_slices(slices, title) # vertical slices - slices = [("real", real_data.yProjection(phi_slice_value)), + slices = [("real", data.yProjection(phi_slice_value)), ("simul", simul_data.yProjection(phi_slice_value))] title = "Vertical slice at phi =" + '{:3.1f}'.format( phi_slice_value) @@ -154,13 +154,13 @@ def run_fitting(): main function to run fitting """ - real_data = create_real_data() + data = fake_data() fit_objective = ba.FitObjective() - fit_objective.addSimulationAndData(get_masked_simulation, real_data, 1) + fit_objective.addSimulationAndData(get_masked_simulation, data, 1) fit_objective.initPrint(10) - # creating custom observer which will draw fit progress + # creating custom observer which will draw fit progress plotter = PlotObserver() <%= sm ? "plt.close() # (hide plot) " :"" %>fit_objective.initPlot(10, plotter)