Skip to content

Commit 28bcee6

Browse files
author
C. E. Brasseur
authored
Merge pull request #2249 from eerovaher/gaia-object-radius-columns
Enable calling `Gaia.query_object()` with both `columns` and `radius`
2 parents 31a4164 + 252b116 commit 28bcee6

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ esa.jwst
1717

1818
- Minor fixes, documentation updated. [#2257]
1919

20+
gaia
21+
^^^^
22+
23+
- The ``query_object()`` and ``query_object_async()`` methods of
24+
``astroquery.gaia.Gaia`` no longer ignore their ``columns`` argument when
25+
``radius`` is specified. [#2249]
26+
2027
Infrastructure, Utility and Other Changes and Additions
2128
-------------------------------------------------------
2229

astroquery/gaia/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ def __query_object(self, coordinate, radius=None, width=None, height=None,
386386
coord = self.__getCoordInput(coordinate, "coordinate")
387387
job = None
388388
if radius is not None:
389-
job = self.__cone_search(coord, radius,
390-
async_job=async_job, verbose=verbose)
389+
job = self.__cone_search(coord, radius, async_job=async_job,
390+
verbose=verbose, columns=columns)
391391
else:
392392
raHours, dec = commons.coord_to_radec(coord)
393393
ra = raHours * 15.0 # Converts to degrees

astroquery/gaia/tests/test_gaia_remote.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
from .. import GaiaClass
66

77

8+
@pytest.mark.remote_data
9+
def test_query_object_columns_with_radius():
10+
# Regression test: `columns` were ignored if `radius` was provided [#2025]
11+
Gaia = GaiaClass()
12+
sc = SkyCoord(ra=0*u.deg, dec=0*u.deg)
13+
table = Gaia.query_object_async(sc, radius=10*u.arcsec, columns=['ra'])
14+
assert table.colnames == ['ra', 'dist']
15+
16+
817
@pytest.mark.remote_data
918
def test_query_object_row_limit():
1019
Gaia = GaiaClass()

0 commit comments

Comments
 (0)