pyST Package

pyST Package

pyNCS.pyST.loadtxt(filename, comments, format='t')

STas Module

class pyNCS.pyST.STas.RawOutput(raw_data, id_data, decoder_dict, t_start=0, t_stop=1000, filter_duplicates=False)

Bases: object

RawOutPut is a class which contains raw AER data per channel (Physical addresses).

It decodes the AER data “just in time”

Inputs: raw_data: events with physical addresses id_data: all addresses in given channel decoder_dict: Dictionary of functions for decoding addresses. Key designates the channel t_start: start time of all spikelists in ms t_stop: end time of all spikelists in ms filter_duplicates: If True erases in all channels double events within the a 0.01ms time-frame (buggy hw)

Usage: #In conjunction with pyAex.netClient

>>> client = client.netClient(host='localhost')
>>> raw_out = client.stimulate()
>>> client.stop()
>>> for sl in raw_output: sl.raster_plot()
check_has_key_somewhere(*args, **kwds)
decode_all_channels()
decode_data(key)
iterchannels(channels)
iteritems()
print_num_events(raw_data)
pyNCS.pyST.STas.STChannelAddressing

alias of channelAddressing

pyNCS.pyST.STas.addrBuildHashTable(stas)

addrBuildHashTable(stas) constructs all possible physical addresses of the given address specification and stores it internally in its hash table (stas.addrExtractFast). This function is typically used for real-time monitoring

stas: addrSpec object.

Hash tables are not used anymore

This function does not scale well.

pyNCS.pyST.STas.addrLogicalConstruct(stas, addr)

Constructs Logical addresses, i.e. addresses in float format useful for plotting because they keep the neuron - synapse order.

NOTE: Logical addresses do not contain channel information

addr: address (in a form isValidAddress can understand)

pyNCS.pyST.STas.addrLogicalExtract(stas, addrLogical)

Description here

pyNCS.pyST.STas.addrLogicalPhysical(stas, addrLogical, checkLevel=1)

Direct translation from Logical Addresses to Physical addresses using a hash table

pyNCS.pyST.STas.addrLogicalPhysicalDecode(stas, addrLog)

Takes logical addresses and fills the logical to physical hash table

pyNCS.pyST.STas.addrPhysicalConstruct(stas, addr)

Description here

pyNCS.pyST.STas.addrPhysicalExtract(stas, addrPhys)

addrPhysicalExtract takes a physical address as argument and returns a numpy array containing the human readable list of addresses. First dimension is the field type, second dimension is the address. Uses hash tables for accelerating look-up.

pyNCS.pyST.STas.addrPhysicalExtractDecode(stas, addrPhys)

addrPhysicalExtract takes a physical address as argument and returns a list containing the addresses in human readable form. This is called only the first time the physical address is decoded.

stas: addrSpec object.

addrPhys: an integer or an iterable containing integers representing physical addresses

pyNCS.pyST.STas.addrPhysicalLogical(stas, addrPhys, checkLevel=1)

Direct translation from Physical Addresses to Logical addresses using a hash table

pyNCS.pyST.STas.addrPhysicalLogicalDecode(stas, addrPhys)

Takes physical addresses and fills the physical to logical hash table

class pyNCS.pyST.STas.addrSpec(addrStr='', addrConf=[], addrPinConf='', id='NoName')

Address specification class # NOTE : Documentation is outdated!!

addrConf: should be a list of dicts. Each dict should contain the following fields:

  • ‘id’, whose value is equal to a single, unique, lowercase character.
  • ‘range’, an iterable containing the possible values the address field can take
  • ‘type’, which is either 1 (Neuron) or -1 (Synapse).

addrStr: should contain a list of space-separated pins with a number follwing an uppercase character defining the position on the chip. For example: “X0 X1 X2 X3 X4 X5 X6 Y4 Y3 Y2 Y1 Y0”

fe: extraction function. this should be a string like ‘[X,Y*2]’, The letters must correspond to those in addrStr fc: construction function ‘[x,y/2]’, the letters must corrspond to those in addrConf

fe(fc(a)) should be the identity function

IMPORTANT: fe and fc are called vectorally (using numpy arrays), so check that the given functions also work with vectors (otherwise numpy.vstack will complain)

Example:

iter_fields()
iter_fields_by_pin(pin_order=None)
iter_hrf_index()

Iterates over the indexes of addrConf

iter_hrfs()

Iterates over the list addrConf

update()

(Re)Generates the object based on the addrStr, addrConf and addrPinConf

class pyNCS.pyST.STas.addressEncoder(addr_conf, addr_str, addr_pinconf)
decode(addr)
decode_field(field, addr)
encode(addr)
encode_field(field, addr)
class pyNCS.pyST.STas.channelAddressing(stasList, channelBits=[15, 16])

This class contains the information defining the Channel Addressing Scheme for a multichip setup, i.e. definition of which chips are found on which channel

channelAddressing(stasList,nChannelBits)

nChannelBits: Positions of channel bits in the hardware addresses. Default nChannelBits=[15,16]

stasList: list of address specification objects, of the same length as len(channelBits)**2

See also: addrSpec

addrLogicalConstruct(addr)

Constructs Logical addresses, i.e. addresses in float format useful for plotting because they keep the neuron - synapse order.

Returns a float32 numpy array.

NOTE: Logical addresses do not contain channel information

addr: address (in a form isChannelAddrList() can understand), such as {0:[range(15),2]}

See also:

addrLogicalConstruct, addrLogicalExtract
addrLogicalExtract(addr)

Extracts Logical Address with channel information

addr: address (in a form isChannelAddrList() can understand), such as {0:[1.,2.,3.]}

addrPhysicalConstruct(addr)

Constructs Physical addresses to human readable addresses

addr: numpy array of human readable numbers ( the physical addresses )

channel: which channel addressing should be appended.

addrPhysicalExtract(addr)

Extracts Physical addresses to human readable addresses

addr: numpy array of uint32 numbers ( the physical addresses )

Output is channelAddrList, channel where channelEventsList is a list of arrays which contain the addresses and channel is an array of channels.

addrPhysicalLogical(addr, checkLevel=1)

Extracts Physical addresses to logical addresses (directly)

