test_coordinates module
Tests for coordinate transformations.
- test_coordinates.fixture_expected_elaz()[source]
Set the expected elevation and azimuth from sample positions.
- Returns:
expect_elaz – Array containing 6 el/az pairs for testing elaz function
- Return type:
np.ndarray
- test_coordinates.fixture_local_ecef()[source]
Return ECEF origin for local NED frame of reference
- Returns:
local_ecef – 3x1 array containing ECEF coordinates of NED origin [m , m, m]
- Return type:
np.ndarray
- test_coordinates.fixture_local_lla()[source]
Return LLA origin for local NED frame of reference
- Returns:
local_lla – 3x1 array containing LLA coordinates of NED origin [deg, deg, m]
- Return type:
np.ndarray
- test_coordinates.fixture_local_reference(local_lla)[source]
Return NED local frame of reference
- Parameters:
local_lla (np.ndarray) – LLA coordinates of NED origin 3x1 [deg, deg, m]
- Returns:
local_frame – NED local frame of reference with given LLA as origin
- Return type:
gnss_lib_py.utils.coordinates.LocalCoord
- test_coordinates.fixture_set_rx_pos()[source]
Set the sample reciever position for computing elaz.
- Returns:
rx_pos – Array containing 6 satellite x, y, z coordinates
- Return type:
np.ndarray
- test_coordinates.fixture_set_sv_pos()[source]
Set the sample satellite positions for computing elevation and azimuth.
- Returns:
sv_pos – Array containing 6 satellite x, y, z coordinates
- Return type:
np.ndarray
- test_coordinates.fixture_simple_sat_expected_enu_unit_vectors()[source]
The expected ENU unit vectors for the simple satellite scenario.
- test_coordinates.fixture_simple_sat_scenario()[source]
A simple set of satellites for DOP calculation.
- test_coordinates.test_add_el_az(navdata)[source]
Test for plotting skyplot.
- Parameters:
navdata (AndroidDerived) – Instance of AndroidDerived for testing.
- test_coordinates.test_android_ecef_to_el_az(navdata)[source]
Test for plotting skyplot.
- Parameters:
navdata (AndroidDerived) – Instance of AndroidDerived for testing.
- test_coordinates.test_ecef2geodetic(ecef, exp_lla)[source]
Test ECEF to LLA (in WGS-84 reference ellipsoid) conversion
- Parameters:
ecef (np.ndarray) – ECEF test coordinates, shape: 3x1, units: [m, m, m]
exp_lla (np.ndarray) – Expected LLA values (obtained using MATLAB’s equivalent function)
- test_coordinates.test_ecef_to_el_az(expected_elaz, set_sv_pos, set_rx_pos)[source]
Test receiver to satellite azimuth and elevation calculation.
- Parameters:
expected_elaz (fixture) – Expected elevation and azimuth angles generated by the given satellite and receiver positions.
set_sv_pos (fixture) – Satellite position setter
set_rx_pos (fixture) – Receiver position setter
- test_coordinates.test_ecef_to_el_az_fails(set_sv_pos, set_rx_pos)[source]
Test conditions that should fail.
- Parameters:
set_sv_pos (fixture) – Satellite positions.
set_rx_pos (fixture) – Receiver position.
- test_coordinates.test_el_az_to_enu_unit_vector(navdata, expected_los_vectors)[source]
Test the conversion from elevation and azimuth to ENU unit vectors.
- Parameters:
navdata (NavData) – The input NavData instance.
expected_los_vectors (np.ndarray) – The expected ENU unit vectors.
- test_coordinates.test_geodetic_to_ecef(lla, exp_ecef)[source]
Test LLA (in WGS-84 reference ellipsoid) to ECEF conversion
- Parameters:
lla (np.ndarray) – LLA test coordinates, shape: 3x1, units: [deg, deg, m]
exp_ecef (np.ndarray) – Expected ECEF values (obtained using MATLAB’s equivalent function)
- test_coordinates.test_geodetic_to_ned(local_frame)[source]
Test conversion from NED to geodetic and back for given NED frame
- Parameters:
local_frame (gnss_lib_py.utils.coordinates.LocalCoord) – NED frame of reference initialized at local_lla
- test_coordinates.test_local_frame(local_ecef, local_lla)[source]
Test equivalent initializations for local frame
- Parameters:
local_ecef (np.ndarray) – 3x1 shaped ECEF coordinates of NED frame origin
local_lla (np.ndarray) – 3x1 shaped LLA (WGS-84) coordinates of NED frame origin
- test_coordinates.test_ned_conversions(local_frame, ned, exp_ecef)[source]
Test NED to ECEF position conversions (and ECEF to NED for same values)
- Parameters:
local_frame (gnss_lib_py.utils.coordinates.LocalCoord) – NED local frame of reference initialized for local_lla position
ned (np.ndarray) – Input NED coordinates
exp_ecef (np.ndarray) – Expected ECEF values for reference local frame
- test_coordinates.test_ned_vector_conversions(local_frame, nedv, exp_ecefv)[source]
Test NED to ECEF conversions for vectors (and ECEF to NED for same values)
- Parameters:
local_frame (gnss_lib_py.utils.coordinates.LocalCoord) – NED local frame of reference initialized for local_lla position
nedv (np.ndarray) – Input NED vector values
exp_ecef (np.ndarray) – Expected ECEF vector values for given reference local frame