Fwd: SIMBAD queries in python

338 views
Skip to first unread message

Tom Aldcroft

unread,
Feb 13, 2013, 8:09:20 PM2/13/13
to astro...@googlegroups.com
Will astroquery query SIMBAD right now? I see there is some promising
looking code there, but I can't tell if it's working.

Thanks,
Tom


---------- Forwarded message ----------
From: Tom Rice <t.ri...@gmail.com>
Date: Wed, Feb 13, 2013 at 7:46 PM
Subject: SIMBAD queries in python
To: pytho...@head.cfa.harvard.edu


Hi all,

Does anyone know of a way (via a python module or other command-line
tool) to query the SIMBAD database for object identifiers
corresponding to about 1000 sources I have in a table?

I imagine this taking the form of a function with RA and DEC (and
perhaps a box size) as inputs, and getting the SIMBAD information (or
"null" for a failure to match) as an output, and then me iterating
through my 1000 sources, feeding each RA and DEC to the function so I
can create a corresponding list of SIMBAD identifiers.

Thanks very much for any expertise,
Tom

Adam Ginsburg

unread,
Feb 14, 2013, 1:29:34 AM2/14/13
to astro...@googlegroups.com, aldc...@head.cfa.harvard.edu
Yes, astroquery can do this:

An example of multiple queries:

In [1]: import astroquery.simbad

In [2]: tables = [astroquery.simbad.QueryId(x).execute().table for x in ['m31','m51','omc1']]

(tables is now a list of astropy tables)

Unfortunately, this is pretty ugly for multiple queries - you have to merge the tables yourself.  I'll put this in as a 'feature request' on astroquery;  there seems to be a framework build for multi-object queries but it isn't ready to go.

Adam Ginsburg

unread,
Feb 14, 2013, 1:36:14 AM2/14/13
to astro...@googlegroups.com, aldc...@head.cfa.harvard.edu
I take it back, multi-queries ARE supported, though this example is pretty awkward.  I'll add a nicer example to the docs tomorrow:

In [1]: import astroquery.simbad

In [2]: result = astroquery.simbad.QueryMulti([astroquery.simbad.QueryId('m31'),astroquery.simbad.QueryId('m51')])

In [3]: result.execute().table

Thomas Boch

unread,
Feb 14, 2013, 1:41:46 AM2/14/13
to astro...@googlegroups.com, Adam Ginsburg, aldc...@head.cfa.harvard.edu
For large lists of RA,DEC positions, you might consider using the cross-match API provided by CDS.
There is no Python module for this (yet), but it should be straightforward to use.
Documentation is available at http://cdsxmatch.u-strasbg.fr/xmatch/doc/cross-match-API.html and examples at http://cdsxmatch.u-strasbg.fr/xmatch/doc/xmatch-API-usage-examples.html

Cheers,
Thomas
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages