Skip to content

Commit 1212344

Browse files
committed
DOC: adding examples for using the filter kwarg
1 parent d4e0c3a commit 1212344

File tree

2 files changed

+46
-39
lines changed

2 files changed

+46
-39
lines changed

astroquery/ipac/irsa/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ def list_collections(self, *, servicetype=None, filter=None):
175175
Service type to list collections for. Returns all collections when not provided.
176176
Currently supported service types are: 'SIA', 'SSA'.
177177
filter : str or None
178-
If specified we only return collections with names containing the filter string.
178+
If specified we only return collections then their collection_name
179+
contains the filter string.
179180
180181
Returns
181182
-------
@@ -313,7 +314,8 @@ def list_catalogs(self, *, full=False, filter=None, cache=False):
313314
If True returns the full schema as a `~astropy.table.Table`.
314315
If False returns a dictionary of the table names and their description.
315316
filter : str or None
316-
If specified we only return catalogs with names containing the filter string.
317+
If specified we only return catalogs when their catalog_name
318+
contains the filter string.
317319
"""
318320
tap_tables = self.query_tap("SELECT * FROM TAP_SCHEMA.tables").to_table()
319321

docs/ipac/irsa/irsa.rst

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,27 @@ Available IRSA catalogs
2525

2626
To get a concise list of IRSA catalogs available to query, use the
2727
`~.astroquery.ipac.irsa.IrsaClass.list_catalogs` method.
28-
The output consists of two fields for each catalog. To query a
28+
The output consists of two fields for each catalog, the name of the catalog
29+
and a very short description. To query a
2930
specific catalog, the first field can be entered as the value of the
3031
``catalog`` parameter in the `~.astroquery.ipac.irsa.IrsaClass.query_region` method.
32+
You can also use the ``filter`` argument to return only the catalogs with
33+
name matches to the specified string.
34+
3135

3236
.. doctest-remote-data::
3337

3438
>>> from astroquery.ipac.irsa import Irsa
35-
>>> Irsa.list_catalogs() # doctest: +IGNORE_OUTPUT
36-
{'a1763t2': 'Abell 1763 Source Catalog',
37-
'a1763t3': 'Abell 1763 MIPS 70 micron Catalog',
38-
'acs_iphot_sep07': 'COSMOS ACS I-band photometry catalog September 2007',
39-
'akari_fis': 'Akari/FIS Bright Source Catalogue',
40-
'akari_irc': 'Akari/IRC Point Source Catalogue',
41-
'astsight': 'IRAS Minor Planet Survey',
42-
...
39+
>>> Irsa.list_catalogs(filter='spitzer') # doctest: +IGNORE_OUTPUT
40+
{'spitzer.safires_images': 'Spitzer Archival FIR Extragalactic Survey (SAFIRES) Images',
41+
'spitzer.safires_science': 'Spitzer SAFIRES Science Image Metadata',
42+
'spitzer.safires_ancillary': 'Spitzer SAFIRES Ancillary Image Metadata',
43+
'spitzer.sage_images': 'SAGE Images',
44+
'spitzer.sage_mips_mos': 'Spitzer SAGE MIPS Mosaic Image Metadata',
4345
...
44-
'xmm_cat_s05': "SWIRE XMM_LSS Region Spring '05 Spitzer Catalog"}
46+
'spitzer.ssgss_irs_sl_ll': 'SSGSS IRS SL LL Spectra',
47+
'spitzer.swire_images': 'Spitzer Wide-area InfraRed Extragalactic Survey (SWIRE) Images',
48+
'herschel.hops_spitzer': 'HOPS Spitzer Metadata'}
4549

4650
To get a full list of information available for each available
4751
catalog, use the ``full`` keyword argument. The output consists of many columns for each catalog.
@@ -52,14 +56,16 @@ the `~astroquery.ipac.irsa.IrsaClass.query_region` method.
5256

5357
>>> from astroquery.ipac.irsa import Irsa
5458
>>> Irsa.list_catalogs(full=True) # doctest: +IGNORE_OUTPUT
55-
<DALResultsTable length=934>
56-
table_index schema_name table_name description ... irsa_access_flag irsa_nrows irsa_odbc_datasource irsa_spatial_idx_name
57-
int32 object object object ... int32 int64 object object
58-
----------- ----------- ---------------------------------- --------------------------------------------- ... ---------------- ---------- -------------------- ---------------------
59-
303 spitzer spitzer.m31irac_image M31IRAC Images ... 30 4 postgres
60-
304 spitzer mipslg MIPS Local Galaxies Catalog ... 30 240 spitzer SPT_IND_MIPSLG
61-
305 spitzer spitzer.mips_lg_images MIPS Local Galaxies Images ... 30 606 postgres
62-
...
59+
<Table length=951>
60+
table_index schema_name table_name ... irsa_nrows irsa_odbc_datasource irsa_spatial_idx_name
61+
int32 object object ... int64 object object
62+
----------- ----------- ---------------------------- ... ---------- -------------------- ---------------------
63+
101 wax cf_info ... 456480 wax SPTC01
64+
102 wax cf_link ... 204143440 wax
65+
103 twomass ext_src_c ... 403811 twomass EXT_SRC_CIX413
66+
104 wax ecf_info ... 2146 wax SPTETC01
67+
105 wax ecf_link ... 473971 wax
68+
...
6369

6470

6571
Spatial search types
@@ -286,29 +292,28 @@ To list available collections for SIA queries, the
286292
`~astroquery.ipac.irsa.IrsaClass.list_collections` method is provided, and
287293
will return a `~astropy.table.Table`. You can use the ``servicetype``
288294
argument to filter for image or spectral collections using ``'SIA'`` or
289-
``'SSA'`` respectively:
295+
``'SSA'`` respectively. You can also use the ``filter`` argument to show
296+
only the collections with the given filter strings in the collection names.
290297

291298
.. doctest-remote-data::
292299

293300
>>> from astroquery.ipac.irsa import Irsa
294-
>>> Irsa.list_collections(servicetype='SIA')
295-
<Table length=104>
296-
collection
297-
object
298-
---------------------
299-
akari_allskymaps
300-
blast
301-
bolocam_gps
302-
bolocam_lh
303-
bolocam_planck_sz
304-
...
305-
wise_allsky
306-
wise_allwise
307-
wise_fdepa
308-
wise_prelim
309-
wise_prelim_2bandcryo
310-
wise_unwise
311-
wise_z0mgs
301+
>>> Irsa.list_collections(servicetype='SIA', filter='spitzer')
302+
<Table length=38>
303+
collection
304+
object
305+
-------------------
306+
spitzer_abell1763
307+
spitzer_clash
308+
spitzer_cosmic_dawn
309+
spitzer_cygx
310+
spitzer_deepdrill
311+
...
312+
spitzer_spuds
313+
spitzer_srelics
314+
spitzer_ssdf
315+
spitzer_swire
316+
spitzer_taurus
312317

313318
Now open a cutout image for one of the science images. You could either use
314319
the the IRSA on-premise data or the cloud version of it using the

0 commit comments

Comments
 (0)