test_sv_models module

Tests for GNSS SV state calculation methods.

test_sv_models.fixture_all_ephem_paths(root_path)[source]

Location of ephemeris files for unit test

Parameters:

root_path (string) – Location where ephemeris files are stored/to be downloaded.

Returns:

all_ephem_paths – Location of all unit test ephemeris files.

Return type:

string

test_sv_models.fixture_dummy_pos_vel(scaling_value)[source]

Fixture to create NavData for testing position, velocity extraction.

Parameters:

scaling_value (np.ndarray) – Linear range for 6 instances of positions and velocities.

Returns:

NavData example containing position and velocity.

Return type:

dummy_posvel = gnss_lib_py.navdata.navdata.NavData

test_sv_models.fixture_load_clkdata(clk_path)[source]

Load instance of clk data.

Parameters:

clk_path (pytest.fixture) – String with location for the unit_test clk measurements

Returns:

clkdata – Instances of Clk class

Return type:

list

test_sv_models.fixture_load_navdata(navdata_path)[source]

Load instance of AndroidDerived2021

Parameters:

navdata_path (pytest.fixture) – String with location of Android navdata measurement file

Returns:

navdata – Instance of AndroidDerived2021 for testing

Return type:

AndroidDerived2021

test_sv_models.fixture_load_navdata_glonass(navdata)[source]

Load GLONASS instance of AndroidDerived2021

Parameters:

navdata (pytest.fixture) – Instance of AndroidDerived for testing

Returns:

navdata_glonass – Instance of AndroidDerived (GLONASS) for testing

Return type:

AndroidDerived2021

test_sv_models.fixture_load_navdata_glonassg1(navdata)[source]

Load GLONASS instance of AndroidDerived2021

Parameters:

navdata (pytest.fixture) – Instance of AndroidDerived for testing

Returns:

navdata_glonassg1 – Instance of AndroidDerived (GLONASS-G1) for testing

Return type:

AndroidDerived2021

test_sv_models.fixture_load_navdata_gps(navdata)[source]

Load GPS instance of AndroidDerived2021

Parameters:

navdata (pytest.fixture) – Instance of AndroidDerived for testing

Returns:

navdata_gps – Instance of AndroidDerived (GPS) for testing

Return type:

AndroidDerived2021

test_sv_models.fixture_load_navdata_gpsl1(navdata)[source]

Load GPS instance of AndroidDerived2021

Parameters:

navdata (pytest.fixture) – Instance of AndroidDerived for testing

Returns:

navdata_gpsl1 – Instance of AndroidDerived (GPS-L1) for testing ephemeris

Return type:

AndroidDerived2021

test_sv_models.fixture_load_sp3data(sp3_path)[source]

Load instance of sp3 data.

Parameters:

sp3_path (pytest.fixture) – String with location for the unit_test sp3 measurements

Returns:

sp3data – Instance of GPS-only Sp3 class list with len = NUMSATS-GPS

Return type:

list

test_sv_models.fixture_navdata_path(root_path)[source]

Filepath of Android Derived measurements

Parameters:

root_path (string) – Folder location containing measurements

Returns:

navdata_path – Location for the unit_test Android derived measurements

Return type:

string

Notes

Test data is a subset of the Android Raw Measurement Dataset [5], particularly the train/2021-04-28-US-SJC-1/Pixel4 trace. The dataset was retrieved from https://www.kaggle.com/c/google-smartphone-decimeter-challenge/data

References

test_sv_models.fixture_scaling_value()[source]

Scaling value to test extract_pos_vel function.

Returns:

scaling_value – Scaling value for testing position and velocity extration code.

Return type:

np.ndarray

test_sv_models.test_add_sv_state_wrapper(android_measurements, ephemeris_path, error_tol_dec)[source]

Test wrapper that adds SV states to received measurements.

Parameters:
  • android_measurements (gnss_lib_py.navdata.navdata.NavData) – NavData instance containing L1 measurements for received GPS measurements.

  • ephemeris_path (string) – The location where ephemeris files are read from or downloaded to if they don’t exist.

  • error_tol_dec (Dict) – Dictionary containing decimals for error tolerances in computed states. Used for comparing to SV states provided in Android Derived measurements.

test_sv_models.test_add_sv_states_fails(all_ephem_paths, sp3_path)[source]

Test options which should fail.

Parameters:
  • all_ephem_paths (string) – Location of all unit test ephemeris files.

  • sp3_path (string) – String with location for the unit_test sp3 measurements

test_sv_models.test_add_sv_states_precise(sp3_path, clk_path)[source]

Test adding SV states

Parameters:
  • sp3_path (string) – String with location for the unit_test sp3 measurements

  • clk_path (string) – String with location for the unit_test clk measurements

test_sv_models.test_add_visible_svs_for_trajectory(android_gps_l1, ephemeris_path, error_tol_dec)[source]

Test add_visible_svs_for_trajectory wrapper in sv_models

