astropy / astroquery

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8
http://astroquery.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
700 stars 396 forks source link

Nasa Exoplanet Archive query_aliases fails for multiple star systems #2357

Closed AWehrhahn closed 2 years ago

AWehrhahn commented 2 years ago

When trying to request data from the NASA Exoplanet Archive, the alias resolution fails for multiple star systems like LTT1445 or Alpha Centauri, even if specifying the specific star in the system.

Example:

from astroquery.ipac.nexsci.nasa_exoplanet_archive import NasaExoplanetArchive

alias_ltt = NasaExoplanetArchive.query_aliases("LTT1445A")
alias_alf = NasaExoplanetArchive.query_aliases("Alf Cen A")

Output:

WARNING: NoResultsWarning: No aliases found for name: 'LTT1445A' [astroquery.ipac.nexsci.nasa_exoplanet_archive.core]
WARNING: NoResultsWarning: No aliases found for name: 'Alf Cen A' [astroquery.ipac.nexsci.nasa_exoplanet_archive.core]

I think the problem lies in line 404 of core.py:

other_objnames = list(set(data['system']['objects']['stellar_set']['stars'][default_objname[0]]['alias_set']['aliases']) - set(default_objname))

Since default_objname[0] does not include the letter of the star, but it is expected in the dictionary.

bsipocz commented 2 years ago

cc @rickynilsson