SIMBAD
CDS astronomical database: basic data, cross-identifications, bibliography and measurements for objects outside the solar system.
Module name:
simbadPython class:
astroquery.simbad.SimbadFunctions: 20
Call any function below with the astroquery_execute MCP tool. Descriptions are taken from the upstream astroquery/astropy docstrings.
Function |
Summary |
|---|---|
Add columns to the output of a SIMBAD query. |
|
Clear the cache of SIMBAD. |
|
Displays a description of the VOTable field. |
|
Display votable fields. |
|
Get the list of SIMBAD columns. |
|
Expose the tables that can be non-obviously linked with the given table. |
|
List the names and descriptions of the tables in SIMBAD. |
|
List all options to add columns to SIMBAD’s output. |
|
Displays the available wildcards that may be used in SIMBAD queries and |
|
Query the references corresponding to a given bibcode. |
|
Query all the objects mentioned in an article. |
|
Query a whole catalog. |
|
Deprecated: v0.4.8 |
|
Query either the parents or the children of the object. |
|
Query SIMBAD for the given object. |
|
Query SIMBAD with an object name. |
|
Query SIMBAD for the specified list of objects. |
|
Query SIMBAD in a cone around the specified coordinates. |
|
Query SIMBAD TAP service. |
|
Reset the output of the query_*** methods to default. |
Functions
add_votable_fields
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="add_votable_fields",
params={},
)
- SimbadClass.add_votable_fields(*args)
Add columns to the output of a SIMBAD query.
The list of possible arguments and their description for this method can be printed with
list_votable_fields.The methods affected by this:
query_object,query_objects,query_region,query_catalog,query_hierarchy,query_bibobj,query_criteria.
- Parameters:
args (
str) – The arguments to be added.
Examples
>>> from astroquery.simbad import Simbad >>> simbad = Simbad() >>> simbad.add_votable_fields('sp_type', 'sp_qual', 'sp_bibcode') >>> simbad.get_votable_fields() ['basic.main_id', 'basic.ra', 'basic.dec', 'basic.coo_err_maj', 'basic.coo_err_min', ...
clear_cache
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="clear_cache",
params={},
)
- static SimbadClass.clear_cache()
Clear the cache of SIMBAD.
get_field_description
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="get_field_description",
params={"field_name": "<field_name>"},
)
- SimbadClass.get_field_description(field_name)
Displays a description of the VOTable field.
This can be replaced by the output of
list_votable_fields.Examples
>>> from astroquery.simbad import Simbad >>> options = Simbad.list_votable_fields() >>> description_dimensions = options[options["name"] == "dimensions"]["description"] >>> description_dimensions.data.data[0] 'all fields related to object dimensions'
get_votable_fields
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="get_votable_fields",
params={},
)
- SimbadClass.get_votable_fields()
Display votable fields.
list_columns
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="list_columns",
params={},
)
- SimbadClass.list_columns(*tables: str, keyword=None, get_query_payload=False)
Get the list of SIMBAD columns.
Add tables names to restrict to some tables. Call the function without any parameter to get all columns names from all tables. The keyword argument looks for columns in the selected SIMBAD tables that contain the given keyword. The keyword search is not case-sensitive.
- Parameters:
*tables (
str, optional) – Add tables names as strings to restrict to these tables columns. This is not case-sensitive.keyword (
str, optional) – A keyword to look for in column names, table names, or descriptions.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.get_adql (
bool, optional) – Deprecated since ‘0.4.8’. This is replaced by get_query_payload that contain more information than just the ADQL string
- Return type:
Examples
>>> from astroquery.simbad import Simbad >>> Simbad.list_columns("ids", "ident") <Table length=4> table_name column_name datatype ... unit ucd object object object ... object object ---------- ----------- -------- ... ------ ----------- ident id VARCHAR ... meta.id ident oidref BIGINT ... meta.record ids ids VARCHAR ... meta.id ids oidref BIGINT ... meta.record
>>> from astroquery.simbad import Simbad >>> Simbad.list_columns(keyword="filter") <Table length=5> table_name column_name datatype ... unit ucd object object object ... object object ----------- ----------- ----------- ... ------ --------------------------- filter description UNICODECHAR ... meta.note;instr.filter filter filtername VARCHAR ... instr.bandpass;instr.filter filter unit VARCHAR ... meta.unit flux filter VARCHAR ... instr.bandpass;instr.filter mesDiameter filter CHAR ... instr.bandpass;instr.filter
>>> from astroquery.simbad import Simbad >>> Simbad.list_columns("basic", keyword="object") <Table length=4> table_name column_name datatype ... unit ucd object object object ... object object ---------- ----------- -------- ... ------ ----------------- basic main_id VARCHAR ... meta.id;meta.main basic otype_txt VARCHAR ... src.class basic oid BIGINT ... meta.record basic otype VARCHAR ... src.class
list_linked_tables
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="list_linked_tables",
params={"table": "<table>"},
)
- SimbadClass.list_linked_tables(table: str, *, get_query_payload=False)
Expose the tables that can be non-obviously linked with the given table.
This list contains only the links where the column names are not the same in the two tables. For example every
oidrefcolumn of any table can be joined with any otheroidref. The same goes for everyotypecolumn even if this is not returned by this method.- Parameters:
- Returns:
The information necessary to join the given table to an other.
- Return type:
Examples
>>> from astroquery.simbad import Simbad >>> Simbad.list_linked_tables("otypes") <Table length=2> from_table from_column target_table target_column object object object object ---------- ----------- ------------ ------------- otypedef otype otypes otype otypes oidref basic oid
list_tables
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="list_tables",
params={},
)
- SimbadClass.list_tables(*, get_query_payload=False)
List the names and descriptions of the tables in SIMBAD.
- Parameters:
get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.get_adql (
bool, optional) – Deprecated since ‘0.4.8’. This is replaced by get_query_payload that contain more information than just the ADQL string
- Return type:
list_votable_fields
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="list_votable_fields",
params={},
)
- SimbadClass.list_votable_fields()
List all options to add columns to SIMBAD’s output.
They are of four types:
“column of basic”: a column of the basic table. There fields can also be explored with
list_columns.“table”: a table other than basic that has a declared direct join
“bundle of basic columns”: a pre-selected bundle of columns of basic. Ex: “parallax” will add all columns relevant to parallax
“filter name”: an optical filter name
Examples
>>> from astroquery.simbad import Simbad >>> options = Simbad.list_votable_fields() >>> # to print only the available bundles of columns >>> options[options["type"] == "bundle of basic columns"][["name", "description"]] <Table length=8> name description object object ------------- ---------------------------------------------------- coordinates all fields related with coordinates dim major and minor axis, angle and inclination dimensions all fields related to object dimensions morphtype all fields related to the morphological type parallax all fields related to parallaxes propermotions all fields related with the proper motions sp all fields related with the spectral type velocity all fields related with radial velocity and redshift
list_wildcards
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="list_wildcards",
params={},
)
- static SimbadClass.list_wildcards()
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) ?: Any character (exactly one character) [abc]: Exactly one character taken in the list. Can also be defined by a range of characters: [A-Z] [^0-9]: Any (one) character not in the list.
query_bibcode
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_bibcode",
params={"bibcode": "<bibcode>"},
)
- SimbadClass.query_bibcode(bibcode, *, wildcard=False, abstract=False, criteria=None, get_query_payload=False, async_job=False, verbose=None, cache=None)
Query the references corresponding to a given bibcode.
Wildcards may be used to specify bibcodes.
- Parameters:
bibcode (
str) – The bibcode of the article to be queriedwildcard (
bool,defaultstoFalse) – When it is set toTrueit implies that the object is specified with wildcards.abstract (
bool,defaultstoFalse) – When this is set toTrue, the abstract of the article is also included to the result.criteria (
str) – Criteria to be applied to the query. These should be written in the ADQL syntax in a single string. See example.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – Query results table
- Return type:
Examples
>>> from astroquery.simbad import Simbad >>> simbad = Simbad() >>> simbad.ROW_LIMIT = 5 >>> simbad.query_bibcode("2016PhRvL.*", wildcard=True, ... criteria="title LIKE '%gravitational wave%coalescence.'") <Table length=1> bibcode doi journal ... volume year object object object ... int32 int16 ------------------- ------------------------------ ------- ... ------ ----- 2016PhRvL.116x1103A 10.1103/PhysRevLett.116.241103 PhRvL ... 116 2016
query_bibobj
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_bibobj",
params={"bibcode": "<bibcode>"},
)
- SimbadClass.query_bibobj(bibcode, *, criteria=None, get_query_payload=False, async_job=False, verbose=False)
Query all the objects mentioned in an article.
- Parameters:
bibcode (
str) – the bibcode of the articleget_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – Query results table
- Return type:
query_catalog
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_catalog",
params={"catalog": "<catalog>"},
)
- SimbadClass.query_catalog(catalog, *, criteria=None, get_query_payload=False, async_job=False, verbose=False, cache=True)
Query a whole catalog.
- Parameters:
catalog (
str) – The name of the catalog. This is case-dependant.criteria (
str) – Criteria to be applied to the query. These should be written in the ADQL syntax in a single string. See example.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – The result of the query to SIMBAD.
- Return type:
Examples
>>> from astroquery.simbad import Simbad >>> simbad = Simbad() >>> simbad.ROW_LIMIT = 5 >>> simbad.query_catalog("GSC", criteria="pmra > 50 and pmra < 100") <Table length=5> main_id ra ... coo_bibcode catalog_id deg ... object float64 ... object object --------------- --------------- ... ------------------- --------------- HD 26053 61.84326890626 ... 2020yCat.1350....0G GSC 04725-00973 TYC 8454-1081-1 345.11163189562 ... 2020yCat.1350....0G GSC 08454-01081 HD 10158 24.86286094434 ... 2020yCat.1350....0G GSC 00624-00340 CD-22 1862 73.17988827324 ... 2020yCat.1350....0G GSC 05911-00222 BD+02 4434 327.90220788982 ... 2020yCat.1350....0G GSC 00548-00194
Notes
Catalogs can be very large. Configuring
SimbadClass.ROW_LIMITallows to restrict the output.
query_criteria
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_criteria",
params={},
)
- SimbadClass.query_criteria(*args, get_query_payload=False, **kwargs)
Deprecated since version v0.4.8: ‘query_criteria’ is deprecated. It uses the former sim-script (SIMBAD specific) syntax (see https://simbad.cds.unistra.fr/simbad/sim-fsam). Possible replacements are the ‘criteria’ argument in the other query methods or custom ‘query_tap’ queries. These two replacements use the standard ADQL syntax.
Query SIMBAD based on any criteria [deprecated].
This method is deprecated as it uses the former SIMBAD-specific sim-script syntax. There are two possible replacements that have been added with astroquery v0.4.8 and that use the standard ADQL syntax. See the examples section.
- Parameters:
args – String arguments passed directly to SIMBAD’s script (e.g., ‘region(box, GAL, 10.5 -10.5, 0.5d 0.5d)’)
get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.kwargs – Keyword / value pairs passed to SIMBAD’s script engine (e.g., {‘otype’=’SNR’} will be rendered as otype=SNR)
- Returns:
table – Query results table
- Return type:
Examples
Can be replaced by the
criteriaargument that was added in the other query_*** methods>>> from astroquery.simbad import Simbad >>> Simbad(ROW_LIMIT=5).query_region('M1', '2d', criteria="otype='G..'") <Table length=5> main_id ra ... coo_wavelength coo_bibcode deg ... object float64 ... str1 object ------------ ----------------- ... -------------- ------------------- LEDA 136099 85.48166666666667 ... 1996A&AS..117....1S LEDA 136047 83.66958333333332 ... 1996A&AS..117....1S LEDA 136057 84.64499999999998 ... 1996A&AS..117....1S LEDA 1630996 83.99208333333333 ... O 2003A&A...412...45P 2MFGC 4574 84.37534166666669 ... I 2006AJ....131.1163S
Or by custom-written ADQL queries
>>> from astroquery.simbad import Simbad >>> Simbad.query_tap("SELECT TOP 5 main_id, sp_type" ... " FROM basic WHERE sp_type < 'F3'") <Table length=5> main_id sp_type object object ----------- ------- HD 24033B (A) HD 70218B (A) HD 128284B (A/F) CD-34 5319 (A/F) HD 80593 (A0)V
query_hierarchy
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_hierarchy",
params={"name": "<name>", "hierarchy": "<hierarchy>"},
)
- SimbadClass.query_hierarchy(name, hierarchy, *, detailed_hierarchy=True, criteria=None, get_query_payload=False, async_job=False)
Query either the parents or the children of the object.
- Parameters:
name (
str) – name of the objecthierarchy (
str) – Can take the values “parents” to return the parents of the object (ex: a galaxy cluster is a parent of a galaxy), the value “children” to return the children of an object (ex: stars can be children of a globular cluster), or the value “siblings” to return the object that share a parent with the given one (ex: the stars of an open cluster are all siblings).detailed_hierarchy (
bool) – Whether to add the two extra columns ‘hierarchy_bibcode’ that gives the article in which the hierarchy link is mentioned, and ‘membership_certainty’. membership_certainty is an integer that reflects the certainty of the hierarchy link according to the authors. Ranges between 0 and 100 where 100 means that the authors were certain of the classification. Defaults to False.criteria (
str) – Criteria to be applied to the query. These should be written in the ADQL syntax in a single string. See example.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – Query results table
- Return type:
Examples
>>> from astroquery.simbad import Simbad >>> parent = Simbad.query_hierarchy("2MASS J18511048-0615470", ... detailed_hierarchy=False, ... hierarchy="parents") >>> parent[["main_id", "ra", "dec"]] <Table length=1> main_id ra dec deg deg object float64 float64 --------- ------- ------- NGC 6705 282.766 -6.272
query_object
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_object",
params={"object_name": "<object_name>"},
)
- SimbadClass.query_object(object_name, *, wildcard=False, criteria=None, get_query_payload=False, async_job=False, verbose=False)
Query SIMBAD for the given object.
Object names may also be specified with wildcards. See examples below.
- Parameters:
object_name (
str) – name of object to be queried.wildcard (
boolean, optional) – When it is set toTrueit implies that the object is specified with wildcards. This parameter will render the query case-sensitive. Defaults toFalse.criteria (
str) – Criteria to be applied to the query. These should be written in the ADQL syntax in a single string. See example.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – The result of the query to SIMBAD.
- Return type:
Examples
Get the dimensions of a specific galaxy
>>> from astroquery.simbad import Simbad >>> simbad = Simbad() >>> simbad.add_votable_fields("dim") >>> result = simbad.query_object("m101") >>> result["main_id", "ra", "dec", "galdim_majaxis", "galdim_minaxis", "galdim_bibcode"] <Table length=1> main_id ra dec ... galdim_minaxis galdim_bibcode deg deg ... arcmin object float64 float64 ... float32 object ------- ------------------ -------- ... -------------- ------------------- M 101 210.80242916666668 54.34875 ... 20.89 2003A&A...412...45P
Get 5 NGC objects that are clusters of stars
>>> from astroquery.simbad import Simbad >>> simbad = Simbad() >>> simbad.ROW_LIMIT = 5 >>> ngc_clusters = simbad.query_object("NGC*", wildcard=True, criteria="otype='Cl*..'") >>> ngc_clusters <Table length=5> main_id ra ... coo_bibcode matched_id deg ... object float64 ... object object --------- ----------------- ... ------------------- ---------- NGC 2024 85.42916666666667 ... 2003A&A...397..177B NGC 2024 NGC 1826 76.39174999999999 ... 2011AJ....142...48W NGC 1826 NGC 2121 87.05495833333332 ... 2011AJ....142...48W NGC 2121 NGC 2019 82.98533333333333 ... 1999AcA....49..521P NGC 2019 NGC 1777 73.95 ... 2008MNRAS.389..678B NGC 1777
query_objectids
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_objectids",
params={"object_name": "<object_name>"},
)
- SimbadClass.query_objectids(object_name, *, criteria=None, get_query_payload=False, async_job=False, verbose=None, cache=None)
Query SIMBAD with an object name.
This returns a table of all names associated with that object.
- Parameters:
object_name (
str) – name of object to be queriedcriteria (
str) – an additional criteria to constrain the result. As the output of this method has only one column, these criteria can only be imposed on the columnident.id.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – The result of the query to SIMBAD.
- Return type:
Examples
Get all the names of the Bubble Nebula
>>> from astroquery.simbad import Simbad >>> Simbad.query_objectids("bubble nebula") <Table length=8> id object ------------------------------ [ABB2014] WISE G112.212+00.229 LBN 548 NGC 7635 SH 2-162 [KC97c] G112.2+00.2b [L89b] 112.237+00.226 GRS G112.22 +00.22 NAME Bubble Nebula
Get the NGC name of M101
>>> from astroquery.simbad import Simbad >>> Simbad.query_objectids("m101", criteria="ident.id LIKE 'NGC%'") <Table length=1> id object --------- NGC 5457
query_objects
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_objects",
params={"object_names": "<object_names>"},
)
- SimbadClass.query_objects(object_names, *, wildcard=False, criteria=None, get_query_payload=False, async_job=False, verbose=False, cache=False)
Query SIMBAD for the specified list of objects.
Object names may be specified with wildcards. If one of the
object_namesis not found in SIMBAD, the corresponding line is returned empty in the output (seeGiga Clusterin the example). In the output, the columnuser_specified_idis the input object name.- Parameters:
object_names (
sequenceofstrs) – names of objects to be queriedwildcard (
boolean, optional) – WhenTrue, the names may have wildcards in them. Defaults toFalse.criteria (
str) – Criteria to be applied to the query. These should be written in the ADQL syntax in a single string. See example.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – The result of the query to SIMBAD.
- Return type:
Examples
>>> from astroquery.simbad import Simbad >>> clusters = Simbad.query_objects(["Boss Great Wall", "Great Attractor", ... "Giga Cluster", "Coma Supercluster"]) >>> clusters[["main_id", "ra", "dec", "user_specified_id"]] <Table length=4> main_id ra dec user_specified_id deg deg object float64 float64 object ---------------------- ------- ------- ----------------- NAME Boss Great Wall 163.0 52.0 Boss Great Wall NAME Great Attractor 158.0 -46.0 Great Attractor -- -- Giga Cluster NAME Coma Supercluster 170.75 23.9 Coma Supercluster
query_region
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_region",
params={"coordinates": "<coordinates>"},
)
- SimbadClass.query_region(coordinates, radius=<Quantity 2. arcmin>, *, criteria=None, get_query_payload=False, async_job=False, equinox=None, epoch=None, cache=None)
Query SIMBAD in a cone around the specified coordinates.
- Parameters:
coordinates (
strorastropy.coordinatesobject) – The identifier or coordinates around which to query.radius (
strorQuantity) – the radius of the region. Defaults to 2 arcmin.criteria (
str) – Criteria to be applied to the query. These should be written in the ADQL syntax in a single string.get_query_payload (
bool, optional) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload. Defaults toFalse.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.
- Returns:
table – The result of the query to SIMBAD.
- Return type:
Examples
Look for largest galaxies in two cones
>>> from astroquery.simbad import Simbad >>> from astropy.coordinates import SkyCoord >>> simbad = Simbad() >>> simbad.ROW_LIMIT = 5 >>> simbad.add_votable_fields("otype", "dim") >>> coordinates = SkyCoord([SkyCoord(186.6, 12.7, unit=("deg", "deg")), ... SkyCoord(170.75, 23.9, unit=("deg", "deg"))]) >>> result = simbad.query_region(coordinates, radius="2d5m", ... criteria="otype = 'Galaxy..' AND galdim_majaxis>8.5") >>> result.sort("galdim_majaxis", reverse=True) >>> result["main_id", "otype", "galdim_majaxis"] <Table length=5> main_id otype galdim_majaxis arcmin object object float32 ------------ ------ -------------- LEDA 41362 GiC 11.0 M 86 GiG 10.47 LEDA 40917 AG? 10.3 M 87 AGN 9.12 NGC 4438 LIN 8.91
Notes
It is very inefficient to call this within a loop. Creating an
SkyCoordobject with a list of coordinates will be way faster.
query_tap
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="query_tap",
params={"query": "<query>"},
)
- SimbadClass.query_tap(query: str, *, maxrec=10000, async_job=False, get_query_payload=False, **uploads)
Query SIMBAD TAP service.
- Parameters:
query (
str) – A string containing the query written in the Astronomical Data Query Language (ADQL).maxrec (
int, default:10000) – The number of records to be returned. Its maximum value is given byhardlimit.uploads (
Table|VOTableFile|DALResults) – Any number of local tables to be used in the query. In the query, these tables are referred as TAP_UPLOAD.table_alias where TAP_UPLOAD is imposed and table_alias is the keyword name you chose. The maximum number of lines for the uploaded tables is 200000.async_job (
bool, optional) – When set toTrue, the query will be executed in asynchronous mode. This is better for very long queries, as it prevents transient failures to abort the query execution. Defaults toFalse.get_query_payload (
bool, defaultFalse) – When set toTruethe method returns the HTTP request parameters without querying SIMBAD. The ADQL string is in the ‘QUERY’ key of the payload.
- Returns:
The response returned by Simbad.
- Return type:
Notes
A TAP (Table Access Protocol) service allows to query data tables with queries written in ADQL (Astronomical Data Query Language), a flavor of the more general SQL (Structured Query Language). For more documentation about writing ADQL queries, you can read its official documentation (ADQL documentation) or the Simbad ADQL cheat sheet. See also: a graphic representation of Simbad’s tables and their relations.
See also
list_tablesThe list of SIMBAD’s tables.
list_columnsSIMBAD’s columns list, can be restricted to some tables and some keyword.
list_linked_tablesGiven a table, expose non-obvious possible joins with other tables.
Examples
To see the five oldest papers referenced in SIMBAD
>>> from astroquery.simbad import Simbad >>> Simbad.query_tap("SELECT top 5 bibcode, title " ... "FROM ref ORDER BY bibcode") <Table length=5> bibcode ... object ... ------------------- ... 1850CDT..1784..227M ... 1857AN.....45...89S ... 1861MNRAS..21...68B ... 1874MNRAS..34...75S ... 1877AN.....89...13W ...
Get the type for a list of objects
>>> from astroquery.simbad import Simbad >>> Simbad.query_tap("SELECT main_id, otype" ... " FROM basic WHERE main_id IN ('m10', 'm13')") <Table length=2> main_id otype object object ------- ------ M 10 GlC M 13 GlC
Upload a table to use in a query
>>> from astroquery.simbad import Simbad >>> from astropy.table import Table >>> letters_table = Table([["a", "b", "c"]], names=["alphabet"]) >>> Simbad.query_tap("SELECT TAP_UPLOAD.my_table_name.* from TAP_UPLOAD.my_table_name", ... my_table_name=letters_table) <Table length=3> alphabet str1 -------- a b c
reset_votable_fields
Call via MCP
astroquery_execute(
module_name="simbad",
function_name="reset_votable_fields",
params={},
)
- SimbadClass.reset_votable_fields()
Reset the output of the query_*** methods to default.
They will be included in the output of the following methods:
query_object,query_objects,query_region,query_catalog,query_hierarchy,query_bibobj,query_criteria.