allensdk.brain_observatory.behavior.data_objects.running_speed.multi_stim_running_processing module¶
- allensdk.brain_observatory.behavior.data_objects.running_speed.multi_stim_running_processing.multi_stim_running_df_from_raw_data(sync_path: str, behavior_stimulus_file: BehaviorStimulusFile, mapping_stimulus_file: MappingStimulusFile, replay_stimulus_file: ReplayStimulusFile, use_lowpass_filter: bool, zscore_threshold: float, behavior_start_frame: int) Tuple[DataFrame, DataFrame][source]¶
Derive running speed data frames from sync file and pickle files
- Parameters:
- sync_path: str
The path to the sync file
- behavior_stimulus_file: BehaviorStimulusFile
stimulus file for the behavior stimulus block
- mapping_stimulus_file: MappingStimulusFile
stimulus file for the mapping stimulus block
- replay_stimulus_file: ReplayStimulusFile
stimulus file for the replay stimulus block
- use_lowpass_filter: bool
whther or not to apply a low pass filter to the running speed results
- zscore_threshold: float
The threshold to use for removing outlier running speeds which might be noise and not true signal
- behavior_start_frame: int
the frame on which behavior data starts
- Returns:
- Tuple[pd.DataFrame, pd.DataFrame]
concatenated velocity data, raw data
Notes
- velocities pd.DataFrame:
- columns:
“velocity”: computed running speed “net_rotation”: dx in radians “frame_indexes”: frame indexes into
the full vsync times list
- raw data pd.DataFrame:
Dataframe with an index of timestamps and the following columns:
“vsig”: voltage signal from the encoder “vin”: 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”.
“frame_time”: list of the vsync times “dx”: angular change, computed during data collection
The raw data are provided so that the user may compute their own speed from source, if desired.