|
@@ -5,18 +5,16 @@ import quantities as pq
|
|
|
|
|
|
n_segments = 2
|
|
|
n_spiketrains = 8
|
|
|
+n_waveform_samples = 10
|
|
|
n_analogsignals = 4
|
|
|
n_irregularlysampledsignals = 1
|
|
|
n_events = 2
|
|
|
n_epochs = 3
|
|
|
|
|
|
+random_generator = np.random.default_rng(seed=42)
|
|
|
+
|
|
|
def get_rand(shape=None, min=0, max=1, sorted=False):
|
|
|
- if shape is None:
|
|
|
- data = np.random.rand()
|
|
|
- elif hasattr(shape, '__iter__'):
|
|
|
- data = np.random.rand(*shape)
|
|
|
- else:
|
|
|
- data = np.random.rand(shape)
|
|
|
+ data = random_generator.random(shape)
|
|
|
|
|
|
#rescaling random numbers to min-max range
|
|
|
data = data*(max-min) + min
|
|
@@ -31,8 +29,10 @@ def generate_basic_block():
|
|
|
block.segments.append(seg)
|
|
|
|
|
|
for spiketrain_idx in range(n_spiketrains):
|
|
|
+ waveforms = get_rand((10, 14)) * pq.V
|
|
|
st = neo.SpikeTrain(times=get_rand((10), max=10, sorted=True)*pq.s, t_stop=10*pq.s,
|
|
|
- name=f'my_spiketrain_{spiketrain_idx}')
|
|
|
+ name=f'my_spiketrain_{spiketrain_idx}', waveforms=waveforms,
|
|
|
+ left_sweep=4)
|
|
|
st.segment = seg
|
|
|
seg.spiketrains.append(st)
|
|
|
|