@@ -76,6 +76,9 @@ Examples
76
76
77
77
This query searches for all the objects contained in an arbitrary rectangular projection of the sky.
78
78
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
+
79
82
It is possible to choose which data release to query, by default the Gaia DR3 catalogue is used. For example::
80
83
81
84
>>> from astroquery.gaia import Gaia
@@ -199,7 +202,7 @@ To load only table names metadata (TAP+ capability):
199
202
INFO: Retrieving tables... [astroquery.utils.tap.core]
200
203
INFO: Parsing tables... [astroquery.utils.tap.core]
201
204
INFO: Done. [astroquery.utils.tap.core]
202
- >>> for table in ( tables) :
205
+ >>> for table in tables:
203
206
... print (table.get_qualified_name())
204
207
external.external.apassdr9
205
208
external.external.catwise2020
@@ -636,13 +639,13 @@ table named: user_<your_login_name>.'t'<job_id>::
636
639
>>> from astroquery.gaia import Gaia
637
640
>>> Gaia.login()
638
641
>>> 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)
640
643
Created table 't1539932994481O' from job: '1539932994481O'.
641
644
642
645
Now, you can query your table as follows (a full qualified table name must be provided,
643
646
i.e.: *user_<your_login_name>.t<job_id> *)::
644
647
645
- >>> full_qualified_table_name = 'user_<your_login_name>.t1539932994481O '
648
+ >>> full_qualified_table_name = 'user_<your_login_name>."t1710251325268O" '
646
649
>>> query = 'select * from ' + full_qualified_table_name
647
650
>>> job = Gaia.launch_job(query=query)
648
651
>>> results = job.get_results()
@@ -750,12 +753,11 @@ The following example uploads a table and then, the table is used in a cross mat
750
753
751
754
Once you have your cross match finished, you can obtain the results::
752
755
756
+
753
757
>>> 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")
759
761
>>> job = Gaia.launch_job(query=query)
760
762
>>> results = job.get_results()
761
763
@@ -855,16 +857,20 @@ The following example shows how to retrieve the DataLink products associated wit
855
857
>>> data_release = ' Gaia DR3' # Options are: 'Gaia DR3' (default), 'Gaia DR2'
856
858
>>> datalink = Gaia.load_data(ids = [2263166706630078848 , 2263178457660566784 , 2268372099615724288 ],
857
859
... 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'])
860
860
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} ' )
861
869
862
870
.. Note ::
863
871
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 _.
868
874
869
875
.. _tutorial : https://www.cosmos.esa.int/web/gaia-users/archive/datalink-products#datalink_jntb_get_above_lim
870
876
.. _DataLink : https://www.ivoa.net/documents/DataLink/
0 commit comments