addr: numpy array of uint32 numbers ( the physical addresses )

Output is channelAddrList, channel where channelEventsList is a list of arrays which contain the addresses and channel is an array of channels.

buildAllHashTables(channels=None)
exportAER(spikeLists, filename=None, format='a', isi=True, sep='t', addr_format='%u', time_format='%u', *args, **kwargs)

spikeLists can be a spikeList, a list of spikelists of dimension nChannels, a dictionary i.e.{channel: spikeList}. If a SpikeList is given, it will be equivalent to {0: spikeLists}. format specifies whether timestamps (format=’t’) or addresses (format=’a’) should be on the first column. addr_format and time_format format to be used by np.savetxt

extract(ev)

Extracts the channel information from an array of hardware events. Returns a channelEvents object. Use addrPhysicalExtract for decoding the adresses instead.

eventsArray: numpy array of hardware events (uint32)

See also:
addrPhysicalExtract
generateST(ch_events, normalize=True)

Extracts events from eventsChannel, using the address specification specified for the given channels, returns a list of SpikeList

getValue(channel)

returns the channel mask

channel: int between 0 and len(channelBits)**2

importAER(input=None, sep='t', dt=1e-06, format='a', isi=False, *args, **kwargs)

Function for extracting, translating events from a numpy array. Output is a channelEvents object.

Inputs: input: if a string, will be treated as a filename and passed to np.loadtxt, if a numpy array, will be considered as events of dimension 2 x number of events. By default, the addresses are on [:,0] format: either ‘t’ or ‘a’ respectively meaning timestamps and addresses on the first column. (‘a’ by default) kwargs: keyword arguments passed to np.loadtxt

isChannelAddrList(addr)

Mostly internal function

Check whether addr is a valid channelAddr list/dict

addr: Either list of dimension channelAddressing.nChannels, containing arrays of addresses. The list index is the channel number, or dict whose keys are the channel numbers.

See also:

Stas.isValidAddress
normalizeAER(ch_events)

Called before extract to throw away pre-stimulus data

rawoutput_from_chevents(ch_events, func=None, normalize=True, filter_duplicates=False)

this function acts like generateST, but constructs a RawOutput object which delays the decoding until it is necessary. ch_events is a channelEvents object of type ‘p’ (Physical)

Inputs:
func - a dictionary of functions with channels as keys to decode the addresses. If omitted, all the channels are considered Outputs a RawOutput object
reprAddressSpecification()

String representation of the channel address specification

class pyNCS.pyST.STas.channelEvents(channel_events=None, atype='Physical')

Bases: dict

TODO

add_adtmch(channel, ad, tm)
add_ch(channel, ev)

Add an events object to a channel Remark: Creates a reference to the provided events! In place changes also affect the events!

atype
copy()
filter_all_by_channel_mapping(mapping)

Modifies, in-place, the encapsulated events acccording to the one-to-many mapping (key is int/float, value is iterable) In this function, a different mapping is used for each channel (useful for address that do not contain channel information, for example)

filter_all_by_mapping(mapping)

Modifies, in-place, the encapsulated events acccording to the one-to-many mapping (key is int/float, value is iterable)

filter_channel(channel_list=None)

Removes (in-place) all channels with are not in channel_list. If channel_list is omitted, the ch_events is left unchanged

flatten()
get_all_ad()
get_all_adtmev()
get_all_tm()
get_all_tmadev()
get_nev()
iter_by_timeslice(tm)
class pyNCS.pyST.STas.events(ev=None, atype='p', isISI=False)

Bases: object

NF = 2
ad
add_adtm(ad, tm)
add_adtmev(ev)
atype
data
demultiplex()

Generates a dictionary with addesses as keys and a list of timestamps as values. Used internally for generating SpikeLists

dtype
empty()
filter_by_mapping(mapping)

Map the events, given a mapping dictionary like: map[src]=[target1,target2,...,targetn],

get_ad()
get_adisi()
get_adtm()
get_adtmev()
get_nev()
get_t_stop()
get_tdur()
get_tm()
get_tmad()
get_tmadev()
iter_by_timeslice(tm)
nev
normalize_tm(t0=0)
set_abs_tm()
set_ad(ad)
set_data(ad, tm)
set_isi()
set_tm(tm)
sort()

Sort events by addresses and timestamps (in this order).

t_stop
tdur
tm
pyNCS.pyST.STas.extract_id_list(addr_conf)
pyNCS.pyST.STas.generateST(stas, events, normalize=True)

Extracts events from eventsChannel, using the address specification specified for the given channels, returns a list of SpikeList Inputs: stas: STas.addrSpec object events: STas.events object normalize: if True (default), the timestamp of the first event is set to zeros and all the timestamps of the subsequent events are shifted accordingly.

pyNCS.pyST.STas.getDefaultMonChannelAddress()

Returns the default Monitoring Channel Addressing Scheme (i.e. AER Output). No arguments

See also: setDefaultMonChannelAddress

pyNCS.pyST.STas.getDefaultSeqChannelAddress()

Returns the default Monitoring Channel Addressing Scheme (i.e. AER Input). No arguments

See also: setDefaultSeqChannelAddress

pyNCS.pyST.STas.isValidAddress(stas, addrList)

This is an internal function which verifies that the given “human readable” address is consistent with the address specification. It also takes care of “filling in” the addresses: for example [range(15),2] is understood as [range(15),[2]*15].

Raises AssertionError if addrList has incorrect data

stas: an address specification object addrSpec addrList: a list of human readable addresses such as [range(15), 5]. It also accepts numpy arrays and transforms it accordingly

pyNCS.pyST.STas.isValidPhysicalAddress(stas, addrPhys)

Checks if the given list, int, numpy array is a valid physical address and outputs a numpy array

class pyNCS.pyST.STas.layoutFieldEncoder(aspec, nWidth, position=0, pin='')

Internal struct used for addrSpec, performing the pin layout permutation (the information contained in addrSr)

pyNCS.pyST.STas.load_stas_from_csv(CSVfile)

This is a reduced version of pyNCS.Chip._readCSV, which reads only the addressing information Inputs: CSVfile - A csv file describing the chip (a “chipfile”).

pyNCS.pyST.STas.load_stas_from_nhml(NHMLfile)

