Skip to content

Commit 66ebc71

Browse files
Jorge Fernandez HernandezJorge Fernandez Hernandez
authored andcommitted
GAIASWRQ-25 Update documentation for section 2.6
1 parent 605efd9 commit 66ebc71

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

astroquery/gaia/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,8 @@ def cross_match_stream(self, *, table_a_full_qualified_name, table_a_column_ra,
922922
table_metadata_b, verbose)
923923

924924
query = (
925-
f"SELECT a.*, b.*, DISTANCE(a.{table_a_column_ra}, a.{table_a_column_dec}, b.{table_b_column_ra}, "
926-
f"b.{table_b_column_dec}) AS ang_sep_arcsec "
925+
f"SELECT a.*, DISTANCE(a.{table_a_column_ra}, a.{table_a_column_dec}, b.{table_b_column_ra}, "
926+
f"b.{table_b_column_dec}) AS separation, b.* "
927927
f"FROM {table_a_full_qualified_name} AS a JOIN {table_b_full_qualified_name} AS b "
928928
f"ON DISTANCE(a.{table_a_column_ra}, a.{table_a_column_dec}, b.{table_b_column_ra}, b.{table_b_column_dec})"
929929
f" < {radius} / 3600.")
@@ -961,7 +961,7 @@ def __check_columns_exist(self, table_metadata_a, full_qualified_table_name, col
961961
column_names = [column.name for column in table_metadata_a.columns]
962962
if column_ra not in column_names or column_dec not in column_names:
963963
raise ValueError(
964-
f"Please, columns {column_ra} or {column_dec} not available in the table '"
964+
f"Please check: columns {column_ra} or {column_dec} not available in the table '"
965965
f"{full_qualified_table_name}'")
966966

967967
def __get_table_metadata(self, full_qualified_table_name, verbose):

astroquery/gaia/tests/test_gaiatap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,13 +1468,13 @@ def update_user_table(self, table_name, list_of_changes, verbose):
14681468
monkeypatch.setattr(Tap, "load_table", load_table_monkeypatched)
14691469
monkeypatch.setattr(TapPlus, "update_user_table", update_user_table)
14701470

1471-
error_message = "Please, columns Wrong_ra or dec not available in the table 'user_hola.tableA'"
1471+
error_message = "Please check: columns Wrong_ra or dec not available in the table 'user_hola.tableA'"
14721472
with pytest.raises(ValueError, match=error_message):
14731473
mock_querier_async.cross_match_stream(table_a_full_qualified_name="user_hola.tableA",
14741474
table_a_column_ra="Wrong_ra", table_a_column_dec="dec",
14751475
background=background)
14761476

1477-
error_message = "Please, columns ra or Wrong_dec not available in the table 'user_hola.tableA'"
1477+
error_message = "Please check: columns ra or Wrong_dec not available in the table 'user_hola.tableA'"
14781478
with pytest.raises(ValueError, match=error_message):
14791479
mock_querier_async.cross_match_stream(table_a_full_qualified_name="user_hola.tableA",
14801480
table_a_column_ra="ra", table_a_column_dec="Wrong_dec",

docs/gaia/gaia.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -738,21 +738,22 @@ We can type the following::
738738
2.6. Cross match
739739
^^^^^^^^^^^^^^^^
740740

741-
It is possible to run a geometric cross-match between the RA/Dec coordinates of two tables
742-
using the crossmatch function provided by the archive. In order to do so the user must be
743-
logged in. This is required because the cross match operation will generate a join table
744-
in the user private area. That table contains the identifiers of both tables and the separation,
745-
in degrees, between RA/Dec coordinates of each source in the first table and its associated
746-
source in the second table.
741+
It is possible to run a geometric cross-match between the RA/Dec coordinates of two tables using the crossmatch function
742+
provided by the archive. To do so, the user must be logged in. This is necessary as the cross-match process will create
743+
a join table within the user's private space. That table includes the identifiers from both tables and the angular
744+
separation, in degrees, between the RA/Dec coordinates of each source in the first table and its corresponding source
745+
in the second table.
747746

748747
The cross-match requires 3 steps:
749748

750-
# Update the user table metadata to flag the positional RA/Dec columns using the dedicated method
751-
`~astroquery.utils.tap.core.TapPlus.update_user_table`, since both tables must have defined RA and Dec columns. See
752-
previous section to know how to assign those flags;
753-
# Launch the built-in cross-match method `~astroquery.gaia.GaiaClass.cross_match`, the makes a table in the user's
749+
1. Update the user table metadata to flag the positional RA/Dec columns using the dedicated method
750+
`~astroquery.utils.tap.core.TapPlus.update_user_table`, as both tables must have defined RA and Dec columns. See
751+
previous section to learn how to assign those flags;
752+
753+
2. Launch the built-in cross-match method `~astroquery.gaia.GaiaClass.cross_match`, which creates a table in the user's
754754
private area;
755-
# Later, this table can be used to obtain the actual data from both tables, launching an ADQL query using the
755+
756+
3. Subsequently, this table can be employed to retrieve the data from both tables, launching an ADQL query with the
756757
"launch_job" or "launch_job_async" method.
757758

758759
The following example uploads a table and then, the table is used in a cross match::
@@ -771,7 +772,7 @@ The following example uploads a table and then, the table is used in a cross mat
771772

772773
The cross-match launches an asynchronous query that saves the results at the user's private area, so it depends on the
773774
user files quota. This table only contains 3 columns: first table column id, second table column id and the angular
774-
separation (ded) between each source. Once you have your cross match finished, you can access to this table::
775+
separation (degrees) between each source. Once you have your cross match finished, you can access to this table::
775776

776777
>>> xmatch_table = 'user_<your_login_name>.' + xmatch_table_name
777778
>>> query = (f"SELECT c.separation*3600 AS separation_arcsec, a.*, b.* FROM gaiadr3.gaia_source AS a, "
@@ -796,10 +797,10 @@ The previous 3-step cross-match can be executed in one step by the following met
796797
Output file: 1611860482314O-result.vot.gz
797798
Results: None
798799

799-
This method updates all the user table metadata to flag the positional RA/Dec columns, launches the positional
800-
cross-match as an asynchronous query. The returned job provides information for all the columns in both input tables
801-
plus the angular distance (deg) between each cross-matched source. Unlike the previous 3-step method, the output table
802-
contains all the columns from each table, so that size of the cross-match output could be pretty large.
800+
This method updates the user table metadata to flag the positional RA/Dec columns and launches the positional
801+
cross-match as an asynchronous query. Unlike the previous 3-step cross-match method, the returned job provides direct
802+
access to the output of the cross-match information: for each matched source, all the columns from the input tables plus
803+
the angular distance (degrees). Therefore, the size of the output can be quite large.
803804

804805

805806
2.7. Tables sharing

0 commit comments

Comments
 (0)