Add files via upload

This commit is contained in:
David Rotermund 2024-02-03 15:49:12 +01:00 committed by GitHub
parent faafa72031
commit ec4b7eae41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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())