SimbadClass

class astroquery.simbad.SimbadClass[source]

Bases: astroquery.query.BaseQuery

The class for querying the Simbad web service.

Note that SIMBAD suggests submitting no more than 6 queries per second; if you submit more than that, your IP may be temporarily blacklisted (http://simbad.u-strasbg.fr/simbad/sim-help?Page=sim-url)

Attributes Summary

ROW_LIMIT

SIMBAD_URL

TIMEOUT

WILDCARDS

Methods Summary

add_votable_fields(*args)

Sets fields to be fetched in the VOTable.

get_field_description(field_name)

Displays a description of the VOTable field.

get_votable_fields()

Display votable fields

list_votable_fields()

Lists all the fields that can be fetched for a VOTable.

list_wildcards()

Displays the available wildcards that may be used in Simbad queries and their usage.

query_bibcode(bibcode[, wildcard, verbose, …])

Queries the references corresponding to a given bibcode, and returns the results in a Table.

query_bibcode_async(bibcode[, wildcard, …])

Serves the same function as query_bibcode, but only collects the response from the Simbad server and returns.

query_bibobj(bibcode[, verbose, …])

Query all the objects that are contained in the article specified by the bibcode, and return results as a Table.

query_bibobj_async(bibcode[, cache, …])

Serves the same function as query_bibobj, but only collects the response from the Simbad server and returns.

query_catalog(catalog[, verbose, cache, …])

Queries a whole catalog.

query_catalog_async(catalog[, cache, …])

Serves the same function as query_catalog, but only collects the response from the Simbad server and returns.

query_criteria(*args, **kwargs)

Query SIMBAD based on any criteria.

query_criteria_async(*args, **kwargs)

Query SIMBAD based on any criteria.

query_object(object_name[, wildcard, …])

Queries Simbad for the given object and returns the result as a Table.

query_object_async(object_name[, wildcard, …])

Serves the same function as query_object, but only collects the response from the Simbad server and returns.

query_objectids(object_name[, verbose, …])

Query Simbad with an object name, and return a table of all names associated with that object in a Table.

query_objectids_async(object_name[, cache, …])

Serves the same function as query_objectids, but only collects the response from the Simbad server and returns.

query_objects(object_names[, wildcard, …])

Queries Simbad for the specified list of objects and returns the results as a Table.

query_objects_async(object_names[, …])

Same as query_objects, but only collects the response from the Simbad server and returns.

query_region(*args, **kwargs)

Queries the service and returns a table object.

query_region_async(coordinates[, radius, …])

Serves the same function as query_region, but only collects the response from the Simbad server and returns.

remove_votable_fields(*args, **kwargs)

Removes the specified field names from SimbadClass._VOTABLE_FIELDS

reset_votable_fields()

resets VOTABLE_FIELDS to defaults

Attributes Documentation

ROW_LIMIT = 0
SIMBAD_URL = 'http://simbad.u-strasbg.fr/simbad/sim-script'
TIMEOUT = 60
WILDCARDS = {'*': 'Any string of characters (including an empty one)', '?': 'Any character (exactly one character)', '[^0-9]': 'Any (one) character not in the list.', '[abc]': 'Exactly one character taken in the list. Can also be defined by a range of characters: [A-Z]'}

Methods Documentation

add_votable_fields(*args)[source]

Sets fields to be fetched in the VOTable. Must be one of those listed by list_votable_fields.

Parameters
list of field_names
get_field_description(field_name)[source]

Displays a description of the VOTable field.

Parameters
field_namestr

the name of the field to describe. Must be one of those listed by list_votable_fields.

Examples

>>> from astroquery.simbad import Simbad
>>> Simbad.get_field_description('main_id')
main identifier of an astronomical object. It is the same as id(1)
>>> Simbad.get_field_description('bibcodelist(y1-y2)')
number of references. The parameter is optional and limit the count to
the references between the years y1 and y2
get_votable_fields()[source]

Display votable fields

Examples

>>> from astroquery.simbad import Simbad
>>> Simbad.get_votable_fields()
['main_id', 'coordinates']
list_votable_fields()[source]

Lists all the fields that can be fetched for a VOTable.

Examples

>>> from astroquery.simbad import Simbad
>>> Simbad.list_votable_fields()
--NOTES--...
list_wildcards()[source]

Displays the available wildcards that may be used in Simbad queries and their usage.

Examples

>>> from astroquery.simbad import Simbad
>>> Simbad.list_wildcards()
* : Any string of characters (including an empty one)...

[^0-9] : Any (one) character not in the list.

? : Any character (exactly one character)

[abc]Exactly one character taken in the list.

Can also be defined by a range of characters: [A-Z]

query_bibcode(bibcode, wildcard=False, verbose=False, cache=True, get_query_payload=False)[source]

Queries the references corresponding to a given bibcode, and returns the results in a Table. Wildcards may be used to specify bibcodes.

Parameters
bibcodestr

the bibcode of the article

wildcardboolean, optional

When it is set to True it implies that the object is specified with wildcards. Defaults to False.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableTable

Query results table

query_bibcode_async(bibcode, wildcard=False, cache=True, get_query_payload=False)[source]

Serves the same function as query_bibcode, but only collects the response from the Simbad server and returns.

Parameters
bibcodestr

the bibcode of the article

wildcardboolean, optional

When it is set to True it implies that the object is specified with wildcards. Defaults to False.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
responserequests.Response

Response of the query from the server.

query_bibobj(bibcode, verbose=False, get_query_payload=False)[source]

Query all the objects that are contained in the article specified by the bibcode, and return results as a Table.

Parameters
bibcodestr

the bibcode of the article

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableTable

Query results table

query_bibobj_async(bibcode, cache=True, get_query_payload=False)[source]

Serves the same function as query_bibobj, but only collects the response from the Simbad server and returns.

Parameters
bibcodestr

the bibcode of the article

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
responserequests.Response

Response of the query from the server.

query_catalog(catalog, verbose=False, cache=True, get_query_payload=False)[source]

Queries a whole catalog.

Results may be very large -number of rows should be controlled by configuring SimbadClass.ROW_LIMIT.

Parameters
catalogstr

the name of the catalog.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableTable

Query results table

query_catalog_async(catalog, cache=True, get_query_payload=False)[source]

Serves the same function as query_catalog, but only collects the response from the Simbad server and returns.

Parameters
catalogstr

the name of the catalog.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
responserequests.Response

Response of the query from the server.

query_criteria(*args, **kwargs)[source]

Query SIMBAD based on any criteria.

Parameters
args:

String arguments passed directly to SIMBAD’s script (e.g., ‘region(box, GAL, 10.5 -10.5, 0.5d 0.5d)’)

kwargs:

Keyword / value pairs passed to SIMBAD’s script engine (e.g., {‘otype’:’SNR’} will be rendered as otype=SNR)

Returns
tableTable

Query results table

query_criteria_async(*args, **kwargs)[source]

Query SIMBAD based on any criteria.

Parameters
args:

String arguments passed directly to SIMBAD’s script (e.g., ‘region(box, GAL, 10.5 -10.5, 0.5d 0.5d)’)

kwargs:

Keyword / value pairs passed to SIMBAD’s script engine (e.g., {‘otype’:’SNR’} will be rendered as otype=SNR)

cachebool

Cache the query?

Returns
responserequests.Response

Response of the query from the server

query_object(object_name, wildcard=False, verbose=False, get_query_payload=False)[source]

Queries Simbad for the given object and returns the result as a Table. Object names may also be specified with wildcard. See examples below.

Parameters
object_namestr

name of object to be queried

wildcardboolean, optional

When it is set to True it implies that the object is specified with wildcards. Defaults to False.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableTable

Query results table

query_object_async(object_name, wildcard=False, cache=True, get_query_payload=False)[source]

Serves the same function as query_object, but only collects the response from the Simbad server and returns.

Parameters
object_namestr

name of object to be queried

wildcardboolean, optional

When it is set to True it implies that the object is specified with wildcards. Defaults to False.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
responserequests.Response

Response of the query from the server

query_objectids(object_name, verbose=False, cache=True, get_query_payload=False)[source]

Query Simbad with an object name, and return a table of all names associated with that object in a Table.

Parameters
object_namestr

name of object to be queried

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableTable

Query results table

query_objectids_async(object_name, cache=True, get_query_payload=False)[source]

Serves the same function as query_objectids, but only collects the response from the Simbad server and returns.

Parameters
object_namestr

name of object to be queried

Returns
responserequests.Response

Response of the query from the server.

query_objects(object_names, wildcard=False, verbose=False, get_query_payload=False)[source]

Queries Simbad for the specified list of objects and returns the results as a Table. Object names may be specified with wildcards if desired.

Parameters
object_namessequence of strs

names of objects to be queried

wildcardboolean, optional

When True, the names may have wildcards in them. Defaults to False.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableTable

Query results table

query_objects_async(object_names, wildcard=False, cache=True, get_query_payload=False)[source]

Same as query_objects, but only collects the response from the Simbad server and returns.

Parameters
object_namessequence of strs

names of objects to be queried

wildcardboolean, optional

When True, the names may have wildcards in them. Defaults to False.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
responserequests.Response

Response of the query from the server

query_region(*args, **kwargs)

Queries the service and returns a table object.

Serves the same function as query_region, but only collects the response from the Simbad server and returns.

Parameters
coordinatesstr or astropy.coordinates object

the identifier or coordinates around which to query.

radiusstr or Quantity, optional

the radius of the region. If missing, set to default value of 2 arcmin.

equinoxfloat, optional

the equinox of the coordinates. If missing set to default 2000.0.

epochstr, optional

the epoch of the input coordinates. Must be specified as [J|B] <epoch>. If missing, set to default J2000.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
tableA Table object.
query_region_async(coordinates, radius=<Quantity 2. arcmin>, equinox=2000.0, epoch='J2000', cache=True, get_query_payload=False)[source]

Serves the same function as query_region, but only collects the response from the Simbad server and returns.

Parameters
coordinatesstr or astropy.coordinates object

the identifier or coordinates around which to query.

radiusstr or Quantity, optional

the radius of the region. If missing, set to default value of 2 arcmin.

equinoxfloat, optional

the equinox of the coordinates. If missing set to default 2000.0.

epochstr, optional

the epoch of the input coordinates. Must be specified as [J|B] <epoch>. If missing, set to default J2000.

get_query_payloadbool, optional

When set to True the method returns the HTTP request parameters. Defaults to False.

Returns
responserequests.Response

Response of the query from the server.

remove_votable_fields(*args, **kwargs)[source]

Removes the specified field names from SimbadClass._VOTABLE_FIELDS

Parameters
list of field_names to be removed
strip_params: bool

If true, strip the specified keywords before removing them: e.g., ra(foo) would remove ra(bar) if this is True

reset_votable_fields()[source]

resets VOTABLE_FIELDS to defaults