target_positions

Contents

target_positions#

class brainspike.spatial.target_positions(sim, source, target)[source]#

Coordinates of each source node’s realized targets (NEST GetTargetPositions).

Parameters:
  • sim (Simulator) – The simulator holding the realized connections and target positions.

  • source (NodeView) – A single-segment source view (one entry is returned per node).

  • target (NodeView) – The candidate-target population view (created with positions=).

Returns:

One (k_i, ndim) coordinate array per source node, in source order.

Return type:

list of Quantity

See also

target_nodes

the underlying realized-target index query.

Examples

>>> import brainspike
>>> import brainunit as u
>>> sim = brainspike.Simulator(dt=0.1 * u.ms)
>>> pop = sim.create(brainspike.iaf_psc_alpha, positions=brainspike.spatial.grid([3, 1], extent=[3.0, 1.0]))
>>> _ = sim.connect(pop, pop,
...     rule=brainspike.spatial.spatial_pairwise_bernoulli(p=1.0, mask=brainspike.spatial.circular(1.2)),
...     weight=1.0 * u.pA, delay=1.0 * u.ms)
>>> [tuple(p.shape) for p in brainspike.spatial.target_positions(sim, pop, pop)]
[(2, 2), (3, 2), (2, 2)]