Example #1
0
def make_tgt_dir_rate(tgt, pos, pd, kd, sqp={}):
    '''
    Create directional firing components from target (target - current)
    direction, and modulation depth.

    Parameters
    ----------
    task : ndarray
      start and target positions for each task, shape (ntask, 6)
    pos : ndarray
      cursor position, shape (ntask, nrep, nbin, ndim)
    pd : ndarray
      preferred directions, shape (nunit, 3)
    kd : ndarray
      modulation depth, shape (nunit)
    '''
    drn = get_tgt_dir(pos, tgt)
    rate = np.dot(drn, pd.T) * kd
    set_squash_defaults(sqp, rate)
    return squash(rate, sqp)
Example #2
0
def make_inst_dir_rate(time, pos, pd, kd, sqp={}):
    '''
    Create directional firing components from instantaneous direction,
    preferred direction, and modulation depth.

    Parameters
    ----------
    time : ndarray
      times for pos samples, shape (??)
    pos : ndarray
      positional data, shape (ntrial, nbin, 3)
    pd : array_like
      pds for a number of cells, shape (nunit, 3)
    kd : array_like
      modulation depth, shape (nunit)
    sqp : dict, optional
      parameter values for squashing function
    '''
    drn = get_dir(pos, tax=1, spax=-1)
    rate = np.dot(drn, pd.T) * kd
    set_squash_defaults(sqp, rate)
    return squash(rate, sqp)