|
131 | 131 | from pynwb import NWBHDF5IO, NWBFile, TimeSeries
|
132 | 132 | from pynwb.behavior import Position, SpatialSeries
|
133 | 133 | from pynwb.file import Subject
|
| 134 | +from pynwb.misc import AnnotationSeries |
134 | 135 |
|
135 | 136 | ####################
|
136 | 137 | # .. _basics_nwbfile:
|
|
285 | 286 | # or using the method :py:meth:`.NWBFile.get_acquisition`:
|
286 | 287 | nwbfile.get_acquisition("test_timeseries")
|
287 | 288 |
|
| 289 | +#################### |
| 290 | +# Other Types of Time Series |
| 291 | +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 292 | +# |
| 293 | +# As mentioned previously, there are many subtypes of :py:class:`~pynwb.base.TimeSeries` that are used to store |
| 294 | +# different kinds of data. One example is :py:class:`~pynwb.misc.AnnotationSeries`, a subclass of |
| 295 | +# :py:class:`~pynwb.base.TimeSeries` that stores text-based records about the experiment. Similarly to our |
| 296 | +# :py:class:`~pynwb.base.TimeSeries` example above, we can create an :py:class:`~pynwb.misc.AnnotationSeries` |
| 297 | +# object with text information about a stimulus and add it to the stimulus group in |
| 298 | +# the :py:class:`~pynwb.file.NWBFile`. |
| 299 | + |
| 300 | +annotations = AnnotationSeries(name='airpuffs', |
| 301 | + data=['Left Airpuff', 'Right Airpuff', 'Right Airpuff'], |
| 302 | + description='Airpuff events delivered to the animal', |
| 303 | + timestamps=[1.0, 3.0, 8.0]) |
| 304 | + |
| 305 | +nwbfile.add_stimulus(annotations) |
| 306 | + |
| 307 | +#################### |
| 308 | +# This approach of creating a :py:class:`~pynwb.base.TimeSeries` object and adding it to the appropriate |
| 309 | +# :py:class:`~pynwb.file.NWBFile` group can be used for all subtypes of :py:class:`~pynwb.base.TimeSeries` data. |
288 | 310 |
|
289 | 311 | ####################
|
290 | 312 | # .. _basic_spatialseries:
|
|
0 commit comments