[AstroPy] Some SIMBAD queries erroring?

Jim Singh jimmyboysingh at gmail.com
Mon Oct 18 07:12:27 EDT 2021


Hi all,
Apologies in advance if I am missing something obvious, but sometimes the
below (relatively straightforward) script returns a result set from SIMBAD,
and sometimes errors with 'no element found'. Your assistance would be
greatly appreciated.
The script fetches co-ordinates for given planets and asteroids from JPL
Horizons (which it successfully does for each one I've tried), and then
asks SIMBAD to return objects within 1 degree radius of those co-ordinates.
When it works, SIMBAD returns many records and the datatset make sense, but
sometimes the aforementioned error occurs. This is the script:

from astroquery.jplhorizons import Horizons
from astroquery.simbad import Simbad
import astropy.units as u
from astropy.time import Time
import astropy.coordinates as coord
from astropy.coordinates import Angle

observing_time = Time.strptime('2021-Oct-18 09:30:00', '%Y-%b-%d %H:%M:%S')

#obj = Horizons(id="ceres", location=None, epochs=observing_time.jd) #The
Simbad query for "ceres", "pallas", "vesta" fails, but id=199 returns a
result
obj = Horizons(id='599', id_type='majorbody', location=None,
epochs=observing_time.jd) #The Simbad query for '599' and '699'fails, but
'799' and '899' return a result
#----Fetch RA and Dec of object from JPL Horizons-----
eph = obj.ephemerides()
CentreRA = eph['RA'][0]
CentreDec = eph['DEC'][0]
a=Angle(CentreRA, u.deg)
CentreRAhms = (a.to_string(unit=u.hour))
b=Angle(CentreDec, u.deg)
CentreDecdms = (b.to_string(unit=u.deg))
CoordStr = (CentreRAhms + " " + CentreDecdms)
print(CoordStr)
#----Query SIMBAD--------------
result = Simbad.query_region(coord.SkyCoord(CoordStr, frame='icrs'),
radius='1d0m0s')
print(result)

Thanks for your help!
Regards,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20211018/21390e53/attachment.html>


More information about the AstroPy mailing list