From 8f6c37cb594c1d78c35c49a8ee9c15808c1b5192 Mon Sep 17 00:00:00 2001
From: Eduardo Gonzalez Solares <eglez@ast.cam.ac.uk>
Date: Mon, 29 Apr 2019 16:00:23 +0100
Subject: [PATCH] Rewrite lambda function

---
 stpt_pipeline/stpt_displacement.py | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/stpt_pipeline/stpt_displacement.py b/stpt_pipeline/stpt_displacement.py
index c2bb6eb..b2fe2d6 100644
--- a/stpt_pipeline/stpt_displacement.py
+++ b/stpt_pipeline/stpt_displacement.py
@@ -137,14 +137,27 @@ cof_dist = np.array([3.93716645e-05, -7.37696218e-02, 2.52457306e01]) / 2.0
 # are stored. Ideally this should be passed as an argument
 #
 root_dir = '../20190201_tumour_opticalsections_extraoverlap/'
-#
-#
-##################################################################################
-#
-# This function transform the raw images into the ones used for crossmatching
-# and mosaicing
-magic_function = lambda x: np.flipud(x / nflat)[x_min:x_max, y_min:y_max] / norm_val
-#
+
+
+def magic_function(x):
+    """[summary]
+
+    This function transform the raw images into the ones used
+    for crossmatching and mosaicing
+
+    Parameters
+    ----------
+    x : [type]
+        [description]
+
+    Returns
+    -------
+    [type]
+        [description]
+    """
+    return np.flipud(x / nflat)[x_min:x_max, y_min:y_max] / norm_val
+
+
 # Read flat
 #
 if do_flat:
-- 
GitLab