test_snapshot module

Tests for weighted least squres in snapshot

test_snapshot.fixture_set_sv_states()[source]

Get position of 4 satellite in ECEF coordinates.

See reference [1] for details.

Returns:

pos_sv_m – Satellite positions in ECEF frame as an array of shape [# svs x 3] where the columns contain in order x_sv_m, y_sv_m, and z_sv_m.

Return type:

np.ndarray

References

test_snapshot.fixture_set_user_states()[source]

Set the location and clock bias of the user receiver in Earth-Centered, Earth-Fixed coordinates.

Returns:

rx_truth_m – Truth receiver position in ECEF frame in meters and the truth receiver clock bias also in meters in an array with shape (4 x 1) and the following order: x_rx_m, y_rx_m, z_rx_m, b_rx_m.

Return type:

np.ndarray

test_snapshot.fixture_tolerance()[source]

Decimal threshold for test pass/fail criterion.

test_snapshot.test_rotation_of_earth_fix(derived_2022)[source]

Tests that accounting for Earth’s rotation reduces WLS errors.

Parameters:

derived_2022 (AndroidDerived2022) – Instance of AndroidDerived2022 for testing

test_snapshot.test_solve_wls(derived_2021)[source]

Test that solving for wls doesn’t fail

Parameters:

derived_2021 (AndroidDerived2021) – Instance of AndroidDerived2021 for testing.

test_snapshot.test_solve_wls_bias_only(derived_2022)[source]

Tests that bias only WLS estimation works as expected.

Parameters:

derived_2022 (AndroidDerived2022) – Instance of AndroidDerived2022 for testing

test_snapshot.test_solve_wls_empty()[source]

Test scenario where an empty measurement class is passed in.

test_snapshot.test_solve_wls_fails(derived_2021)[source]

Test expected fails

Parameters:

derived_2021 (AndroidDerived2021) – Instance of AndroidDerived2021 for testing

test_snapshot.test_solve_wls_weights(derived_2021, tolerance)[source]

Tests that weights are working for weighted least squares.

Parameters:
  • derived_2021 (AndroidDerived2021) – Instance of AndroidDerived2021 for testing

  • tolerance (fixture) – Error threshold for test pass/fail

test_snapshot.test_wls(set_user_states, set_sv_states, tolerance)[source]

Test snapshot positioning against truth user states.

Parameters:
  • set_user_states (fixture) – Truth values for user position and clock bias

  • set_sv_states (fixture) – Satellite position and clock biases

  • tolerance (fixture) – Error threshold for test pass/fail

test_snapshot.test_wls_fails(capsys)[source]

Test expected fails

Parameters:

capsys (error) – The capsys fixture allows access to stdout/stderr output created during test execution.

test_snapshot.test_wls_max_count(set_user_states, set_sv_states, count_test, random_noise)[source]

Test snapshot positioning against truth user states.

Parameters:
  • set_user_states (fixture) – Truth values for user position and clock bias

  • set_sv_states (fixture) – Satellite position and clock biases

  • count_test (int) – Max count for wls solver

  • random_noise (np.ndarray) – Noise added to ground truth pseudoranges of shape 4x1

test_snapshot.test_wls_only_bias(set_user_states, set_sv_states, tolerance)[source]

Test WLS positioning against truth user states.

In these only_bias tests, it is only solving for clock bias.

Parameters:
  • set_user_states (fixture) – Truth values for user position and clock bias

  • set_sv_states (fixture) – Satellite position and clock biases

  • tolerance (fixture) – Error threshold for test pass/fail

test_snapshot.test_wls_tolerance(set_user_states, set_sv_states, tolerance_test, random_noise)[source]

Test snapshot positioning against truth user states.

Parameters:
  • set_user_states (fixture) – Truth values for user position and clock bias

  • set_sv_states (fixture) – Satellite position and clock biases

  • tolerance_test (float) – Tolerance with which to end the wls solver

  • random_noise (np.ndarray) – Noise added to ground truth pseudoranges of shape 4x1

test_snapshot.test_wls_weights(set_user_states, set_sv_states, tolerance, random_noise)[source]

Test snapshot positioning against truth user states.

Parameters:
  • set_user_states (fixture) – Truth values for user position and clock bias

  • set_sv_states (fixture) – Satellite position and clock biases

  • tolerance (fixture) – Error threshold for test pass/fail

  • random_noise (np.ndarray) – Noise added to ground truth pseudoranges of shape 4x1