<commit_before>import numpy as np
import scipy as sp

def linearcalib(V,calibdata):
    '''Linear tranformation from raw voltage measurements (V) to calibrated
    data signals (s).

    Parameters
    ----------
    V : array
        Measurements

    calibdata : Dictionary
        Calibration data

    Output
    ----------
    s : array
        Calibrated signal

    '''

    p1 = calibdata['Slope']
    p0 = calibdata['Offset']
    s = p1*V + p0
    return s

def bodyfixedgyro(omega_x,omega_y,omega_z,bikeparms):
    '''Transforms the measured body fixed rates to global rates by
    rotating them along the head angle.

    Parameters
    ----------
    omega_x, omega_y, omega_z : array
        Body fixed angular velocities

    bikeparms : Dictionary
        Bike parameters

    Output
    ----------
    s : array
        Calibrated signal

    '''
    lam = bikeparms['lambda']
    omega_xg =  omega_x*cos(lam) +omega_z*sin(lam)
    omega_yg =  omega_y
    omega_zg = -omega_x*sin(lam) +omega_z*sin(lam)
    return omega_xg

def steerrate(steergyro,omega_xg, omega_zg, bikeparms):
    lam = bikeparms['lambda']
    deltad = steergyro + omega_xg*np.sin(lam) - omega_zg*cos(lam)
    return deltad

<commit_msg>Edited calibfunctions<commit_after>import numpy as np
import scipy as sp

def linearcalib(V,calibdata):
    '''Linear tranformation from raw voltage measurements (V) to calibrated
    data signals (s).

    Parameters
    ----------
    V : array
        Measurements

    calibdata : Dictionary
        Calibration data

    Output
    ----------
    s : array
        Calibrated signal

    '''

    p1 = calibdata['Slope']
    p0 = calibdata['Offset']
    s = p1*V + p0
    return s

def rollpitchyawrate(framerate_x,framerate_y,framerate_z,bikeparms):
    '''Transforms the measured body fixed rates to global rates by
    rotating them along the head angle.

    Parameters
    ----------
    omega_x, omega_y, omega_z : array
        Body fixed angular velocities

    bikeparms : Dictionary
        Bike parameters

    Output
    ----------
    yawrate, pitchrate, rollrate : array
        Calibrated signal

    '''
    lam = bikeparms['lambda']
    rollrate  =  omega_x*cos(lam) + omega_z*sin(lam)
    pitchrate =  omega_y
    yawrate   = -omega_x*sin(lam) + omega_z*cos(lam)
    return yawrate, pitchrate, rollrate

def steerrate(steergyro,framerate_z):
    lam = bikeparms['lambda']
    deltad = steergyro + framerate_z
    return deltad



{'fraction_non_alphanumeric': 0.10747474747474747, 'fraction_numerical': 0.0032323232323232323, 'mean_word_length': 2.3732970027247955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7202115', 'n_tokens_mistral': 852, 'n_tokens_neox': 787, 'n_words': 210}