This function returns addrSpec objects aerIn and aerOut by parsing the NHML file.

pyNCS.pyST.STas.repr_addr_spec(addr_spec, nBitsTotal)

Prints the address specification in a human readable format Input: addr_spec, a AddrSpec object

pyNCS.pyST.STas.setDefaultMonChannelAddress(cs)

Sets the default Monitoring Channel Addressing scheme (i.e. AER Output) in pyST globals, and used by pyAex. The argument is then returned when getDefaultMonChannelAddress is called

cs: The Channel Addressing Scheme, instance of the channelAddressing class

See also: getDefaultMonChannelAddress

pyNCS.pyST.STas.setDefaultSeqChannelAddress(cs)

Sets the default Sequencer Channel Addressing scheme (i.e. AER Input) in pyST globals, and used by pyAex. The argument is then returned when getDefaultMonChannelAddress is called

cs: The Channel Addressing Scheme, instance of the channelAddressing class

See also: pyST.getDefaultSeqChannelAddress

STsl Module

pyNCS.pyST.STsl.STCompositePlot(SL, id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, display=True, kwargs={}, kwargs_bar={})

Make a nice Composite plot, i.e. a raster plot combined with a vertical rate plot.

The arguments are identical to STPlotRaster, except for display. display If True is given a new figure is created. If [axS,axR] is given, where axS and axR are pylab.axes objects, then the spike rater and the rate plot are plotted there.

pyNCS.pyST.STsl.STPlotRaster(SL, id_list=None, t_start=None, t_stop=None, display=True, id_color=None, kwargs={})

Same as spikelist.raster_plot() but with pretty plot options

id_color is used to customize colors according to neuron address (for example inhibitory vs. excitatory)

Example: >>> id_color = [{‘ids’:range(124),’color’:’blue’},{‘ids’:range(124,128),’color’:’red’}] >>> plot_raster(chipout[158],id_color=id_color)

pyNCS.pyST.STsl.composite_plot(SL, id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, display=True, kwargs={}, kwargs_bar={})

Make a nice Composite plot, i.e. a raster plot combined with a vertical rate plot.

The arguments are identical to STPlotRaster, except for display. display If True is given a new figure is created. If [axS,axR] is given, where axS and axR are pylab.axes objects, then the spike rater and the rate plot are plotted there.

pyNCS.pyST.STsl.composite_plot_movie(SL, time_bin=10, t_start=None, t_stop=None, output='animation.mpg', bounds=(0, 5), fps=10, display=True, maxrate=None, ratebin=None, kwargs={})
pyNCS.pyST.STsl.composite_plot_superimposed(st_pre, st_post, kwargs={}, colors=['blue', 'k'], id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, pre_rate_mult=1.0)

Make a nice Composite plot superimposing two spike trains, a raster plot combined with a vertical rate plot. st_pre and st_post are two SpikeLists. st_post will be plotted above st_pre colors is a list specifying the respective colors for the bars and spikes for st_pre and st_post kwargs are the keyword arguments for common plot arguments in the raster plots. Default is {‘alpha’:0.7,’marker’:’,’} for st_pre and plot_raster defaults for st_post pre_rate_mult is a float used for plotting the rates of st_pre on a different scale other arguments are the same as in composite_plot

pyNCS.pyST.STsl.ksi(SL, t_stop=800, pow_freq=None, t_bin=10.0)

Kuramoto Synchronization Index (KSI) (Kuaramoto 1984) for measuring phase coherency with respect to the strongest freqeuncy of the population activity.

Returns ksi in the range (0,1). 0 meaning no cohrency and 1 meaning entirely coherent

Inputs:
SL - SpikeList of duration of at least t_stop t_stop - the end of the SpikeTrain (in ms) t_bin - time bin for computing population activity and spectrum pow_freq- if given, this frequency is taken as the strongest frequency
pyNCS.pyST.STsl.mapSpikeListAddresses(SL, mapping=None)

this function maps the addresses of a spike list into another using the given mapping. Useful for logical to physical translation and vice versa SL=original spike list mapping=dictionary containing address mapping, If mapping is None, then the addresses will be mapped onto a linear scale, i.e. range(len(SL.id_list()))

pyNCS.pyST.STsl.plot_raster(SL, id_list=None, t_start=None, t_stop=None, display=True, id_color=None, kwargs={})

Same as spikelist.raster_plot() but with pretty plot options

id_color is used to customize colors according to neuron address (for example inhibitory vs. excitatory)

Example: >>> id_color = [{‘ids’:range(124),’color’:’blue’},{‘ids’:range(124,128),’color’:’red’}] >>> plot_raster(chipout[158],id_color=id_color)

pyST_globals Module

spikes Module

class pyNCS.pyST.spikes.SpikeList(spikes=[], id_list=[], t_start=None, t_stop=None, dims=None)

Bases: object

SpikeList(spikes, id_list, t_start=None, t_stop=None, dims=None)

Return a SpikeList object which will be a dict of SpikeTrain objects.

Inputs:
spikes - a list of (id,time) tuples (id being in id_list) id_list - the list of the ids of all recorded cells (needed for silent cells) t_start - begining of the SpikeList, in ms. If None, will be infered from the data t_stop - end of the SpikeList, in ms. If None, will be infered from the data dims - dimensions of the recorded population, if not 1D population

t_start and t_stop are shared for all SpikeTrains object within the SpikeList

Examples:

>> sl = SpikeList([(0, 0.1), (1, 0.1), (0, 0.2)], range(2)) >> type( sl[0] )

<type SpikeTrain>
See also
load_spikelist
append(id, spktrain)

Add a SpikeTrain object to the SpikeList

Inputs:
id - the id of the new cell spktrain - the SpikeTrain object representing the new cell

The SpikeTrain object is sliced according to the t_start and t_stop times of the SpikeLlist object

Examples

>> st=SpikeTrain(range(0,100,5),0.1,0,100) >> spklist.append(999, st)

spklist[999]
See also
concatenate, __setitem__
complete(id_list)

Complete the SpikeList by adding Sempty SpikeTrain for all the ids present in ids that will not already be in the SpikeList

Inputs:
id_list - The id_list that should be completed
Examples:
>> spklist.id_list()
[0,2,5]

>> spklist.complete(arange(5)) >> spklist.id_list()

[0,1,2,3,4]
composite_plot(id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, display=True, kwargs={}, kwargs_bar={})

Make a nice Composite plot, i.e. a raster plot combined with a vertical rate plot.

The arguments are identical to STPlotRaster, except for display. If True is given a new figure is created. If [axS,axR] is given, where axS and axR are pylab.axes objects, then the spike rater and the rate plot are plotted there.

concatenate(spklists)

Concatenation of SpikeLists to the current SpikeList.

Inputs:
spklists - could be a single SpikeList or a list of SpikeLists

The concatenated SpikeLists must have similar (t_start, t_stop), and they can’t shared similar cells. All their ids have to be different.

See also
append, merge, __setitem__
convert(format='[times, ids]', relative=False, quantized=False)
Return a new representation of the SpikeList object, in a user designed format.
format is an expression containing either the keywords times and ids, time and id.
Inputs:
relative - a boolean to say if a relative representation of the spikes
times compared to t_start is needed

quantized - a boolean to round the spikes_times.

Examples:
>> spk.convert(“[times, ids]”) will return a list of two elements, the
first one being the array of all the spikes, the second the array of all the corresponding ids

>> spk.convert(“[(time,id)]”) will return a list of tuples (time, id)

See also
SpikeTrain.format
copy()

Return a copy of the SpikeList object

cv_isi(float_only=False)

Return the list of all the CV coefficients for each SpikeTrains object within the SpikeList. Return NaN when not enough spikes are present

Inputs:
float_only - False by default. If true, NaN values are automatically
removed
Examples:
>> spklist.cv_isi()
[0.2,0.3,Nan,2.5,Nan,1.,2.5]
>> spklist.cv_isi(True)
[0.2,0.3,2.5,1.,2.5]
See also:
cv_isi_hist, cv_local, cv_kl, SpikeTrain.cv_isi
fano_factor(time_bin)

Compute the Fano Factor of the population activity.

Inputs:
time_bin - the number of bins (between the min and max of the data)
or a list/array containing the lower edges of the bins.

The Fano Factor is computed as the variance of the averaged activity divided by its mean

See also
spike_histogram, firing_rate
fano_factors_isi()

Return a list containing the fano factors for each neuron

See also
isi, isi_cv
filter_duplicates()
firing_rate(time_bin, display=False, average=False, kwargs={})

Generate an array with all the instantaneous firing rates along time (in Hz) of all the SpikeTrains objects within the SpikeList. If average is True, it gives the average firing rate over the whole SpikeList

Inputs:

time_bin - the time bin used to gather the data average - If True, return a single vector of the average firing rate over the whole SpikeList display - if True, a new figure is created. Could also be a subplot. The averaged

spike_histogram over the whole population is then plotted
kwargs - dictionary contening extra parameters that will be sent to the plot
function
See also
spike_histogram, time_axis
first_spike_time()

Get the time of the first real spike in the SpikeList

flatten(id=0.0)

Create a SpikeList with only one address id which is the sum of all SpikeTrains in the SpikeList Returns a new SpikeList.

id2position(id, offset=0)

Return a position (x,y) from an id if the cells are aranged on a grid of size dims, as defined in the dims attribute of the SpikeList object. This assumes that cells are ordered from left to right, top to bottom, and that dims specifies (height, width), i.e. if dims = (10,12), this is an array with 10 rows and 12 columns, and hence has width 12 units and height 10 units.

Inputs:
id - the id of the cell

The ‘dimensions’ attribute of the SpikeList must be defined

See also
activity_map, activity_movie
id_list()

Return the sorted list of all the cells ids contained in the SpikeList object

Examples
>> spklist.id_list()
[0,1,2,3,....,9999]
id_offset(offset)

Add an offset to the whole SpikeList object. All the id are shifted according to an offset value.

Inputs:
offset - the id offset
Examples:
>> spklist.id_list()
[0,1,2,3,4]

>> spklist.id_offset(10) >> spklist.id_list()

[10,11,12,13,14]
id_slice(id_list)

Return a new SpikeList obtained by selecting particular ids

Inputs:
id_list - Can be an integer (and then N random cells will be selected)
or a sublist of the current ids

The new SpikeList inherits the time parameters (t_start, t_stop)

Examples:
>> spklist.id_list()
[830, 1959, 1005, 416, 1011, 1240, 729, 59, 1138, 259]

>> new_spklist = spklist.id_slice(5) >> new_spklist.id_list()

[1011, 729, 1138, 416, 59]
See also
time_slice, interval_slice
isi()

Return the list of all the isi vectors for all the SpikeTrains objects within the SpikeList.

See also:
isi_hist
isi_hist(bins=50, display=False, kwargs={})

Return the histogram of the ISI.

Inputs:
bins - the number of bins (between the min and max of the data)
or a list/array containing the lower edges of the bins.

display - if True, a new figure is created. Could also be a subplot kwargs - dictionary contening extra parameters that will be sent to the plot

function
Examples:
>> z = subplot(221) >> spklist.isi_hist(10, display=z, kwargs={‘color’:’r’})
See also:
isi
last_spike_time()

Get the time of the last real spike in the SpikeList

mean_rate(t_start=None, t_stop=None)

Return the mean firing rate averaged accross all SpikeTrains between t_start and t_stop.

Inputs:
t_start - begining of the selected area to compute mean_rate, in ms t_stop - end of the selected area to compute mean_rate, in ms

If t_start or t_stop are not defined, those of the SpikeList are used

Examples:
>> spklist.mean_rate() >> 12.63
See also
mean_rates, mean_rate_std
mean_rate_covariance(spikelist, time_bin)

Return the covariance of the firing rate along time, if events are binned with a time bin.

Inputs:
spikelist - the other spikelist to compute covariance time_bin - time bin to bin events
See also
mean_rate, mean_rates, mean_rate_variance, firing_rate
mean_rate_std(t_start=None, t_stop=None)

Standard deviation of the firing rates accross all SpikeTrains between t_start and t_stop

Inputs:
t_start - begining of the selected area to compute std(mean_rate), in ms t_stop - end of the selected area to compute std(mean_rate), in ms

