This page is encoded according to the DALI specifications, hence using the RDFa lite framework.
What follows is a set of query examples which can be used as templates to develop your own queries.
The language used is the Astronomical Data Query Language (ADQL) of the Virtual Observatory.
Each example starts with a number and a title, continues with a descritpion of the use case at hand, provides the ADQL query, adds some further detail, lists the tables involved in the query, and finally presents the URL query string that can be used to query the TAP server.
To be used, the provided URL query string must be concatenated to the URL end point of the ESO TAP service, which is: http://archive.eso.org/tap_obs/sync?
for simple queries. Had you the intention to send more complex queries that would timeout using the previous endpoint, you could then use instead: http://archive.eso.org/tap_obs/async
which execute queries in asynchronous mode
In case you encounter a problem with any of the provided examples, please contact us at: usd-help(at)eso.org
with subject: ESO TAP SERVER
, specifying the number of the example(s) you are referring to, and describing the issue you are having. Many thanks in advance for doing so.
SELECT schema_name, table_name, description FROM TAP_SCHEMA.tables ORDER BY schema_name, table_name -- Further details: -- All TAP services must support a set of (meta) tables, in a schema named TAP_SCHEMA. -- These meta-tables describe all tables and columns published through the TAP service. -- The meta-tables can be queried themselves via TAP. -- Users can discover ESO-published tables or columns by querying the tables in this schema.
List of tables involved in the query: TAP_SCHEMA.tables
SELECT column_name, datatype, unit, ucd, utype from TAP_SCHEMA.columns where table_name='ivoa.ObsCore' -- The TAP_SCHEMA.columns table provides the column names, units, -- UCDs, description, etc., of all the published ESO tables. -- Please note that string values must be embraced in single quotes (e.g.: 'ivoa.ObsCore'). -- Please note that the part of a line starting from 2 minus signs (--) onward is considered a comment and is therefore not part of the query.
List of tables involved in the query: ivoa.ObsCore
SELECT TOP 200 target_name, instrument_name, dataproduct_type, em_min, em_max, em_res_power, obs_collection, dataproduct_subtype FROM ivoa.ObsCore WHERE em_min <= 2.18E-6 AND em_max >= 2.18E-6 AND s_dec < -74.5 -- and em_res_power < 10 -- to exclude narrow-band filters like the Hawki-BrGamma ORDER BY s_dec -- The first 200 closest products to the south pole containing the 2.18 micron wavelength will be returned, sorted by ascending declination. -- The spatial reference system used by the Virtual Observatory is ICRS.
List of tables involved in the query: ivoa.ObsCore
SELECT target_name, s_dec, s_ra, t_exptime, em_res_power, em_min, dataproduct_type, instrument_name, 3600.*distance(point('',s_ra, s_dec),point('',83.86675,-69.269741666)) as arcsec_from_SN1987A FROM ivoa.Obscore WHERE CONTAINS(s_region,CIRCLE('ICRS',83.86675,-69.269741666, 100./3600.)) = 1 -- a circle centered onto SN1987A, of radius=100 arcsec, -- must contain the s_region, i.e. the footprint of the product and em_res_power > 27000 -- R (resolving power) > 27 000 order by arcsec_from_SN1987A -- sorted (ascending) on the computed field called arcsec_from_SN1987A -- The constraint CONTAINS(arg1, arg2)==1 ensures that arg2 contains arg1. -- In this case, the CIRCLE must contain the footprint of the product (s_region). -- All coordinates are expressed in decimal degrees, as it is also the radius of the CIRCLE. -- The spatial reference system is forcefully ICRS. You can NOT modify it; -- you can omit it, as done e.g. in POINT('', s_ra, s_dec). -- -- By choice, the footprint of an ESO 1d spectrum is always a point.
List of tables involved in the query: ivoa.ObsCore
SELECT TOP 100 * FROM ivoa.Obscore WHERE CONTAINS(POINT('ICRS',123.2675,-34.5785),s_region) = 1 -- footprint(the s_region field) must contain a given point -- The constraint CONTAINS(arg1, arg2)==1 ensures that arg2 contains arg1. -- In this case, the footprint (s_region) of a product must contain the point (RA,DEC)=(123.2675deg,-34.5785deg). -- -- Please notice that this query cannot return any product whose s_region as an area of 0, which means that this query will not return any of the ESO spectra.
List of tables involved in the query: ivoa.ObsCore
SELECT TOP 100 instrument_name, em_min, em_max, s_resolution, distance(point('',s_ra,s_dec),point('',266.42,-29.0)) as dist_from_GC, dataproduct_type FROM ivoa.Obscore WHERE dataproduct_type='image' AND INTERSECTS(CIRCLE('ICRS',266.42,-29.0,5),s_region) = 1 -- intersecting (aka overlapping) a 5 deg cone around the Galactic Centre AND ((em_min < 1.25E-6 AND em_max > 1.25E-6) -- Contains lambda(J) or OR (em_min < 1.65E-6 AND em_max > 1.65E-6) -- Contains lambda(H) or OR (em_min < 2.2E-6 AND em_max > 2.2E-6)) -- Contains lambda(Ks) ORDER BY 4 -- 4 is the position of the s_resolution within the SELECT list -- INTERSECTS( arg1, arg2 ) is a function that return 1 if the two geographies arg1 and arg2 intersect in at least one point. -- ORDER BY accepts either a column name (e.g. s_resolution), or the position of the column in the SELECT list. -- ORDER BY dist_from_GC could have been used instead to return the 100 products closer to the Galactic Centre.
List of tables involved in the query: ivoa.ObsCore