UL Intensity of Use Documentation#
ulint.py is a module containing different classes, and functions for quantifying the UL intensity construct.
The current version of the module contains the following instantaneous UL intensity algorithms:
Vector magnitude from the ActiGraph sensor.
- monalysa.ulfunc.ulint.average_intuse(intsig: array, usesig: array, windur: float, winshift: float, fs: float) tuple[numpy.array, numpy.array]#
Computes the average upper-limb intensity of use from the given intensity and UL use signals. The current version only supports causal averaging.
- Parameters:
intsig (np.array) – 1D numpy array of the UL intensity signal whose average is to be computed.
usesig (np.array) – 1D numpy array of the UL use (binary) signal.
windur (float) – Duration in seconds over which the UL intensity signal is to be averaged.
winshift (float) – Time gap between two consecutive window locations.
fs (float) – Sampling frequency of the intsig and usesig signal.
- Returns:
A tuple of 1D numpy arrays. The first 1D array is the list of time indices of the computed average UL intensity of use signal. The second 1D array is the average UL intensity of use signal.
- Return type:
tuple[np.array, np.array]
- monalysa.ulfunc.ulint.average_ulactivity(intsig: array, windur: float, winshift: float, fs: float) array#
Computes the average upper-limb activity of use from the given intensity and UL use signals. The current version only supports causal averaging.
- Parameters:
intsig (np.array) – 1D numpy array of the instantaneous UL intensity signal whose average is to be computed.
windur (float) – Duration in seconds over which the UL use signal is to be averaged.
winshift (float) – Time shift between two consecutive averaging windows.
fs (float) – Sampling frequency of the intsig signal.
- Returns:
1D numpy array of the average upper-limb activity.
- Return type:
np.array
- monalysa.ulfunc.ulint.from_vec_mag(vecmag: array, usesig: array, nsample: int) tuple[numpy.array, numpy.array]#
Computes UL intensity from the vector magnitude values from the Actigraph sensor.
- Parameters:
vecmag (np.array) – 1D numpy array containing the activity counts time series.
usesig (np.array) – 1D numpy array of the UL use binary signal.
nsample (int) – The downsampling number for computing the instantaneous UL intensity of use. This number must be equal to the ratio of the sampling rate of the raw data (vecmag) and the uluse data. This means len(vecmag[::nsample]) == len(usesig).
- Returns:
A tuple of 1D numpy arrays. The first 1D array is the list of time indices of the computed UL intensity signal. The second 1D array is the UL intensity signal.
- Return type:
tuple[np.array, np.array]