If t_start or t_stop are not defined, those of the SpikeList are used

Examples:
>> spklist.mean_rate_std() >> 13.25
See also
mean_rate, mean_rates
mean_rate_variance(time_bin)

Return the standard deviation of the firing rate along time, if events are binned with a time bin.

Inputs:
time_bin - time bin to bin events
See also
mean_rate, mean_rates, mean_rate_covariance, firing_rate
mean_rates(t_start=None, t_stop=None)

Returns a vector of the size of id_list giving the mean firing rate for each neuron

Inputs:
t_start - begining of the selected area to compute std(mean_rate), in ms t_stop - end of the selected area to compute std(mean_rate), in ms

If t_start or t_stop are not defined, those of the SpikeList are used

See also
mean_rate, mean_rate_std
mean_rates_isi(t_start=None, t_stop=None)

Returns a list of mean rates calculated on the basis of interspike interval.

If t_start or t_stop are not defined, those of the SpikeList are used

merge(spikelist, relative=False)

For each cell id in spikelist that matches an id in this SpikeList, merge the two SpikeTrains and save the result in this SpikeList. Note that SpikeTrains with ids not in this SpikeList are appended to it.

Inputs:

spikelist - the SpikeList that should be merged to the current one relative - if True, spike times are expressed in a relative

time compared to the previsous one
Examples:
>> spklist.merge(spklist2)
See also:
concatenate, append, __setitem__
position2id(position, offset=0)

Return the id of the cell at position (x,y) if the cells are aranged on a grid of size dims, as defined in the dims attribute of the SpikeList object

Inputs:
position - a tuple with the position of the cell

The ‘dimensions’ attribute of the SpikeList must be defined and have the same shape as the position argument

See also
activity_map, activity_movie, id2position
raster_plot(id_list=None, t_start=None, t_stop=None, display=True, kwargs={})

Generate a raster plot for the SpikeList in a subwindow of interest, defined by id_list, t_start and t_stop.

Inputs:
id_list - can be a integer (and then N cells are randomly selected) or a list of ids. If None,
we use all the ids of the SpikeList

t_start - in ms. If not defined, the one of the SpikeList object is used t_stop - in ms. If not defined, the one of the SpikeList object is used display - if True, a new figure is created. Could also be a subplot kwargs - dictionary contening extra parameters that will be sent to the plot

function
Examples:
>> z = subplot(221) >> spikelist.raster_plot(display=z, kwargs={‘color’:’r’})
See also
SpikeTrain.raster_plot
raster_plot_flat(id=0.0, **kwargs)

Flattern SpikeList with flatten(), then plot the raster

Inputs:
id - id of the flattened SpikeList. Can be any hashable type kwargs - dictionary contening extra parameters that will be passed to raster_plot
rate_distribution(nbins=25, normalize=True, display=False, kwargs={})

Return a vector with all the mean firing rates for all SpikeTrains.

Inputs:
bins - the number of bins (between the min and max of the data)
or a list/array containing the lower edges of the bins.

display - if True, a new figure is created. Could also be a subplot kwargs - dictionary contening extra parameters that will be sent to the plot

function
See also
mean_rate, mean_rates
raw_data()

Function to return a N by 2 array of all times and ids.

Examples:

>> spklist.raw_data() >> array([[ 1.00000000e+00, 1.00000000e+00],

[ 1.00000000e+00, 1.00000000e+00], [ 2.00000000e+00, 2.00000000e+00],

...,

[ 2.71530000e+03, 2.76210000e+03]])

See also:
convert()
save(user_file)

Save raw data to user_file

select_ids(criteria)

Return the list of all the cells in the SpikeList that will match the criteria expressed with the following syntax.

Inputs :
criteria - a string that can be evaluated on a SpikeTrain object, where the
SpikeTrain should be named ``cell’‘.
Exemples:
>> spklist.select_ids(“cell.mean_rate() > 0”) (all the active cells) >> spklist.select_ids(“cell.mean_rate() == 0”) (all the silent cells) >> spklist.select_ids(“len(cell.spike_times) > 10”) >> spklist.select_ids(“mean(cell.isi()) < 1”)
sort_by(criteria, descending=False)

Return an array with all the ids of the cells in the SpikeList, sorted according to a particular criteria.

Inputs:
criteria - the criteria used to sort the cells. It should be a string
that can be evaluated on a SpikeTrain object, where the SpikeTrain should be named ``cell’‘.

descending - if True, then the cells are sorted from max to min.

Examples:
>> spk.sort_by(‘cell.mean_rate()’) >> spk.sort_by(‘cell.cv_isi()’, descending=True) >> spk.sort_by(‘cell.distance_victorpurpura(target, 0.05)’)
spike_histogram(time_bin, normalized=False, display=False, kwargs={})

Generate an array with all the spike_histograms of all the SpikeTrains objects within the SpikeList.

Inputs:

time_bin - the time bin used to gather the data normalized - if True, the histogram are in Hz (spikes/second), otherwise they are

in spikes/bin
display - if True, a new figure is created. Could also be a subplot. The averaged
spike_histogram over the whole population is then plotted
kwargs - dictionary contening extra parameters that will be sent to the plot
function
See also
firing_rate, time_axis
t_start
t_stop
time_axis(time_bin)

Return a time axis between t_start and t_stop according to a time_bin

Inputs:
time_bin - the bin width
See also
spike_histogram
time_offset(offset, t_start=None, t_stop=None)

Add an offset to the whole SpikeList object. t_start and t_stop are shifted from offset, so does all the SpikeTrain.

Inputs:
offset - the time offset, in ms
Examples:
>> spklist.t_start
1000

>> spklist.time_offset(50) >> spklist.t_start

1050
time_parameters()

Return the time parameters of the SpikeList (t_start, t_stop)

time_slice(t_start, t_stop)

Return a new SpikeList obtained by slicing between t_start and t_stop

Inputs:
t_start - begining of the new SpikeTrain, in ms. t_stop - end of the new SpikeTrain, in ms.
See also
id_slice, interval_slice
class pyNCS.pyST.spikes.SpikeTrain(spike_times, t_start=None, t_stop=None)

Bases: object

SpikeTrain(spikes_times, t_start=None, t_stop=None) This class defines a spike train as a list of times events.

