utils.py
Utilities shared across the decoding pipelines.
resolve_orientation_col(df, orientation_name=None)
¶
Resolve the orientation column name in a position dataframe.
Position sources name the head-direction column differently: v1
Trodes/DLC position uses "orientation" while legacy common_position
uses "head_orientation". A requested orientation_name is honored
when present; otherwise the first known orientation column found in df
is returned (preferring "orientation").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
Position dataframe whose columns are inspected. |
required |
orientation_name
|
str
|
Preferred column name to use if present in |
None
|
Returns:
| Type | Description |
|---|---|
str or None
|
The resolved orientation column name, or |