From ea5c5fda26a51ea1dc6a323b277097a21d3edcff Mon Sep 17 00:00:00 2001 From: Steinn Ymir Agustsson Date: Fri, 13 Oct 2023 14:21:28 +0200 Subject: [PATCH] fix tof_step_to_ns --- sed/calibrator/energy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sed/calibrator/energy.py b/sed/calibrator/energy.py index f037fd5d..02ca7e5a 100644 --- a/sed/calibrator/energy.py +++ b/sed/calibrator/energy.py @@ -2129,7 +2129,10 @@ def tof_step_to_ns( raise ValueError("Either tof_ns_column or config must be given.") tof_ns_column = config["dataframe"]["tof_ns_column"] - df[tof_ns_column] = df.map_partitions(tof2ns, meta=(tof_column, np.float64)) + def func(x): + return tof2ns(x, tof_column, tof_binwidth, tof_binning) + + df[tof_ns_column] = df.map_partitions(func, meta=(tof_column, np.float64)) metadata: Dict[str, Any] = {"applied": True, "tof_binwidth": tof_binwidth} return df, metadata