allensdk.brain_observatory.behavior.data_objects.running_speed.running_speed module

class allensdk.brain_observatory.behavior.data_objects.running_speed.running_speed.RunningSpeed(running_speed: DataFrame, stimulus_file: BehaviorStimulusFile | None = None, sync_file: SyncFile | None = None, stimulus_timestamps: StimulusTimestamps | None = None, filtered: bool = True)[source]

Bases: DataObject, NwbReadableInterface, NwbWritableInterface

A DataObject which contains properties and methods to load, process, and represent running speed data.

Running speed data is represented as:

Pandas Dataframe with the following columns:

“timestamps”: Timestamps (in s) for calculated speed values “speed”: Computed running speed in cm/s

classmethod from_multiple_stimulus_files(behavior_stimulus_file: BehaviorStimulusFile, mapping_stimulus_file: MappingStimulusFile, replay_stimulus_file: ReplayStimulusFile, sync_file: SyncFile, filtered: bool = True, zscore_threshold: float = 10.0) RunningSpeed[source]

sync_file is used for generating timestamps.

Stimulus blocks are assumed to be presented in the order behavior_stimulus_file mapping_stimulus_file replay_stimulus_file

classmethod from_nwb(nwbfile: NWBFile, filtered=True) RunningSpeed[source]

Populate a DataObject from a pyNWB file object.

Parameters:
nwbfile:

The file object (NWBFile) of a pynwb dataset file.

Returns:
DataObject:

An instantiated DataObject which has name and value properties

classmethod from_stimulus_file(behavior_stimulus_file: BehaviorStimulusFile, sync_file: SyncFile | None = None, filtered: bool = True, zscore_threshold: float = 10.0) RunningSpeed[source]

sync_file is used for generating timestamps. If None, timestamps will be generated from the stimulus file.

to_nwb(nwbfile: NWBFile) NWBFile[source]

Given an already populated DataObject, return an pyNWB file object that had had DataObject data added.

Parameters:
nwbfileNWBFile

An NWB file object

Returns:
NWBFile

An NWB file object that has had data from the DataObject added to it.