astropy / astropy/astroquery

Simbad multi-object search behaviour

Open
#967 8 comments 0 reactions 1 assignee Claimed by @ManonMarchand View on GitHub
simbad
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

Currently if you query Simbad.query_objects (or Simbad.query_region) with many objects you get a table returned of a different size making comparison between input and output very difficult. This is because Simbad can return multiple rows for a single object (Centaurus for example) or no rows at all for an unrecognised object. The returned object id's aren't necessarily the input id's either so you can't use them to search the returned table. You can do it one at a time but for a few thousand objects it's quite slow.

Would it be possible to change this behaviour and the same for multiple coordinate searches? I'm not sure of the best way to handle this, to return the original search names/coordinates and/or the same number of rows with the same order could work. Even just a row label that identifies results as being in the same search group would be fine. A search by multiple coordinates (or a multiple region criteria) would benefit extremely from the second or third behaviour. As at the moment it is very difficult to distinguish which object belongs to each region search. The same behaviour for Ned would be even better :)

For Example:

rac=['144.696458 -60.09181', '203.426453 -65.99033']
Simbad.query_region(SkyCoord(rac, unit=u.deg),'1d')

Would return:

MAIN_ID | RA | DEC | OTYPE | GROUP
-- | -- | -- | -- | --
  | h m s | d m s |   |  
object | unicode13 | unicode13 | object | int
--------------- | ------------- | ------------- | ------ | ------
IC 2501 | 9 38 47.146 | -60 5 30.52 | PN | 1
TYC 9003-1531-1 | 13 33 42.8988 | -65 59 11.376 | Star | 2
NGC 5189 | 13 33 32.86 | -65 58 27.1 | PN | 2
TYC 9003-1874-1 | 13 33 27.265 | -65 58 27.9 | Star | 2
TYC 9003-654-1 | 13 33 25.988 | -66 0 14.359 | Star | 2

Multi object example:

from astroquery.eso import Eso
from astroquery.simbad import Simbad

#login info
eso = Eso()
login=raw_input('ESO Login: ')
eso.login(login)

#Set simbad
Sim=Simbad()
Sim.add_votable_fields('otype')
Sim.ROW_LIMIT=1e6
Sim.TIMEOUT=500

#Query
eso.ROW_LIMIT=1e12
table=eso.query_instrument('muse', night_flag=0, column_filters={'dp_type':'OBJECT'})
#Remove duplicate names
oname=list(set(table['Object']))
onar=Sim.query_objects(oname)
print len(onar['MAIN_ID']),len(oname)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.