The goal is the implementation of a angle_relative_to_horizontal (angle-z) function in metrics.py, which as the name suggests will calculate the angle between the horizontal plane, the acceleration vector. The wristpy package will rely on this metric for accurately assessing spatial orientation and movement patterns. Having accurate spatial orientation data will be a critical component of behavioral assessments and sleep-wake cycle evaluation down the line.
The input of the function will be a Measurement object containing the accelereation data and timestamps. The acceleration data will be an ndarray of shape # of samples x 3 cols (x,y,z axis). The timestamps will be a 1D Polars series of datetime.datetime objects. The output will be a new Measurement object in which the value of the measurements will be an ndarray of angle-z values, and the time attribute will be the unaltered from the input.
Tasks
[x] The function should take as input an instance of the Measurement class, where the measurement attribute is acceleration in the form of an np.array and the time attribute is a polars Series of datetime.datetime objects.
[x] calculate angle-z values at each sample in degrees.
[x] the function should output a Measurement object where the measurement attribute is angle-z calculation and the time attribute is the unmodified polars Series derived from acceleration.time.
Description
The goal is the implementation of a angle_relative_to_horizontal (angle-z) function in metrics.py, which as the name suggests will calculate the angle between the horizontal plane, the acceleration vector. The wristpy package will rely on this metric for accurately assessing spatial orientation and movement patterns. Having accurate spatial orientation data will be a critical component of behavioral assessments and sleep-wake cycle evaluation down the line.
The input of the function will be a Measurement object containing the accelereation data and timestamps. The acceleration data will be an ndarray of shape # of samples x 3 cols (x,y,z axis). The timestamps will be a 1D Polars series of datetime.datetime objects. The output will be a new Measurement object in which the value of the measurements will be an ndarray of angle-z values, and the time attribute will be the unaltered from the input.
Tasks
Freeform Notes
No response