Event times are given in a list (sparse representation) in milliseconds.

Inputs:
spike_times - a list/numpy array of spike times (in milliseconds) t_start - beginning of the SpikeTrain (if not, this is infered) t_stop - end of the SpikeTrain (if not, this is infered)
Examples:

>> s1 = SpikeTrain([0.0, 0.1, 0.2, 0.5]) >> s1.isi()

array([ 0.1, 0.1, 0.3])
>> s1.mean_rate()
8.0
>> s1.cv_isi()
0.565685424949
copy()

Return a copy of the SpikeTrain object

cv_isi()

Return the coefficient of variation of the isis.

cv_isi is the ratio between the standard deviation and the mean of the ISI
The irregularity of individual spike trains is measured by the squared

coefficient of variation of the corresponding inter-spike interval (ISI) distribution normalized by the square of its mean.

In point processes, low values reflect more regular spiking, a

clock-like pattern yields CV2= 0. On the other hand, CV2 = 1 indicates Poisson-type behavior. As a measure for irregularity in the network one can use the average irregularity across all neurons.

http://en.wikipedia.org/wiki/Coefficient_of_variation

See also
isi, cv_kl
cv_kl(bins=100)

Provides a measure for the coefficient of variation to describe the regularity in spiking networks. It is based on the Kullback-Leibler divergence and decribes the difference between a given interspike-interval-distribution and an exponential one (representing poissonian spike trains) with equal mean. It yields 1 for poissonian spike trains and 0 for regular ones.

Reference:
http://incm.cnrs-mrs.fr/LaurentPerrinet/Publications/Voges08fens
Inputs:
bins - the number of bins used to gather the ISI
Examples:
>> spklist.cv_kl(100)
0.98
See also:
cv_isi
distance_vanrossum(spktrain, tc=5.0, dt=0.1)

Returns the van Rossum metric of the two spike trians. dt - time bins to calculate the exponentials. tc - time constant / cost of the exponentials.

distance_victorpurpura(spktrain, cost=0.5)

Function to calculate the Victor-Purpura distance between two spike trains. See J. D. Victor and K. P. Purpura,

Nature and precision of temporal coding in visual cortex: a metric-space analysis., J Neurophysiol,76(2):1310-1326, 1996
Inputs:
spktrain - the other SpikeTrain cost - The cost parameter. See the paper for more information
duration()

Return the duration of the SpikeTrain

fano_factor_isi()

Return the fano factor of this spike trains ISI.

The Fano Factor is defined as the variance of the isi divided by the mean of the isi

http://en.wikipedia.org/wiki/Fano_factor

See also
isi, cv_isi
format(relative=False, quantized=False)

Return an array with a new representation of the spike times

Inputs:
relative - if True, spike times are expressed in a relative
time compared to the previsous one

quantized - a value to divide spike times with before rounding

Examples:

>> st.spikes_times=[0, 2.1, 3.1, 4.4] >> st.format(relative=True)

[0, 2.1, 1, 1.3]
>> st.format(quantized=2)
[0, 1, 2, 2]
is_equal(spktrain)

Return True if the SpikeTrain object is equal to one other SpikeTrain, i.e if they have same time parameters and same spikes_times

Inputs:
spktrain - A SpikeTrain object
See also:
time_parameters()
isi()

Return an array with the inter-spike intervals of the SpikeTrain

Examples:

>> st.spikes_times=[0, 2.1, 3.1, 4.4] >> st.isi()

[2.1, 1., 1.3]
See also
cv_isi
jitter(jitter)

Returns a new SpikeTrain with spiketimes jittered by a normal distribution.

Inputs:
jitter - sigma of the normal distribution
Examples:
>> st_jittered = st.jitter(2.0)
mean_rate(t_start=None, t_stop=None)

Returns the mean firing rate between t_start and t_stop, in Hz

Inputs:
t_start - in ms. If not defined, the one of the SpikeTrain object is used t_stop - in ms. If not defined, the one of the SpikeTrain object is used
Examples:
>> spk.mean_rate()
34.2
mean_rate_isi(t_start=None, t_stop=None)

Returns the mean rate (Hz) based on the interspike intervals

Inputs:
t_start, t_stop - in ms. If not defined, the one of the SpikeTrain object is used
merge(spiketrain)

Add the spike times from a spiketrain to the current SpikeTrain

Inputs:
spiketrain - The SpikeTrain that should be added
Examples:

>> a = SpikeTrain(range(0,100,10),0.1,0,100) >> b = SpikeTrain(range(400,500,10),0.1,400,500) >> a.merge(b) >> a.spike_times

[ 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 400., 410., 420., 430., 440., 450., 460., 470., 480., 490.]
>> a.t_stop
500
relative_times()

Rescale the spike times to make them relative to t_start.

Note that the SpikeTrain object itself is modified, t_start is substracted to spike_times, t_start and t_stop

spike_times
time_axis(time_bin=10)

Return a time axis between t_start and t_stop according to a time_bin

Inputs:
time_bin - the bin width
Examples:

>> st = SpikeTrain(range(100),0.1,0,100) >> st.time_axis(10)

[ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90n 100]
See also
time_histogram
time_histogram(time_bin=10, normalized=True)

Bin the spikes with the specified bin width. The first and last bins are calculated from self.t_start and self.t_stop.

Inputs:

time_bin - the bin width for gathering spikes_times normalized - if True, the bin values are scaled to represent firing rates

in spikes/second, otherwise otherwise it’s the number of spikes per bin.
Examples:

>> st=SpikeTrain(range(0,100,5),0.1,0,100) >> st.time_histogram(10)

[200, 200, 200, 200, 200, 200, 200, 200, 200, 200]
>> st.time_histogram(10, normalized=False)
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
See also
time_axis
time_offset(offset, t_start=None, t_stop=None)

Add an offset to the SpikeTrain object. t_start and t_stop are shifted from offset, so does all the spike times.

Inputs:
offset - the time offset, in ms
Examples:

>> spktrain = SpikeTrain(arange(0,100,10)) >> spktrain.time_offset(50) >> spklist.spike_times

[ 50., 60., 70., 80., 90., 100., 110., 120., 130., 140.]
time_parameters()

