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

class allensdk.brain_observatory.behavior.data_objects.running_speed.running_acquisition.RunningAcquisition(running_acquisition: DataFrame, stimulus_file: BehaviorStimulusFile | None = None, stimulus_timestamps: StimulusTimestamps | None = None)[source]

Bases: DataObject, NwbReadableInterface, NwbWritableInterface

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

Running aquisition data is represented as:

Pandas Dataframe with an index of timestamps and the following columns:

“dx”: Angular change, computed during data collection “v_sig”: Voltage signal from the encoder “v_in”: The theoretical maximum voltage that the encoder

will reach prior to “wrapping”. This should theoretically be 5V (after crossing 5V goes to 0V, or vice versa). In practice the encoder does not always reach this value before wrapping, which can cause transient spikes in speed at the voltage “wraps”.

classmethod from_multiple_stimulus_files(behavior_stimulus_file: BehaviorStimulusFile, mapping_stimulus_file: MappingStimulusFile, replay_stimulus_file: ReplayStimulusFile, sync_file: SyncFile) RunningAcquisition[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) RunningAcquisition[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) RunningAcquisition[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.