Skip to content

Commit

Permalink
Templates as float32 for better memory/disk usage
Browse files Browse the repository at this point in the history
  • Loading branch information
DradeAW committed Feb 20, 2024
1 parent 4570839 commit 344f148
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MEArec/simulate_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 344f148

Please sign in to comment.