Return the time parameters of the SpikeTrain (t_start, t_stop)

time_slice(t_start, t_stop)

Return a new SpikeTrain obtained by slicing between t_start and t_stop. The new t_start and t_stop values of the returned SpikeTrain are the one given as arguments

Inputs:
t_start - begining of the new SpikeTrain, in ms. t_stop - end of the new SpikeTrain, in ms.
Examples:

>> spk = spktrain.time_slice(0,100) >> spk.t_start

0
>> spk.t_stop
100
class pyNCS.pyST.spikes.emptySpikeTrain

Bases: pyNCS.pyST.spikes.SpikeTrain

merge(spiketrain)
spike_times
pyNCS.pyST.spikes.get_display(display)

Returns a pylab object with a plot() function to draw the plots.

Inputs:
display - if True, a new figure is created. Otherwise, if display is a
subplot object, this object is returned.
pyNCS.pyST.spikes.load(user_file)

Load a file saved by SpikeList.save

pyNCS.pyST.spikes.merge(*spiketrains)

Merge spike times from a spiketrain

Inputs:
spiketrains - The SpikeTrain that should be added
Examples:

>> a = SpikeTrain(range(0,100,10),0.1,0,100) >> b = SpikeTrain(range(400,500,10),0.1,400,500) >> a = merge(a, b) >> a.spike_times

[ 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 400., 410., 420., 430., 440., 450., 460., 470., 480., 490.]
>> a.t_stop
500
pyNCS.pyST.spikes.merge_sequencers(stim1, stim2 ......)

Merges (soon to be) sequencer objects. These are typically returend by pyNCS.group spiketrain functions and used in setup.run

pyNCS.pyST.spikes.merge_spikelists(*lspikelist)
pyNCS.pyST.spikes.set_axis_limits(subplot, xmin, xmax, ymin, ymax)

Defines the axis limits of a plot.

Inputs:
subplot - the targeted plot xmin, xmax - the limits of the x axis ymin, ymax - the limits of the y axis
Example:
>> x = range(10) >> y = [] >> for i in x: y.append(i*i) >> pylab.plot(x,y) >> plotting.set_axis_limits(pylab, 0., 10., 0., 100.)
pyNCS.pyST.spikes.set_labels(subplot, xlabel, ylabel)

Defines the axis labels of a plot.

Inputs:
subplot - the targeted plot xlabel - a string for the x label ylabel - a string for the y label
Example:
>> x = range(10) >> y = [] >> for i in x: y.append(i*i) >> pylab.plot(x,y) >> plotting.set_labels(pylab, ‘x’, ‘y=x^2’)

stgen Module

NeuroTools.stgen

A collection of tools for stochastic process generation.

Classes

StGen - Object to generate stochastic processes of various kinds
and return them as SpikeTrain or AnalogSignal objects.

Functions

shotnoise_fromspikes - Convolves the provided spike train with shot decaying exponential.

gamma_hazard - Compute the hazard function for a gamma process with parameters a,b.

class pyNCS.pyST.stgen.StGen(rng=None, seed=None)
OU_generator(dt, tau, sigma, y0, t_start=0.0, t_stop=1000.0, array=False, time_it=False)

Generates an Orstein Ulbeck process using the forward euler method. The function returns an AnalogSignal object.

Inputs:

dt - the time resolution in milliseconds of th signal tau - the correlation time in milliseconds sigma - std dev of the process y0 - initial value of the process, at t_start t_start - start time in milliseconds t_stop - end time in milliseconds array - if True, the functions returns the tuple (y,t)

where y and t are the OU signal and the time bins, respectively, and are both numpy arrays.
Examples:
>> stgen.OU_generator(0.1, 2, 3, 0, 0, 10000)
See also:
OU_generator_weave1
OU_generator_weave1(dt, tau, sigma, y0, t_start=0.0, t_stop=1000.0, time_it=False)

Generates an Orstein Ulbeck process using the forward euler method. The function returns an AnalogSignal object.

OU_generator_weave1, as opposed to OU_generator, uses scipy.weave and is thus much faster.

Inputs:

dt - the time resolution in milliseconds of th signal tau - the correlation time in milliseconds sigma - std dev of the process y0 - initial value of the process, at t_start t_start - start time in milliseconds t_stop - end time in milliseconds array - if True, the functions returns the tuple (y,t)

where y and t are the OU signal and the time bins, respectively, and are both numpy arrays.
Examples:
>> stgen.OU_generator_weave1(0.1, 2, 3, 0, 0, 10000)
See also:
OU_generator
inh_2Dadaptingmarkov_generator(a, bq, tau_s, tau_r, qrqs, t, t_stop, array=False)

Returns a SpikeList whose spikes are an inhomogeneous realization (dynamic rate) of the so-called 2D adapting markov process (see references). 2D implies the process has two states, an adaptation state, and a refractory state, both of which affect its probability to spike. The implementation uses the thinning method, as presented in the references.

For the 1d implementation, with no relative refractoriness, see the inh_adaptingmarkov_generator.

Inputs:
a,bq - arrays of the parameters of the hazard function where a[i] and bq[i]
will be active on interval [t[i],t[i+1]]

tau_s - the time constant of adaptation (in milliseconds). tau_r - the time constant of refractoriness (in milliseconds). qrqs - the ratio of refractoriness conductance to adaptation conductance.

typically on the order of 200.
t - an array specifying the time bins (in milliseconds) at which to
specify the rate

t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,

rather than a SpikeList object.
Note:
  • t_start=t[0]
  • a is in units of Hz. Typical values are available in Fig. 1 of Muller et al 2007, a~5-80Hz (low to high stimulus)
  • bq here is taken to be the quantity b*q_s in Muller et al 2007, is thus dimensionless, and has typical values bq~3.0-1.0 (low to high stimulus)
  • qrqs is the quantity q_r/q_s in Muller et al 2007, where a value of qrqs = 3124.0nS/14.48nS = 221.96 was used.
  • tau_s has typical values on the order of 100 ms
  • tau_r has typical values on the order of 2 ms

References:

Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.

Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.

Examples:
See source:trunk/examples/stgen/inh_2Dmarkov_psth.py
See also:
inh_poisson_generator, inh_gamma_generator, inh_adaptingmarkov_generator
inh_adaptingmarkov_generator(a, bq, tau, t, t_stop, array=False)

