# Example in astroquery docs for making Horizons ephemerides generates errors

**URL:** <https://community.openastronomy.org/t/example-in-astroquery-docs-for-making-horizons-ephemerides-generates-errors/780>\
**Category:** Astropy\
**Tags:** astropy, question\
**Created:** [October 17, 2023, 1:31am UTC](https://community.openastronomy.org/t/example-in-astroquery-docs-for-making-horizons-ephemerides-generates-errors/780 "2023-10-17T01:31:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffry7](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jeffry7](https://community.openastronomy.org/u/jeffry7)\
**Post date:** [October 17, 2023, 1:31am UTC](https://community.openastronomy.org/t/example-in-astroquery-docs-for-making-horizons-ephemerides-generates-errors/780/1 "2023-10-17T01:31:48Z")

</div>

I was trying to get some data on the Sun and Moon from the day of the eclipse. I was relying on some of the examples here:  
[https://astroquery.readthedocs.io/en/latest/jplhorizons/jplhorizons.html#checking-the-original-jpl-horizons-output](https://astroquery.readthedocs.io/en/latest/jplhorizons/jplhorizons.html#checking-the-original-jpl-horizons-output)

and my script kept generating an error.

So I tried copying the original script from the page, with one additional line, and kept getting an error.

```auto
from astroquery.jplhorizons import Horizons
import astropy.units as u
statue_of_liberty = {'lon': -74.0466891 * u.deg,
                     'lat': 40.6892534 * u.deg,
                     'elevation': 0.093 * u.km}
obj = Horizons(id='Ceres',
               location=statue_of_liberty,
               epochs=2458133.33546)
print(obj.uri)
eph = obj.ephemerides()
print(eph)

```

The error is

```auto
Cannot read coordinate triplet, ? or ?! for help

```

What am I doing wrong?  
Thanks!

P.S.  
astropy 5.1  
astroquery 0.4.6

---

<div class="post-metadata">

**Author:** ![ayshih](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/ayshih/32/84_2.png) [@ayshih](https://community.openastronomy.org/u/ayshih)\
**Post date:** [October 17, 2023, 12:49pm UTC](https://community.openastronomy.org/t/example-in-astroquery-docs-for-making-horizons-ephemerides-generates-errors/780/2 "2023-10-17T12:49:22Z")

</div>

You’re getting tripped up because you are running the stable release of `astroquery` (0.4.6) but looking at the documentation for the development branch, which is what is shown by default online. Since 0.4.6, there’s been a change to make `location` unit-aware (see [Allow astropy Quantity in query locations by mkelley · Pull Request #2746 · astropy/astroquery · GitHub](https://github.com/astropy/astroquery/pull/2746)).

If you look at the documentation for 0.4.6 (as of this writing, [JPL Horizons Queries (astroquery.jplhorizons/astroquery.solarsystem.jpl.horizons) — astroquery v0.4.6](https://astroquery.readthedocs.io/en/stable/jplhorizons/jplhorizons.html)), you can see that all you need to do to fix your script is to remove the units (i.e., `u.deg` and `u.km`).

---

<div class="post-metadata">

**Author:** ![jeffry7](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jeffry7](https://community.openastronomy.org/u/jeffry7)\
**Post date:** [October 18, 2023, 12:25am UTC](https://community.openastronomy.org/t/example-in-astroquery-docs-for-making-horizons-ephemerides-generates-errors/780/3 "2023-10-18T00:25:56Z")

</div>

Bingo.

Thanks Ayshih!
