| title | Chapter 1: Getting Started |
|---|---|
| description | This chapter will introduce you to the basics of the Neurodata Without Borders: Neurophysiology (NWB:N) data format using Python. |
| prev | |
| next | /chapter2 |
| type | chapter |
| id | 1 |
Let's try out PyNWB! First, let's review how to create an NWBFile object.
Change the code below to do the following:
- Import the
NWBFileclass frompynwb, create anNWBFileobject - You will need to pass in the arguments
session_description,identifier, andsession_start_timeto the constructor. - Finally, print out the session identifier from the
NWBFile.
Review the code in Section 1 if you are stuck!
Pop quiz! An NWBFile requires a session_description, an identifier, and what?
institution is not a required argument, but it is and optional argument.
subject is not a required argument, but it is and optional argument.
Correct! You must specify a session_start_time to which all timestamps in the
NWBFile will be referenced.
Now let's review how to create a TimeSeries.
- Import the
TimeSeriesclass frompynwb, create theTimeSeriesobject - You will need to pass in the arguments
data,units, andtimestampsto the constructor. - Finally, print out the data from the
TimeSeries.
Review the code in Section 1 if you are stuck!
Now let's review how to add a TimeSeries to an NWBFile.
- Use the appropriate method of
NWBFileto add theTimeSeriestonwbfile. - Access the
TimeSeriesobject that you just added and print it.
Use the name of the time series to get it from nwbfile.acquisition Review the code in Section 1 if you are stuck!
What units are all timestamps of TimeSeries stored as?
Sorry, try again.
Good job!
Sorry, try again.