예제 #1
0
def spontAct3Sec(resp, spikes, xBest, xData, expUnits=qu.Hz):
    '''
    Calculates the spike rate during the 3s interval preceding stimulus application
    :param resp: unused
    :param spikes: see file documentation above
    :param xBest: unused
    :param xData: unused
    :param expUnits: see file documentation above
    :return: quantities.Quantity
    '''
    spikeRate = getSpikeRateIn(spikes,
                               intervalStart=-3 * qu.s,
                               intervalEnd=0 * qu.s)

    spikeRate *= simpleFloat(expUnits / qu.Hz)

    return spikeRate
예제 #2
0
def totalSpikeRate(resp, spikes, xBest, xData, expUnits=qu.Hz):
    '''
    Calculates the spike rate during interval [0, 1000)ms of stimulus application
    :param resp: unused
    :param spikes: see file documentation above
    :param xBest: unused
    :param xData: unused
    :param expUnits: see file documentation above
    :return: quantites.Quantity
    '''
    spikeRate = getSpikeRateIn(spikes,
                               intervalStart=0 * qu.ms,
                               intervalEnd=1 * qu.s)

    spikeRate *= simpleFloat(expUnits / qu.Hz)

    return spikeRate
예제 #3
0
def inhiReleaseAt(resp, spikes, xBest, xData, expUnits=qu.ms):
    '''
    Legacy function from double fitting of response baseline.
    :param resp: see file documentation above
    :param spikes: see file documentation above
    :param xBest: see file documentation above
    :param xData: see file documentation above
    :param expUnits: see file documentation above
    :return: quantites.Quantity
    '''
    if any(np.isnan(xBest)):
        return np.nan
    else:
        [A1, A2, onset1, onset2, taur1, taud1, taur2, taud2, offset] = xBest
        inhiRelease = onset2 + 3 * taud2
        inhiRelease *= simpleFloat(expUnits / qu.ms)
        return inhiRelease