Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Latest commit

 

History

History
135 lines (81 loc) · 2.81 KB

File metadata and controls

135 lines (81 loc) · 2.81 KB
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 NWBFile class from pynwb, create an NWBFile object
  • You will need to pass in the arguments session_description, identifier, and session_start_time to 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.

Part 1: Creating a TimeSeries

Now let's review how to create a TimeSeries.

  • Import the TimeSeries class from pynwb, create the TimeSeries object
  • You will need to pass in the arguments data, units, and timestamps to the constructor.
  • Finally, print out the data from the TimeSeries.

Review the code in Section 1 if you are stuck!

Part 2: Add a TimeSeries to an NWBFile

Now let's review how to add a TimeSeries to an NWBFile.

  • Use the appropriate method of NWBFile to add the TimeSeries to nwbfile.
  • Access the TimeSeries object 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.