From 344f148dfc1eff0023acf3ba938fcbf3c84eefb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20WYNGAARD?= Date: Tue, 20 Feb 2024 11:44:42 +0100 Subject: [PATCH] Templates as float32 for better memory/disk usage --- src/MEArec/simulate_cells.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MEArec/simulate_cells.py b/src/MEArec/simulate_cells.py index 03f8d71..f671ca8 100644 --- a/src/MEArec/simulate_cells.py +++ b/src/MEArec/simulate_cells.py @@ -875,7 +875,7 @@ def calc_extracellular( if verbose >= 1: print(f"Done generating EAPs for {cell_name}") - saved_eaps = np.array(saved_eaps) + saved_eaps = np.array(saved_eaps, dtype=np.float32) saved_positions = np.array(saved_positions) saved_rotations = np.array(saved_rotations) @@ -1268,14 +1268,14 @@ def check_solidangle(matrix, pre, post, polarlim): cell.set_rotation(x=x_rot, y=y_rot, z=z_rot) rot = [x_rot, y_rot, z_rot] - lfp = electrodes.get_transformation_matrix() @ cell.imem + lfp = np.array(electrodes.get_transformation_matrix() @ cell.imem, dtype=np.float32) # Reverse rotation to bring cell back into initial rotation state if rotation is not None: rev_rot = [-r for r in rot] cell.set_rotation(rev_rot[0], rev_rot[1], rev_rot[2], rotation_order="zyx") - return 1000 * lfp, pos, rot, found_position + return 1e3 * lfp, pos, rot, found_position def str2bool(v):