add_angle_rgb_to_ds#
- ethograph.io.dataset.add_angle_rgb_to_ds(ds, smoothing_params)[source]#
Compute heading angles and RGB color-coding from 2-D position data.
For each individual/keypoint combination, calculates the heading angle from consecutive (x, y) positions and maps it to an RGB color via
get_angle_rgb(). Gaussian smoothing is applied before angle computation.Adds two variables to ds:
angles– heading angle in radians.angle_rgb–(R, G, B)triplet per time-step
- Parameters:
ds (xarray.Dataset) – Dataset containing a
positionvariable with at leastspace=["x", "y"]and a time dimension.smoothing_params (dict) – Keyword arguments forwarded to
scipy.ndimage.gaussian_filter1d()(e.g.{"sigma": 3}).
- Returns:
The input dataset with
anglesandangle_rgbadded in-place.- Return type: