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:
Returns:

The input dataset with angles and angle_rgb added in-place.

Return type:

xarray.Dataset