Skip to content

Commit f6868ca

Browse files
committed
Add a test for topocentric coordinate queries.
1 parent 88dd76d commit f6868ca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

astroquery/jplhorizons/tests/test_jplhorizons_remote.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,22 @@ def test_vectors_query_raw(self):
361361

362362
assert len(res) >= 6412
363363

364+
def test_vectors_query_topocentric_coordinates(self):
365+
"Test vectors query specifying observer's longitude, latitude, and elevation"
366+
q = jplhorizons.Horizons(id='Ceres',
367+
location={"lon": 244, "lat": 33, "elevation": 1700},
368+
id_type='smallbody',
369+
epochs=2451544.5)
370+
res = q.vectors_async()
371+
i = res.text.find("Center geodetic :")
372+
j = res.text.find("\n", i)
373+
parts = res.text[i:j].split()
374+
assert parts[3:6] == ['244.0,', '33.0,', '1700.0']
375+
376+
start = res.text.find("$$SOE")
377+
end = res.text.find("$$EOE")
378+
assert res.text[start:end].find("2000-Jan-01") > 0
379+
364380
def test_unknownobject(self):
365381
with pytest.raises(ValueError):
366382
jplhorizons.Horizons(id='spamspamspameggsspam', location='500',

0 commit comments

Comments
 (0)