Skip to content

Commit 5c2ee14

Browse files
committed
default to all-sky search when column_filters is given and position is None
1 parent 8606f4f commit 5c2ee14

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

astroquery/heasarc/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ def query_region(self, position=None, catalog=None, radius=None, *,
499499
table : A `~astropy.table.Table` object.
500500
"""
501501

502+
# if we have column_filters and no position, assume all-sky search
503+
if position is None and column_filters is not None:
504+
spatial = 'all-sky'
505+
502506
if spatial.lower() == 'all-sky':
503507
where = ''
504508
elif spatial.lower() == 'polygon':

docs/heasarc/heasarc.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,13 @@ This allows you to query a catalog by specifying
217217
various column constraints. For example, the following query searches the ``chanmaster``
218218
catalog for all observations with exposure time greater than 190 ks.
219219

220+
Note that when column filters are given and no position is specified,
221+
the search defaults to an all-sky search.
222+
220223
.. doctest-remote-data::
221224

222225
>>> from astroquery.heasarc import Heasarc
223226
>>> tab = Heasarc.query_region(
224-
... spatial='all-sky',
225227
... catalog='chanmaster', column_filters={'exposure': ('>', '190000')}
226228
... )
227229
>>> tab['name', 'obsid', 'ra', 'dec', 'exposure'][:3].pprint()
@@ -238,7 +240,6 @@ Another example may be to search the ``xmmmaster`` for a observation in some tim
238240

239241
>>> from astroquery.heasarc import Heasarc
240242
>>> tab = Heasarc.query_region(
241-
... spatial='all-sky',
242243
... catalog='xmmmaster', column_filters={'time': (52300, 52310)}
243244
... )
244245
>>> tab['name', 'obsid', 'ra', 'dec', 'time', 'duration'][:3].pprint()

0 commit comments

Comments
 (0)