@@ -37,7 +37,7 @@ please see the below dropdown for a refresher.
37
37
This is known as the 'sampling step' (sometimes denoted $t_s$) and is the inverse of
38
38
the sampling frequency.
39
39
40
- .. image :: handle-times-sampling-image.png
40
+ .. image :: handle_times_files/ handle-times-sampling-image.png
41
41
:alt: Image of continuous signal (1 second) with dots indicating samples collected at 0, 0.25, 0.5 and 0.75 seconds.
42
42
:width: 400px
43
43
:align: center
@@ -56,28 +56,29 @@ An Overview of the possible Time representations in SpikeInterface
56
56
57
57
When you load a recording into SpikeInterface, it will be automatically
58
58
associated with a time array. Depending on your data format, this might
59
- be loaded from metadata on your raw recording. [TODO: concrete example of this?]
59
+ be loaded from metadata on your raw recording.
60
+
61
+ **[TODO: concrete example of this?] **
60
62
61
63
If there is no time metadata on your raw recording, the times will be
62
64
generated based on your sampling rate and number of samples.
63
65
64
66
You can use the `get_times() ` method to inspect the time array associated
65
67
with your recording.
66
68
67
- ```
68
- import spikeinterface.full as si
69
+ .. code-block :: python
69
70
70
- # Generate a recording for this example
71
- recording, _ = si.generate_ground_truth_recording(durations=[10])
71
+ import spikeinterface.full as si
72
72
73
- print(f"number of samples: { recording.get_num_samples()}")
74
- print(f"sampling frequency: { recording.get_sampling_frequency()}"
73
+ # Generate a recording for this example
74
+ recording, _ = si.generate_ground_truth_recording( durations = [ 10 ])
75
75
76
- print(
77
- recording.get_times()
78
- )
76
+ print (f " number of samples: { recording.get_num_samples()} " )
77
+ print (f " sampling frequency: { recording.get_sampling_frequency()} "
79
78
80
- ```
79
+ print (
80
+ recording.get_times()
81
+ )
81
82
82
83
Here, we see that as no time metadata was associated with the loaded recording,
83
84
the time array starts at 0 seconds and continues until 10 seconds
@@ -106,15 +107,15 @@ the first timepoint of the recording. Shifting by a positive value will
106
107
increase the start time, while shifting by a negative value will decrease
107
108
the start time.
108
109
109
- ```
110
- recording.shift_start_time(100.15)
110
+ .. code- block:: python
111
+
112
+ recording.shift_start_time(100.15 )
111
113
112
- print(recording.get_times()) # time now start at 100.15 seconds
114
+ print (recording.get_times()) # time now start at 100.15 seconds
113
115
114
- recording.shift_start_time(-50.15)
116
+ recording.shift_start_time(- 50.15 )
115
117
116
- print(recording.get_times()) # time now start at 50 seconds
117
- ```
118
+ print (recording.get_times()) # time now start at 50 seconds
118
119
119
120
120
121
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -144,20 +145,21 @@ Retrieving timepoints from sample index
144
145
SpikeInterface provides two convenience methods for obtaining the timepoint in seconds
145
146
given an index of the time array:
146
147
147
- ```
148
- sample_index = recording.time_to_sample_index(5.0)
148
+ .. code- block:: python
149
+
150
+ sample_index = recording.time_to_sample_index(5.0 )
151
+
152
+ print (sample_index)
149
153
150
- print(sample_index)
151
- ```
152
154
153
155
Similarly, you can retrieve the time array index given a timepoint:
154
156
155
157
156
- ```
157
- timepoint = recording.sample_index_to_to_time(125000)
158
+ .. code- block:: python
159
+
160
+ timepoint = recording.sample_index_to_to_time(125000 )
158
161
159
- print(timepoint)
160
- ```
162
+ print (timepoint)
161
163
162
164
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163
165
Aligning events across timestreams
@@ -167,6 +169,6 @@ The alignment of electrophysiology recording time to other data streams (e.g. be
167
169
is an important step in ephys analysis. To acheive this,it is common to collect
168
170
a synconrisation (' sync' ) pulse on an additional channel. At present SpikeInterface does not include
169
171
features for time- alignment, but some useful articles can be found on the following pages,
170
- [ SpikeGLX]( https://github.com/billkarsh/SpikeGLX/blob/master/Markdown/UserManual.md#procedure-to-calibrate-sample-rates) ,
171
- [ OpenEphys]( https://open-ephys.github.io/gui-docs/Tutorials/Data-Synchronization.html) ,
172
- [ NWB]( https://neuroconv.readthedocs.io/en/main/user_guide/temporal_alignment.html).
172
+ ` SpikeGLX < https:// github.com/ billkarsh/ SpikeGLX/ blob/ master/ Markdown/ UserManual.md# procedure-to-calibrate-sample-rates>`_ ,
173
+ ` OpenEphys < https:// open - ephys.github.io/ gui- docs/ Tutorials/ Data- Synchronization.html> ` _ ,
174
+ ` NWB < https:// neuroconv.readthedocs.io/ en/ main/ user_guide/ temporal_alignment.html> ` _
0 commit comments