Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for the gaia query object (#1760) #1871

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 91 additions & 21 deletions docs/gaia/gaia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,85 @@ degrees around an specific point in RA/Dec coordinates.
>>> r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
>>> r.pprint()

dist solution_id ... ecl_lat
... Angle[deg]
--------------------- ------------------- ... -------------------
0.0026029414438061079 1635378410781933568 ... -36.779151653783892
0.0038537557334594502 1635378410781933568 ... -36.773899692008634
0.0045451702670639632 1635378410781933568 ... -36.772645786277522
0.0056131312891700424 1635378410781933568 ... -36.781488832325074
... ... ... ...
Length = 152 rows
dist solution_id ... epoch_photometry_url
...
--------------------- ------------------- ... --------------------
0.0026034636994048854 1635721458409799680 ...
0.0038518741347606357 1635721458409799680 ...
0.00454542650096783 1635721458409799680 ...
0.005613919443965546 1635721458409799680 ...
0.005846434715822121 1635721458409799680 ...
0.006209042666371929 1635721458409799680 ...
0.007469463683838576 1635721458409799680 ...
0.008202004514524316 1635721458409799680 ...
0.008338509690874027 1635721458409799680 ...
0.008406677772258921 1635721458409799680 ...
... ... ... ...
0.01943176697471851 1635721458409799680 ...
0.019464719601172412 1635721458409799680 ...
0.019467068628703368 1635721458409799680 ...
0.019752561500226976 1635721458409799680 ...
0.01991656886177004 1635721458409799680 ...
0.020149589233310516 1635721458409799680 ...
0.020307185970548904 1635721458409799680 ...
0.020454730686780127 1635721458409799680 ...
0.020802655215768254 1635721458409799680 ...
0.021615117161838747 1635721458409799680 ...
Length = 50 rows

Queries return a limited number of rows controlled by ``Gaia.ROW_LIMIT``. To change the default behaviour set this appropriately.

.. code-block:: python

>>> Gaia.ROW_LIMIT = 8
>>> r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
>>> r.pprint()

dist solution_id ... epoch_photometry_url
...
--------------------- ------------------- ... --------------------
0.0026034636994048854 1635721458409799680 ...
0.0038518741347606357 1635721458409799680 ...
0.00454542650096783 1635721458409799680 ...
0.005613919443965546 1635721458409799680 ...
0.005846434715822121 1635721458409799680 ...
0.006209042666371929 1635721458409799680 ...
0.007469463683838576 1635721458409799680 ...
0.008202004514524316 1635721458409799680 ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add an additional example for unlimited number of rows.

E.g. work the test from here: https://github.com/astropy/astroquery/blob/master/astroquery/gaia/tests/test_gaia_remote.py#L24 into an example

To return an unlimited number of rows set ``Gaia.ROW_LIMIT`` to -1.

.. code-block:: python

>>> Gaia.ROW_LIMIT = -1
>>> r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
>>> r.pprint()

dist solution_id ... epoch_photometry_url
...
--------------------- ------------------- ... --------------------
0.0026034636994048854 1635721458409799680 ...
0.0038518741347606357 1635721458409799680 ...
0.00454542650096783 1635721458409799680 ...
0.005613919443965546 1635721458409799680 ...
0.005846434715822121 1635721458409799680 ...
0.006209042666371929 1635721458409799680 ...
0.007469463683838576 1635721458409799680 ...
0.008202004514524316 1635721458409799680 ...
0.008338509690874027 1635721458409799680 ...
0.008406677772258921 1635721458409799680 ...
... ... ... ...
0.049718018073992835 1635721458409799680 ...
0.04977869666747251 1635721458409799680 ...
0.05006096698512638 1635721458409799680 ...
0.05038566478030134 1635721458409799680 ...
0.050827895451955894 1635721458409799680 ...
0.050860907684754444 1635721458409799680 ...
0.051038347209386326 1635721458409799680 ...
0.05121063325107872 1635721458409799680 ...
0.051957226883925664 1635721458409799680 ...
0.05320916763883812 1635721458409799680 ...
Length = 176 rows


1.2. Cone search
Expand All @@ -121,16 +191,16 @@ radius argument.
>>> r = j.get_results()
>>> r.pprint()

dist solution_id ... ecl_lat
... Angle[deg]
--------------------- ------------------- ... -------------------
0.0026029414438061079 1635378410781933568 ... -36.779151653783892
0.0038537557334594502 1635378410781933568 ... -36.773899692008634
0.0045451702670639632 1635378410781933568 ... -36.772645786277522
0.0056131312891700424 1635378410781933568 ... -36.781488832325074
... ... ... ...
Length = 2000 rows

solution_id designation ... dist
...
------------------- ---------------------------- ... ---------------------
1635721458409799680 Gaia DR2 6636090334814214528 ... 0.0026034636994048854
1635721458409799680 Gaia DR2 6636090339113063296 ... 0.0038518741347606357
1635721458409799680 Gaia DR2 6636090334814217600 ... 0.00454542650096783
1635721458409799680 Gaia DR2 6636089583198816640 ... 0.005613919443965546
1635721458409799680 Gaia DR2 6636090334814218752 ... 0.005846434715822121
... ... ... ...
Length = 50 rows


1.3. Getting public tables metadata
Expand Down Expand Up @@ -257,7 +327,7 @@ available formats are: 'votable', 'votable_plain', 'fits', 'csv' and 'json', def
... "matched_observations,duplicated_source,phot_variable_flag "
... "from gaiadr2.gaia_source order by source_id",
... dump_to_file=True, output_format='votable')
>>> print(job.outputFile)
>>> print(job.outputFile)

1592474300458O-result.vot.gz

Expand Down Expand Up @@ -541,7 +611,7 @@ Your schema name will be automatically added to the provided table name.
>>> url = ("http://tapvizier.u-strasbg.fr/TAPVizieR/tap/sync/?"
... "REQUEST=doQuery&lang=ADQL&FORMAT=votable&"
... "QUERY=select+*+from+TAP_SCHEMA.columns+where+table_name='II/336/apass9'")

>>> job = Gaia.upload_table(upload_resource=url, table_name="table_test_from_url",
... table_description="Some description")

Expand Down