Skip to content

Commit f533d19

Browse files
committed
Add some rough code.
1 parent 1faa215 commit f533d19

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

doc/how_to/handle_times.rst

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
How SpikeInterface handles Time
22
=================================
33

4-
Extracellula electrophysiology commonly involves synchronisation of events
4+
Extracellular electrophysiology commonly involves synchronisation of events
55
across many timestreams. For example, an experiment may involve
66
displaying a stimuli to an animal and recording the stimuli-evoked
77
neuronal responses. It is critical that timings is represented in
@@ -85,10 +85,17 @@ segment one and index in the peak at index 300 in segment two, both
8585
segments action potential peaks will be given a spike time of 0.1 s,
8686
and their segment tracked to distinguish them. TODO: CHECK
8787

88+
# TODO: yes follow a code example!
89+
```sorting.get_unit_spike_train(0, return_times=True, segment_index=1)```
90+
8891
^^^^^^^^^^^^^^^^^^^^^^^^^
8992
Providing the start time
9093
^^^^^^^^^^^^^^^^^^^^^^^^^
9194

95+
### TODO :::: This section make no sense because you can't set
96+
`t_start` directly as far as I can tell, it is only available on
97+
a few extractors.
98+
9299
Alternatively, the start-time of each segment can be provided to
93100
spikeinterface. The same method (index * (1 / sampling_frequency))
94101
will be used to determine event spike, but now an initial offset
@@ -114,21 +121,32 @@ Alternatively, if you wanted to ignore the 10 minute gap, you could do:
114121
```
115122
recording.select_segment(1).set_times(XXXX)
116123
```
124+
``` print spike times```
125+
sorting.get_unit_spike_train(0, return_times=True, segment_index=1)
126+
# TODO: it says use time vector but this doesn't return times.
117127

118128
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119129
Providing the full time array
120130
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121131

122132
Finally, may want to get full time array. Where do you get this from?
133+
Loaded - some more information on where from
134+
135+
`recording.has_time_vector()`.
136+
137+
we can set times e.g. as above.
123138

124-
Note that for some extractors, e.g. read_openephys you can load the syncrhonized timestamps directly (load_sync_timestamps param). It would be important to mention!
139+
1) set the times
140+
2) print the times. Note how they are different to the above case!
125141

142+
Note that for some extractors, e.g. read_openephys you can load the
143+
syncrhonized timestamps directly (load_sync_timestamps param). It would be
144+
important to mention! Section on when files are loaded autoamticaly!
126145

127146
--------------------------
128147
Accessing time information
129148
--------------------------
130149

131150
Cover the The two time array functions.
132151

133-
`time_to_sample_index`
134152
`sample_index_to_time`

0 commit comments

Comments
 (0)