1515import copy
1616
1717from gnss_lib_py .navdata .navdata import NavData
18- from gnss_lib_py .utils .metrics import \
19- get_dop , calculate_dop , calculate_enu_unit_vectors , calculate_enut_matrix
18+ from gnss_lib_py .utils .dop import \
19+ get_dop , calculate_dop , calculate_enu_unit_vectors , _calculate_enut_matrix
2020from gnss_lib_py .parsers .google_decimeter import AndroidDerived2022
2121
2222
2323#####################################################################
24- # NEW FIXTURES AND TESTS
24+ # Test under a simplified satellite scenario
2525@pytest .fixture (name = "simple_sat_scenario" )
2626def fixture_simple_sat_scenario ():
2727 """
@@ -110,7 +110,7 @@ def test_simple_enu_unit_vectors(navdata, expected_los_vectors):
110110 np .ones (expected_los_vectors .shape [0 ]))
111111
112112 # Check the we get the expected ENUT matrix
113- enut_matrix = calculate_enut_matrix (navdata )
113+ enut_matrix = _calculate_enut_matrix (navdata )
114114
115115 # First check the shape
116116 assert enut_matrix .shape [0 ] == expected_los_vectors .shape [0 ]
@@ -301,7 +301,7 @@ def test_singularity_dop(navdata):
301301
302302 """
303303 with pytest .raises (np .linalg .LinAlgError ):
304- enut_matrix = calculate_enut_matrix (navdata )
304+ enut_matrix = _calculate_enut_matrix (navdata )
305305 np .linalg .inv (enut_matrix .T @ enut_matrix )
306306
307307 # Now check that we get all NaNs for the DOP values when we have a
@@ -321,74 +321,8 @@ def test_singularity_dop(navdata):
321321#############################################
322322# Real data tests across time
323323
324- # FROM test_coordinates.py
325- @pytest .fixture (name = "root_path_2022" )
326- def fixture_root_path_2022 ():
327- """Location of measurements for unit test
328-
329- Returns
330- -------
331- root_path : string
332- Folder location containing measurements
333- """
334- root_path = os .path .dirname (
335- os .path .dirname (
336- os .path .dirname (
337- os .path .realpath (__file__ ))))
338- root_path = os .path .join (root_path , 'data/unit_test/google_decimeter_2022' )
339- return root_path
340-
341- @pytest .fixture (name = "derived_2022_path" )
342- def fixture_derived_2022_path (root_path_2022 ):
343- """Filepath of Android Derived measurements
344-
345- Returns
346- -------
347- derived_path : string
348- Location for the unit_test Android derived 2022 measurements
349-
350- Notes
351- -----
352- Test data is a subset of the Android Raw Measurement Dataset [4]_,
353- from the 2022 Decimeter Challenge. Particularly, the
354- train/2021-04-29-MTV-2/SamsungGalaxyS20Ultra trace. The dataset
355- was retrieved from
356- https://www.kaggle.com/competitions/smartphone-decimeter-2022/data
357-
358- References
359- ----------
360- .. [4] Fu, Guoyu Michael, Mohammed Khider, and Frank van Diggelen.
361- "Android Raw GNSS Measurement Datasets for Precise Positioning."
362- Proceedings of the 33rd International Technical Meeting of the
363- Satellite Division of The Institute of Navigation (ION GNSS+
364- 2020). 2020.
365- """
366- derived_path = os .path .join (root_path_2022 , 'device_gnss.csv' )
367- return derived_path
368-
369-
370- @pytest .fixture (name = "derived_2022" )
371- def fixture_load_derived_2022 (derived_2022_path ):
372- """Load instance of AndroidDerived2021
373-
374- Parameters
375- ----------
376- derived_path : pytest.fixture
377- String with location of Android derived measurement file
378-
379- Returns
380- -------
381- derived : AndroidDerived2022
382- Instance of AndroidDerived2022 for testing
383- """
384- derived = AndroidDerived2022 (derived_2022_path )
385- return derived
386-
387- #############################################
388- # New tests for real data
389-
390324@pytest .mark .parametrize ('navdata' ,[
391- lazy_fixture ('derived_2022 ' )
325+ lazy_fixture ('android_derived ' )
392326 ])
393327def test_dop_across_time (navdata ):
394328 """
@@ -407,16 +341,16 @@ def test_dop_across_time(navdata):
407341
408342@pytest .mark .parametrize ('navdata, which_dop' ,
409343 [
410- (lazy_fixture ('derived_2022 ' ),
344+ (lazy_fixture ('android_derived ' ),
411345 {'GDOP' : True , 'HDOP' : True , 'VDOP' : True ,
412346 'PDOP' : True , 'TDOP' : True , 'dop_matrix' : False }),
413- (lazy_fixture ('derived_2022 ' ),
347+ (lazy_fixture ('android_derived ' ),
414348 {'GDOP' : True , 'HDOP' : True , 'VDOP' : True ,
415349 'PDOP' : True , 'TDOP' : True , 'dop_matrix' : True }),
416- (lazy_fixture ('derived_2022 ' ),
350+ (lazy_fixture ('android_derived ' ),
417351 {'GDOP' : False , 'HDOP' : False , 'VDOP' : False ,
418352 'PDOP' : False , 'TDOP' : True , 'dop_matrix' : True }),
419- (lazy_fixture ('derived_2022 ' ),
353+ (lazy_fixture ('android_derived ' ),
420354 {'GDOP' : False , 'HDOP' : False , 'VDOP' : False ,
421355 'PDOP' : False , 'TDOP' : False , 'dop_matrix' : True })
422356 ])
0 commit comments