From 51e583d37c8087c76a37ea86d9e41c522a5e0cc0 Mon Sep 17 00:00:00 2001 From: Mathieu Doucet <doucetm@ornl.gov> Date: Wed, 25 Jul 2018 11:05:22 -0400 Subject: [PATCH] Fix Flake8 --- .../PythonInterface/plugins/algorithms/MRInspectData.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Framework/PythonInterface/plugins/algorithms/MRInspectData.py b/Framework/PythonInterface/plugins/algorithms/MRInspectData.py index 370221dba12..37e09844f44 100644 --- a/Framework/PythonInterface/plugins/algorithms/MRInspectData.py +++ b/Framework/PythonInterface/plugins/algorithms/MRInspectData.py @@ -13,6 +13,7 @@ DEAD_PIXELS = 10 NX_PIXELS = 304 NY_PIXELS = 256 + class MRInspectData(PythonAlgorithm): def category(self): @@ -416,6 +417,7 @@ class DataInfo(object): # Write to logs self.log() + def fit_2d_peak(workspace): """ Fit a 2D Gaussian peak @@ -498,16 +500,19 @@ def fit_2d_peak(workspace): return [x_min, x_max], [y_min, y_max] + def coord_to_code(x, y): """ Utility function to encode pixel coordinates so we can unravel our distribution in a 1D array """ return 1000 * x + y + def code_to_coord(c): """ Utility function to decode encoded coordinates """ i_x = c / 1000 i_y = c % 1000 return i_x, i_y + def poly_bck(value, *p): """ Polynomial function for background fit @@ -527,6 +532,7 @@ def poly_bck(value, *p): values[coord[1]>=NY_PIXELS-DEAD_PIXELS] = 0 return values + def poly_bck_signal(value, *p): """ Function for a polynomial + Gaussian signal @@ -551,6 +557,7 @@ def poly_bck_signal(value, *p): values[coord[1]>=NY_PIXELS-DEAD_PIXELS] = 0 return values + def gauss_simple(value, *p): """ Gaussian function with threshold background @@ -572,6 +579,7 @@ def gauss_simple(value, *p): values[coord[1]>=NY_PIXELS-DEAD_PIXELS] = 0 return values + def chi2(data, model): """ Returns the chi^2 for a data set and model pair """ err = np.fabs(data.ravel()) -- GitLab