Skip to content

Commit d59cd4f

Browse files
Jorge Fernandez HernandezJorge Fernandez Hernandez
authored andcommitted
GAIAMNGT-1632 C9APP-193 Astroquery documentation: general update [ci skip]
1 parent b530378 commit d59cd4f

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

docs/gaia/gaia.rst

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ Examples
7676

7777
This query searches for all the objects contained in an arbitrary rectangular projection of the sky.
7878

79+
WARNING: This method implements the ADQL BOX function that is deprecated in the latest version of the standard
80+
(ADQL 2.1, see: https://ivoa.net/documents/ADQL/20231107/PR-ADQL-2.1-20231107.html#tth_sEc4.2.9).
81+
7982
It is possible to choose which data release to query, by default the Gaia DR3 catalogue is used. For example::
8083

8184
>>> from astroquery.gaia import Gaia
@@ -199,7 +202,7 @@ To load only table names metadata (TAP+ capability):
199202
INFO: Retrieving tables... [astroquery.utils.tap.core]
200203
INFO: Parsing tables... [astroquery.utils.tap.core]
201204
INFO: Done. [astroquery.utils.tap.core]
202-
>>> for table in (tables):
205+
>>> for table in tables:
203206
... print(table.get_qualified_name())
204207
external.external.apassdr9
205208
external.external.catwise2020
@@ -636,13 +639,13 @@ table named: user_<your_login_name>.'t'<job_id>::
636639
>>> from astroquery.gaia import Gaia
637640
>>> Gaia.login()
638641
>>> j1 = Gaia.launch_job_async("select top 10 * from gaiadr3.gaia_source")
639-
>>> job = Gaia.upload_table_from_job(j1)
642+
>>> Gaia.upload_table_from_job(job = j1)
640643
Created table 't1539932994481O' from job: '1539932994481O'.
641644

642645
Now, you can query your table as follows (a full qualified table name must be provided,
643646
i.e.: *user_<your_login_name>.t<job_id>*)::
644647

645-
>>> full_qualified_table_name = 'user_<your_login_name>.t1539932994481O'
648+
>>> full_qualified_table_name = 'user_<your_login_name>."t1710251325268O"'
646649
>>> query = 'select * from ' + full_qualified_table_name
647650
>>> job = Gaia.launch_job(query=query)
648651
>>> results = job.get_results()
@@ -750,12 +753,11 @@ The following example uploads a table and then, the table is used in a cross mat
750753

751754
Once you have your cross match finished, you can obtain the results::
752755

756+
753757
>>> xmatch_table = 'user_<your_login_name>.' + xmatch_table_name
754-
>>> query = ('SELECT c."dist"*3600 as dist, a.*, b.* FROM gaiadr3.gaia_source AS a, '
755-
... 'full_qualified_table_name+' AS b, '
756-
... 'xmatch_table+' AS c '
757-
... 'WHERE (c.gaia_source_source_id = a.source_id AND '
758-
... 'c.my_sources_my_sources_oid = b.my_sources_oid)'
758+
>>> query = (f"SELECT c.separation*3600 AS separation_arcsec, a.*, b.* FROM gaiadr3.gaia_source AS a, "
759+
... f"{full_qualified_table_name} AS b, {xmatch_table} AS c WHERE c.gaia_source_source_id = a.source_id AND "
760+
... f"c.my_sources_my_sources_oid = b.my_sources_oid")
759761
>>> job = Gaia.launch_job(query=query)
760762
>>> results = job.get_results()
761763

@@ -855,16 +857,20 @@ The following example shows how to retrieve the DataLink products associated wit
855857
>>> data_release = 'Gaia DR3' # Options are: 'Gaia DR3' (default), 'Gaia DR2'
856858
>>> datalink = Gaia.load_data(ids=[2263166706630078848, 2263178457660566784, 2268372099615724288],
857859
... data_release=data_release, retrieval_type=retrieval_type, data_structure=data_structure)
858-
>>> datalink.keys()
859-
dict_keys(['MCMC_GSPPHOT_COMBINED.xml', 'EPOCH_PHOTOMETRY_COMBINED.xml', 'RVS_COMBINED.xml', 'MCMC_MSC_COMBINED.xml', 'XP_SAMPLED_COMBINED.xml', 'XP_CONTINUOUS_COMBINED.xml'])
860860

861+
The DataLink products are stored inside a Python Dictionary. Each of its elements (keys) contains a one-element list that can be extracted as follows:
862+
.. code-block:: python
863+
864+
>>> dl_keys = [inp for inp in datalink.keys()]
865+
>>> dl_keys.sort()
866+
>>> print(f'The following Datalink products have been downloaded:')
867+
>>> for dl_key in dl_keys:
868+
print(f' * {dl_key}')
861869
862870
.. Note::
863871

864-
It is not possible to search for and retrieve the DataLink products
865-
associated to more than 5000 sources in one and the same call.
866-
However, it is possible to overcome this limit programmatically using a
867-
sequential download, as explained in this tutorial_.
872+
It is not possible to search for and retrieve the DataLink products associated to more than 5000 sources in one and the same call.
873+
However, it is possible to overcome this limit programmatically using a sequential download, as explained in this tutorial_.
868874

869875
.. _tutorial: https://www.cosmos.esa.int/web/gaia-users/archive/datalink-products#datalink_jntb_get_above_lim
870876
.. _DataLink: https://www.ivoa.net/documents/DataLink/

0 commit comments

Comments
 (0)