Skip to content

Commit ff3308f

Browse files
committed
ENH: do not include image metadata tables in catalog list by default
1 parent 5b4ffe6 commit ff3308f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

astroquery/ipac/irsa/core.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def query_region(self, coordinates=None, *, catalog=None, spatial='Cone',
304304
return response.to_table()
305305

306306
@deprecated_renamed_argument("cache", None, since="0.4.7")
307-
def list_catalogs(self, *, full=False, filter=None, cache=False):
307+
def list_catalogs(self, *, full=False, filter=None, include_metadata_tables=False, cache=False):
308308
"""
309309
Return information of available IRSA catalogs.
310310
@@ -316,8 +316,17 @@ def list_catalogs(self, *, full=False, filter=None, cache=False):
316316
filter : str or None
317317
If specified we only return catalogs when their catalog_name
318318
contains the filter string.
319+
include_metadata_tables : bool
320+
If True returns not just the catalogs but all table holdings including the image metadata tables.
321+
These are not suitable for spatial queries with e.g. ``query_region``.
319322
"""
320-
tap_tables = self.query_tap("SELECT * FROM TAP_SCHEMA.tables").to_table()
323+
324+
if include_metadata_tables:
325+
more_filtering = ""
326+
else:
327+
more_filtering = "where irsa_dbms=21"
328+
329+
tap_tables = self.query_tap(f"SELECT * FROM TAP_SCHEMA.tables {more_filtering}").to_table()
321330

322331
if filter:
323332
mask = [filter in name for name in tap_tables['table_name']]

0 commit comments

Comments
 (0)