scripts/main/clean_KF.py
def run_kf(data, dim_of_measurements, measured_var, covar, process_model, white_noise_var, dt, sensor_covar,
           measurement_function):
    '''
    This runs the kalman filter on noisy data entered
    :return: Filtered data, covariances and kalman filter used
    '''
    xs, cv = [], []
    dim_z, X, P, A, Q, dt, R, H, B, U = preprocess(num_measured=dim_of_measurements, measured_var=measured_var,
                                                   covar=covar,
                                                   process_model=process_model, white_noise_var=white_noise_var, dt=dt,
                                                   sensor_covar=sensor_covar, measurement_function=measurement_function)
    kf = create_kf_and_assign_predict_update(dim_z, X, P, A, Q, dt, R, H, B, U)

    for i in data:
        kf.predict()
        kf.update(i)

        xs.append(kf.x)
        cv.append(kf.P)

    xs, cv = np.array(xs), np.array(cv)
    return xs, cv, kf

    This runs the kalman filter on noisy data entered
    :return: Filtered data, covariances and kalman filter used
    
This runs the kalman filter on noisy data entered
This runs the kalman filter on noisy data entered
def run_kf(data, dim_of_measurements, measured_var, covar, process_model, white_noise_var, dt, sensor_covar,
           measurement_function):
    xs, cv = [], []
    dim_z, X, P, A, Q, dt, R, H, B, U = preprocess(num_measured=dim_of_measurements, measured_var=measured_var,
                                                   covar=covar,
                                                   process_model=process_model, white_noise_var=white_noise_var, dt=dt,
                                                   sensor_covar=sensor_covar, measurement_function=measurement_function)
    kf = create_kf_and_assign_predict_update(dim_z, X, P, A, Q, dt, R, H, B, U)
    for i in data:
        kf.predict()
        kf.update(i)
        xs.append(kf.x)
        cv.append(kf.P)
    xs, cv = np.array(xs), np.array(cv)
    return xs, cv, kf
def run_kf ( data , dim_of_measurements , measured_var , covar , process_model , white_noise_var , dt , sensor_covar , measurement_function ) : xs , cv = [ ] , [ ] dim_z , X , P , A , Q , dt , R , H , B , U = preprocess ( num_measured = dim_of_measurements , measured_var = measured_var , covar = covar , process_model = process_model , white_noise_var = white_noise_var , dt = dt , sensor_covar = sensor_covar , measurement_function = measurement_function ) kf = create_kf_and_assign_predict_update ( dim_z , X , P , A , Q , dt , R , H , B , U ) for i in data : kf . predict ( ) kf . update ( i ) xs . append ( kf . x ) cv . append ( kf . P ) xs , cv = np . array ( xs ) , np . array ( cv ) return xs , cv , kf
This runs the kalman filter on noisy data entered
This runs the kalman filter on noisy data entered
'''
    This runs the kalman filter on noisy data entered
    :return: Filtered data, covariances and kalman filter used
    '''
Filtered data, covariances and kalman filter used
Filtered data covariances and kalman filter used
data
dim_of_measurements
measured_var
covar
process_model
white_noise_var
dt
sensor_covar
measurement_function