Skip to content

Commit

Permalink
DEMO its numerical precision
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed Apr 23, 2021
1 parent f9bf01a commit 3fd8db8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hnn_core/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,24 @@ def create_soma(self):
self.soma.Ra = soma_props['Ra']
self.soma.cm = soma_props['cm']

def move_to_pos(self):
"""Move cell to position."""
x0 = self.soma.x3d(0)
y0 = self.soma.y3d(0)
z0 = self.soma.z3d(0)
dx = self.pos[0] * 100 - x0
dy = self.pos[2] - y0
dz = self.pos[1] * 100 - z0

for s in self.get_sections():
for i in range(s.n3d()):
h.pt3dchange(i, s.x3d(i) + dx, s.y3d(i) + dy,
s.z3d(i) + dz, s.diam3d(i),
sec=s)
h.pt3dchange(i, s.x3d(i) - dx, s.y3d(i) - dy,
s.z3d(i) - dz, s.diam3d(i),
sec=s)

# two things need to happen here for h:
# 1. dipole needs to be inserted into each section
# 2. a list needs to be created with a Dipole (Point Process) in each
Expand Down
1 change: 1 addition & 0 deletions hnn_core/network_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def _build(self):
self._all_spike_gids = h.Vector()

self._record_spikes()
self.move_cells_to_pos()
self._connect_celltypes()

if _get_rank() == 0:
Expand Down

0 comments on commit 3fd8db8

Please sign in to comment.