Returns a SpikeList whose spikes are an inhomogeneous realization (dynamic rate) of the so-called adapting markov process (see references). The implementation uses the thinning method, as presented in the references.

This is the 1d implementation, with no relative refractoriness. For the 2d implementation with relative refractoriness, see the inh_2dadaptingmarkov_generator.

Inputs:
a,bq - arrays of the parameters of the hazard function where a[i] and bq[i]
will be active on interval [t[i],t[i+1]]

tau - the time constant of adaptation (in milliseconds). t - an array specifying the time bins (in milliseconds) at which to

specify the rate

t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,

rather than a SpikeList object.
Note:
  • t_start=t[0]
  • a is in units of Hz. Typical values are available in Fig. 1 of Muller et al 2007, a~5-80Hz (low to high stimulus)
  • bq here is taken to be the quantity b*q_s in Muller et al 2007, is thus dimensionless, and has typical values bq~3.0-1.0 (low to high stimulus)
  • tau_s has typical values on the order of 100 ms

References:

Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.

Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.

Examples:
See source:trunk/examples/stgen/inh_2Dmarkov_psth.py
See also:
inh_poisson_generator, inh_gamma_generator, inh_2dadaptingmarkov_generator
inh_gamma_generator(a, b, t, t_stop, array=False)

Returns a SpikeList whose spikes are a realization of an inhomogeneous gamma process (dynamic rate). The implementation uses the thinning method, as presented in the references.

Inputs:
a,b - arrays of the parameters of the gamma PDF where a[i] and b[i]
will be active on interval [t[i],t[i+1]]
t - an array specifying the time bins (in milliseconds) at which to
specify the rate

t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,

rather than a SpikeList object.
Note:
t_start=t[0] a is a dimensionless quantity > 0, but typically on the order of 2-10. a = 1 results in a poisson process. b is assumed to be in units of 1/Hz (seconds).

References:

Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.

Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.

Examples:
See source:trunk/examples/stgen/inh_gamma_psth.py
See also:
inh_poisson_generator, gamma_hazard
inh_poisson_generator(rate, t, t_stop, base_generator=None, array=False, **base_generator_kwargs)

Returns a SpikeList whose spikes are a realization of an inhomogeneous poisson process (dynamic rate). The implementation uses the thinning method, as presented in the references.

Inputs:
rate - an array of the rates (Hz) where rate[i] is active on interval
[t[i],t[i+1]]
t - an array specifying the time bins (in milliseconds) at which to
specify the rate

t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,

rather than a SpikeList object.
Note:
t_start=t[0]

References:

Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.

Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.

Examples:
>> time = arange(0,1000) >> stgen.inh_poisson_generator(time,sin(time), 1000)
See also:
poisson_generator, inh_gamma_generator, inh_adaptingmarkov_generator
poisson_generator(rate, t_start=0.0, t_stop=1000.0, array=False, debug=False)

Returns a SpikeTrain whose spikes are a realization of a Poisson process with the given rate (Hz) and stopping time t_stop (milliseconds).

Note: t_start is always 0.0, thus all realizations are as if they spiked at t=0.0, though this spike is not included in the SpikeList.

Inputs:

rate - the rate of the discharge (in Hz) t_start - the beginning of the SpikeTrain (in ms) t_stop - the end of the SpikeTrain (in ms) array - if True, a numpy array of sorted spikes is returned,

rather than a SpikeTrain object.
Examples:
>> gen.poisson_generator(50, 0, 1000) >> gen.poisson_generator(20, 5000, 10000, array=True)
See also:
inh_poisson_generator, inh_gamma_generator, inh_adaptingmarkov_generator
regular_gaussian_generator(rate, phase=0.0, scale=5.0, t_start=0.0, t_stop=1000.0, array=False)

Returns a SpikeTrain whose spikes are regularly spaced, but jittered according to a Gaussian distribution around the spiking period, with the given rate (Hz) and stopping time t_stop (milliseconds).

Note: t_start is always 0.0, thus all realizations are as if they spiked at t=0.0, though this spike is not included in the SpikeList.

Inputs:

rate - the rate of the discharge (in Hz) t_start - the beginning of the SpikeTrain (in ms) t_stop - the end of the SpikeTrain (in ms) phase - Offset the spiketrain by this number (in ms.) scale - width of the Gaussian distribution placed at the regular

spike times, according to which the spike will be drawn (in ms)
array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeTrain object.
Examples:
>> regular_generator(50, 0, 1000) >> regular_generator(20, 5000, 10000, array=True)
See also:
inh_poisson_generator, inh_gamma_generator, inh_adaptingmarkov_generator
regular_generator(rate, phase=0.0, jitter=True, t_start=0.0, t_stop=1000.0, array=False)

Returns a SpikeTrain whose spikes are regularly spaced with the given rate (Hz) and stopping time t_stop (milliseconds).

Note: t_start is always 0.0, thus all realizations are as if they spiked at t=0.0, though this spike is not included in the SpikeList.

Inputs:

rate - the rate of the discharge (in Hz) t_start - the beginning of the SpikeTrain (in ms) phase - Offset the spiketrain by this number (in ms.) jitter - whether the spiketrain should be jittered by an amount numpy.random.rand()/rate t_stop - the end of the SpikeTrain (in ms) array - if True, a numpy array of sorted spikes is returned,

rather than a SpikeTrain object.
Examples:
>> regular_generator(50, 0, 1000) >> regular_generator(20, 5000, 10000, array=True)
See also:
inh_poisson_generator, inh_gamma_generator, inh_adaptingmarkov_generator
seed(seed)

seed the gsl rng with a given seed

pyNCS.pyST.stgen.gamma_hazard(x, a, b, dt=0.0001)

Compute the hazard function for a gamma process with parameters a,b where a and b are the parameters of the gamma PDF: y(t) = x^(a-1) exp(-x/b) / (Gamma(a)*b^a)

Inputs:
x - in units of seconds a - dimensionless b - in units of seconds
See also:
inh_gamma_generator

Table Of Contents

Previous topic

AerViewer Package

Next topic

The Python Oscilloscope Module

This Page