km3modules.ahrs

AHRS calibration.

Module Contents

Classes

AHRSCalibrator

Calculates AHRS yaw, pitch and roll from median A and H of an interval.

Functions

fit_ahrs(A, H, Aoff, Arot, Hoff, Hrot)

Calculate yaw, pitch and roll for given A/H and calibration set.

get_latest_ahrs_calibration(clb_upi[, max_version])

Retrieve the latest AHRS calibration data for a given CLB

Attributes

log

km3modules.ahrs.log[source]
class km3modules.ahrs.AHRSCalibrator(name=None, **parameters)[source]

Calculates AHRS yaw, pitch and roll from median A and H of an interval.

Parameters:
det_id: int

The detector ID, e.g. 29)

Other Parameters:
interval: int (accumulation interval in [sec], default: 10s)

Notes

Writes ‘AHRSCalibration’ in the blob with:

dict: key=dom_id, value=tuple: (timestamp, du, floor, yaw, pitch, roll)

configure()[source]

Configure module, like instance variables etc.

process(blob)[source]

Knead the blob and return it

calibrate()[source]

Calculate yaw, pitch and roll from the median of A and H.

After successful calibration, the self.A and self.H are reset. DOMs with missing AHRS pre-calibration data are skipped.

Returns:
dict: key=dom_id, value=tuple: (timestamp, du, floor, yaw, pitch, roll)
km3modules.ahrs.fit_ahrs(A, H, Aoff, Arot, Hoff, Hrot)[source]

Calculate yaw, pitch and roll for given A/H and calibration set.

Author: Vladimir Kulikovskiy

Parameters:
A: list, tuple or numpy.array of shape (3,)
H: list, tuple or numpy.array of shape (3,)
Aoff: numpy.array of shape(3,)
Arot: numpy.array of shape(3, 3)
Hoff: numpy.array of shape(3,)
Hrot: numpy.array of shape(3, 3)
Returns:
yaw, pitch, roll
km3modules.ahrs.get_latest_ahrs_calibration(clb_upi, max_version=3)[source]

Retrieve the latest AHRS calibration data for a given CLB

Parameters:
clb_upi: str
max_version: int, maximum version to check, optional
Returns:
Aoff: numpy.array with shape(3,)
Arot: numpy.array with shape(3,3)
Hoff: numpy.array with shape(3,)
Hrot: numpy.array with shape(3,3)
or None if no calibration found.