pynn_brainscales.brainscales2.projections.Space
-
class
pynn_brainscales.brainscales2.projections.
Space
(axes=None, scale_factor=1.0, offset=0.0, periodic_boundaries=None) Bases:
object
Class representing a space within distances can be calculated. The space is Cartesian, may be 1-, 2- or 3-dimensional, and may have periodic boundaries in any of the dimensions.
- Arguments:
- axes:
if not supplied, then the 3D distance is calculated. If supplied, axes should be a string containing the axes to be used, e.g. ‘x’, or ‘yz’. axes=’xyz’ is the same as axes=None.
- scale_factor:
it may be that the pre and post populations use different units for position, e.g. degrees and µm. In this case, scale_factor can be specified, which is applied to the positions in the post-synaptic population.
- offset:
if the origins of the coordinate systems of the pre- and post- synaptic populations are different, offset can be used to adjust for this difference. The offset is applied before any scaling.
- periodic_boundaries:
either None, or a tuple giving the boundaries for each dimension, e.g. ((x_min, x_max), None, (z_min, z_max)).
-
__init__
(axes=None, scale_factor=1.0, offset=0.0, periodic_boundaries=None)
Methods
__init__
([axes, scale_factor, offset, …])distance_generator
(f, g)distances
(A, B[, expand])Calculate the distance matrix between two sets of coordinates, given the topology of the current space.
Attributes
-
AXES
= {'x': [0], 'y': [1], 'z': [2], 'xy': [0, 1], 'yz': [1, 2], 'xz': [0, 2], 'xyz': range(0, 3), None: range(0, 3)}
-
distance_generator
(f, g)
-
distances
(A, B, expand=False) Calculate the distance matrix between two sets of coordinates, given the topology of the current space. From http://projects.scipy.org/pipermail/numpy-discussion/2007-April/027203.html