@@ -39,7 +39,7 @@ def test_anglesep_meeus():
3939 assert pmh .anglesep_meeus (35 , 23 , 84 , 20 ) == approx (ha )
4040
4141
42- def test_eci ():
42+ def test_eci_astropy ():
4343 pytest .importorskip ('astropy' )
4444
4545 t = '2013-01-15T12:00:05'
@@ -60,7 +60,7 @@ def test_eci():
6060 pm .aer2eci (aer1 [0 ], aer1 [1 ], - 1 , 42 , - 100 , 0 , t )
6161
6262
63- def test_eci_times ():
63+ def test_eci_times_astropy ():
6464 pytest .importorskip ('astropy' )
6565
6666 with pytest .raises (AssertionError ):
@@ -73,5 +73,36 @@ def test_eci_times():
7373 assert pm .ecef2eci (pm .eci2ecef (eci0s , [t0 ] * 2 ), [t0 ] * 2 ) == approx (eci0s )
7474
7575
76+ def test_eci_vallado ():
77+ t = '2013-01-15T12:00:05'
78+ lla = pm .eci2geodetic (eci0 , t , useastropy = False )
79+ assert lla == approx (lla0 , rel = 0.2 )
80+
81+ eci1 = pm .eci2ecef (eci0 , t , useastropy = False )
82+ assert eci1 == approx ([649012.04640917 , - 4697980.55129606 , 4250818.82815207 ], rel = 0.001 )
83+
84+ assert pm .ecef2eci (eci1 , t , useastropy = False ) == approx (eci0 , rel = 0.001 )
85+
86+ aer1 = pm .eci2aer (eci0 , 42 , - 100 , 0 , t , useastropy = False )
87+ assert aer1 == approx ([83.73050 , - 6.614478 , 1.473510e6 ], rel = 0.001 )
88+
89+ assert pm .aer2eci (* aer1 , 42 , - 100 , 0 , t , useastropy = False ) == approx (eci0 , rel = 0.001 )
90+
91+ with pytest .raises (ValueError ):
92+ pm .aer2eci (aer1 [0 ], aer1 [1 ], - 1 , 42 , - 100 , 0 , t , useastropy = False )
93+
94+
95+ def test_eci_times_vallado ():
96+ with pytest .raises (AssertionError ):
97+ pm .eci2ecef (eci0 , [t0 , t0 ], useastropy = False )
98+
99+ with pytest .raises (AssertionError ):
100+ pm .ecef2eci (eci0 , [t0 , t0 ], useastropy = False )
101+
102+ eci0s = np .stack ((eci0 , eci0 ))
103+ assert pm .ecef2eci (pm .eci2ecef (eci0s , [t0 ] * 2 , useastropy = False ),
104+ [t0 ] * 2 , useastropy = False ) == approx (eci0s , rel = 0.001 )
105+
106+
76107if __name__ == '__main__' :
77108 pytest .main (['-xrsv' , __file__ ])
0 commit comments