From 8d03d7846e4f5337c86bd07661ac24085f5948c2 Mon Sep 17 00:00:00 2001 From: Gao Date: Mon, 8 May 2023 11:52:21 +0200 Subject: [PATCH] Add function to calculate mean and std --- ToolFunction/ToolFunction.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ToolFunction/ToolFunction.py b/ToolFunction/ToolFunction.py index 1b518c2..6f0803a 100644 --- a/ToolFunction/ToolFunction.py +++ b/ToolFunction/ToolFunction.py @@ -105,4 +105,18 @@ def print_scanAxis(dataSet): } ) print("The detected scaning axes and values are: /n") - print(scan) \ No newline at end of file + print(scan) + + +def calculate_mean(dataSet): + if 'runs' in dataSet.dims: + return dataSet.mean(dim='runs') + else: + return dataSet + + +def calculate_std(dataSet): + if 'runs' in dataSet.dims: + return dataSet.mean(dim='runs') + else: + return None \ No newline at end of file