parameters: (masktype, specs, anchor=None)
docstring: Create a spatial mask for connections.
  
      Masks are used when creating connections. A mask describes the area of
      the pool population that is searched for to connect for any given
      node in the driver population. Several mask types are available. Examples
      are the grid region, the rectangular, circular or doughnut region.
  
      The command :py:func:`.CreateMask` creates a `Mask` object which may be combined
      with other `Mask` objects using Boolean operators. The mask is specified
      in a dictionary.
  
      ``Mask`` objects can be passed to :py:func:`.Connect` in a connection dictionary with the key `'mask'`.
  
      Parameters
      ----------
      masktype : str, ['rectangular' | 'circular' | 'doughnut' | 'elliptical']
          for 2D masks, ['box' | 'spherical' | 'ellipsoidal] for 3D masks,
          ['grid'] only for grid-based layers in 2D.
          The mask name corresponds to the geometrical shape of the mask. There
          are different types for 2- and 3-dimensional layers.
      specs : dict
          Dictionary specifying the parameters of the provided `masktype`,
          see **Mask types**.
      anchor : [tuple/list of floats | dict with the keys `'column'` and \
          `'row'` (for grid masks only)], optional, default: None
          By providing anchor coordinates, the location of the mask relative to
          the driver node can be changed. The list of coordinates has a length
          of 2 or 3 dependent on the number of dimensions.
  
      Returns
      -------
      Mask:
          Object representing the mask
  
      See also
      --------
      Connect
  
      Notes
      -----
      - All angles must be given in degrees.
  
      **Mask types**
  
      Available mask types (`masktype`) and their corresponding parameter
      dictionaries:
  
      * 2D free and grid-based layers
          ::
  
              'rectangular' :
                  {'lower_left'   : [float, float],
                   'upper_right'  : [float, float],
                   'azimuth_angle': float  # default:0.0}
              #or
              'circular' :
                  {'radius' : float}
              #or
              'doughnut' :
                  {'inner_radius' : float,
                   'outer_radius' : float}
              #or
              'elliptical' :
                  {'major_axis' : float,
                   'minor_axis' : float,
                   'azimuth_angle' : float,   # default: 0.0,
                   'anchor' : [float, float], # default: [0.0, 0.0]}
  
      * 3D free and grid-based layers
          ::
  
              'box' :
                  {'lower_left'  : [float, float, float],
                   'upper_right' : [float, float, float],
                   'azimuth_angle: float  # default: 0.0,
                   'polar_angle  : float  # defualt: 0.0}
              #or
              'spherical' :
                  {'radius' : float}
              #or
              'ellipsoidal' :
                  {'major_axis' : float,
                   'minor_axis' : float,
                   'polar_axis' : float
                   'azimuth_angle' : float,   # default: 0.0,
                   'polar_angle' : float,     # default: 0.0,
                   'anchor' : [float, float, float], # default: [0.0, 0.0, 0.0]}}
  
      * 2D grid-based layers only
          ::
  
              'grid' :
                  {'rows' : float,
                   'columns' : float}
  
          By default the top-left corner of a grid mask, i.e., the grid
          mask element with grid index [0, 0], is aligned with the driver
          node. It can be changed by means of the 'anchor' parameter:
              ::
  
                  'anchor' :
                      {'row' : float,
                       'column' : float}
  
      **Example**
          ::
  
              import nest
  
              # create a grid-based layer
              l = nest.Create('iaf_psc_alpha', positions=nest.spatial.grid(shape=[5, 5]))
  
              # create a circular mask
              m = nest.CreateMask('circular', {'radius': 0.2})
  
              # connectivity specifications
              conndict = {'rule': 'pairwise_bernoulli',
                          'p': 1.0,
                          'mask': m}
  
              # connect layer l with itself according to the specifications
              nest.Connect(l, l, conndict)
docstring_summary: Create a spatial mask for connections.
docstring_tokens: Create a spatial mask for connections .
function: def CreateMask(masktype, specs, anchor=None):
      """
      Create a spatial mask for connections.
  
      Masks are used when creating connections. A mask describes the area of
      the pool population that is searched for to connect for any given
      node in the driver population. Several mask types are available. Examples
      are the grid region, the rectangular, circular or doughnut region.
  
      The command :py:func:`.CreateMask` creates a `Mask` object which may be combined
      with other `Mask` objects using Boolean operators. The mask is specified
      in a dictionary.
  
      ``Mask`` objects can be passed to :py:func:`.Connect` in a connection dictionary with the key `'mask'`.
  
      Parameters
      ----------
      masktype : str, ['rectangular' | 'circular' | 'doughnut' | 'elliptical']
          for 2D masks, ['box' | 'spherical' | 'ellipsoidal] for 3D masks,
          ['grid'] only for grid-based layers in 2D.
          The mask name corresponds to the geometrical shape of the mask. There
          are different types for 2- and 3-dimensional layers.
      specs : dict
          Dictionary specifying the parameters of the provided `masktype`,
          see **Mask types**.
      anchor : [tuple/list of floats | dict with the keys `'column'` and \
          `'row'` (for grid masks only)], optional, default: None
          By providing anchor coordinates, the location of the mask relative to
          the driver node can be changed. The list of coordinates has a length
          of 2 or 3 dependent on the number of dimensions.
  
      Returns
      -------
      Mask:
          Object representing the mask
  
      See also
      --------
      Connect
  
      Notes
      -----
      - All angles must be given in degrees.
  
      **Mask types**
  
      Available mask types (`masktype`) and their corresponding parameter
      dictionaries:
  
      * 2D free and grid-based layers
          ::
  
              'rectangular' :
                  {'lower_left'   : [float, float],
                   'upper_right'  : [float, float],
                   'azimuth_angle': float  # default:0.0}
              #or
              'circular' :
                  {'radius' : float}
              #or
              'doughnut' :
                  {'inner_radius' : float,
                   'outer_radius' : float}
              #or
              'elliptical' :
                  {'major_axis' : float,
                   'minor_axis' : float,
                   'azimuth_angle' : float,   # default: 0.0,
                   'anchor' : [float, float], # default: [0.0, 0.0]}
  
      * 3D free and grid-based layers
          ::
  
              'box' :
                  {'lower_left'  : [float, float, float],
                   'upper_right' : [float, float, float],
                   'azimuth_angle: float  # default: 0.0,
                   'polar_angle  : float  # defualt: 0.0}
              #or
              'spherical' :
                  {'radius' : float}
              #or
              'ellipsoidal' :
                  {'major_axis' : float,
                   'minor_axis' : float,
                   'polar_axis' : float
                   'azimuth_angle' : float,   # default: 0.0,
                   'polar_angle' : float,     # default: 0.0,
                   'anchor' : [float, float, float], # default: [0.0, 0.0, 0.0]}}
  
      * 2D grid-based layers only
          ::
  
              'grid' :
                  {'rows' : float,
                   'columns' : float}
  
          By default the top-left corner of a grid mask, i.e., the grid
          mask element with grid index [0, 0], is aligned with the driver
          node. It can be changed by means of the 'anchor' parameter:
              ::
  
                  'anchor' :
                      {'row' : float,
                       'column' : float}
  
      **Example**
          ::
  
              import nest
  
              # create a grid-based layer
              l = nest.Create('iaf_psc_alpha', positions=nest.spatial.grid(shape=[5, 5]))
  
              # create a circular mask
              m = nest.CreateMask('circular', {'radius': 0.2})
  
              # connectivity specifications
              conndict = {'rule': 'pairwise_bernoulli',
                          'p': 1.0,
                          'mask': m}
  
              # connect layer l with itself according to the specifications
              nest.Connect(l, l, conndict)
      """
      if anchor is None:
          return sli_func('CreateMask', {masktype: specs})
      else:
          return sli_func('CreateMask',
                          {masktype: specs, 'anchor': anchor})
function_tokens: def CreateMask ( masktype , specs , anchor = None ) : if anchor is None : return sli_func ( 'CreateMask' , { masktype : specs } ) else : return sli_func ( 'CreateMask' , { masktype : specs , 'anchor' : anchor } )