From ec4b7eae41b0ccdf6acfa39099b304116778bec9 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Sat, 3 Feb 2024 15:49:12 +0100 Subject: [PATCH] Add files via upload --- reproduction_effort/binning.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 reproduction_effort/binning.py diff --git a/reproduction_effort/binning.py b/reproduction_effort/binning.py new file mode 100644 index 0000000..be70805 --- /dev/null +++ b/reproduction_effort/binning.py @@ -0,0 +1,18 @@ +import numpy as np +import torch +import os +import scipy.io as sio # type: ignore + +from functions.binning import binning + +filename_raw: str = f"raw{os.sep}Exp001_Trial001_Part001.npy" +filename_old_mat: str = "Exp001_Trial001_Part001.mat" + +data = torch.tensor(np.load(filename_raw).astype(np.float32)) + +data = binning(data) + +mat_data = torch.tensor(sio.loadmat(filename_old_mat)["nparray"].astype(np.float32)) + +diff = torch.abs(mat_data - data) +print(diff.min(), diff.max())