@@ -388,33 +388,31 @@ def test_singularity_dop(navdata):
388388 Parameters
389389 ----------
390390 navdata : NavData
391- A NavData with only one time entry of a *singular* satellite scenario.
391+ A NavData with only one time entry of a ** singular* * satellite scenario.
392392
393393 """
394394
395395 # Run the DOP calculation
396396 dop_dict = calculate_dop (navdata )
397397
398- print ("DOP dict" )
399- print (dop_dict )
400-
401398 # Check the DOP output has all the expected keys
402399 assert dop_dict .keys () == {'dop_matrix' ,
403400 'GDOP' , 'HDOP' , 'VDOP' , 'PDOP' , 'TDOP' }
404401
405402 try :
406403 enut_matrix = _calculate_enut_matrix (navdata )
407- print ("ENUT matrix" )
408- print (enut_matrix )
409-
410- dop_manual = np .linalg .inv (enut_matrix .T @ enut_matrix )
411- print ("DOP manual" )
412- print (dop_manual )
404+ np .linalg .inv (enut_matrix .T @ enut_matrix )
413405
414406 # If we get here, then we did not get a singularity error
415407 # This is possible due to floating point errors, so we will check
416408 # that the values are unrealistically large.
409+ #
410+ # Note: When very poorly conditioned, the DOP matrix can have negative
411+ # entries. Then, the square root of the DOP matrix will be nan! So,
412+ # we first check for nans, and then for large values (otherwise there
413+ # is an issue in comparing nan > number).
417414 # Note: we use np.any() since we can get small values in the DOP matrix
415+ # even if singular (i.e., in the off-diagonal entries).
418416 for _ , val in dop_dict .items ():
419417 assert np .any (np .isnan (val )) or np .any (np .abs (val ) > 1e6 )
420418
0 commit comments