Parameters:
  • android_gps_l1 (gnss_lib_py.navdata.navdata.NavData) – NavData instance containing L1 measurements for received GPS measurements.

  • ephemeris_path (string) – The location where ephemeris files are read from or downloaded to if they don’t exist.

  • error_tol_dec (Dict) – Dictionary containing decimals for error tolerances in computed states. Used for comparing to SV states provided in Android Derived measurements.

test_sv_models.test_compute_concat_precise_eph(navdata, sp3_path, clk_path)[source]

Tests that single_gnss_from_precise_eph does not fail for multi-GNSS

Notes

The threshold for assertion checks are set heuristically; not applicable if input unit test files are changed.

Parameters:
  • navdata (pytest.fixture) – Instance of AndroidDerived for testing

  • sp3_path (string) – String with location for the unit_test sp3 measurements

  • clk_path (string) – String with location for the unit_test clk measurements

test_sv_models.test_compute_glonass_precise_eph(navdata_glonass, sp3data, clkdata)[source]

Tests that sv_models.single_gnss_from_precise_eph does not fail for GPS

Notes

The threshold for assertion checks are set heuristically; not applicable if input unit test files are changed.

Parameters:
  • navdata_glonass (pytest.fixture) – Instance of the NavData class that depicts android derived dataset

  • sp3data (pytest.fixture) – Instance of Sp3 class dictionary

  • clkdata (pytest.fixture) – Instance of Clk class dictionary

test_sv_models.test_compute_gps_precise_eph(navdata_gps, sp3data, clkdata)[source]

Tests that sv_models.single_gnss_from_precise_eph does not fail for GPS

Notes

The threshold for assertion checks are set heuristically; not applicable if input unit test files are changed.

Parameters:
  • navdata_gps (pytest.fixture) – Instance of the NavData class that depicts android derived dataset

  • sp3data (pytest.fixture) – Instance of Sp3 class dictionary

  • clkdata (pytest.fixture) – Instance of Clk class dictionary

test_sv_models.test_del_xyz_range(dummy_pos_vel, scaling_value)[source]

Test calculation of position difference and range calculations.

Parameters:
  • dummy_pos_vel (gnss_lib_py.navdata.navdata.NavData) – NavData example containing position and velocity.

  • scaling_value (np.ndarray) – Linear range for 6 instances of positions and velocities.

test_sv_models.test_filter_ephemeris_none(android_gps_l1, ephemeris_path)[source]

Test the case when _filter_ephemeris_measurements is given None.

Parameters:
  • android_gps_l1 (gnss_lib_py.navdata.navdata.NavData) – NavData instance containing L1 measurements for received GPS measurements.

  • ephemeris_path (string) – The location where ephemeris files are read from or downloaded to if they don’t exist.

test_sv_models.test_posvel_extract(dummy_pos_vel, scaling_value)[source]

Test extraction of position and velocity

Parameters:
  • dummy_pos_vel (gnss_lib_py.navdata.navdata.NavData) – NavData example containing position and velocity.

  • scaling_value (np.ndarray) – Linear range for 6 instances of positions and velocities.

test_sv_models.test_sv_state_model(gps_measurement_frames, android_gt)[source]

Test models used to calculate GPS SV positions and velocities.

Tests models that use broadcast ephemeris parameters to estimate SV states for GPS

Parameters:
  • gps_measurement_frames (Dict) – Dictionary containing NavData instances of ephemeris parameters for received satellites, received Android measurements and SV states, all corresponding to the same received time frame.

  • android_gt (gnss_lib_py.navdata.navdata.NavData) – Ground truth for received measurements.

test_sv_models.test_svs_from_elaz()[source]

Test that the SVs generated from elevation and azimuth are correct.

Uses fixed values of the elevation and azimuth and tests them against satellite vehicle positions known for extreme angles.

test_sv_models.test_visible_ephem(all_gps_ephem, gps_measurement_frames, android_gt)[source]

Verify process for finding visible satellites.

Verifies method for computing visible satellites by checking that actually received satellites are subset of computed visible satellites and that all received satellites are computed as visible.

Parameters:
  • all_gps_ephem (gnss_lib_py.navdata.navdata.NavData) – Ephemeris parameters for all satellites at the time when measurements were received.

  • gps_measurement_frames (Dict) – Dictionary containing NavData instances of ephemeris parameters for received satellites, received Android measurements and SV states, all corresponding to the same received time frame.

  • android_gt (gnss_lib_py.navdata.navdata.NavData) – Ground truth for received measurements.

test_sv_models.test_visible_sv_posvel(gps_measurement_frames, android_gt)[source]

Test that correct SVs are used for positions for visible satellites.

Parameters:
  • gps_measurement_frames (Dict) – Dictionary containing NavData instances of ephemeris parameters for received satellites, received Android measurements and SV states, all corresponding to the same received time frame.

  • android_gt (gnss_lib_py.navdata.navdata.NavData) – Ground truth for received measurements.