From b2de3e16984157f05efaea8c44596b2a92e3da59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 15 Feb 2024 22:58:11 -0800 Subject: [PATCH 1/4] ENH: adding list_collections method to Irsa --- astroquery/ipac/irsa/core.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/astroquery/ipac/irsa/core.py b/astroquery/ipac/irsa/core.py index 4f3776add3..be8aa69b1f 100644 --- a/astroquery/ipac/irsa/core.py +++ b/astroquery/ipac/irsa/core.py @@ -126,6 +126,19 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None, f'pyvo.dam.obscore.{var}') query_sia.__doc__ = query_sia.__doc__.replace('_SIA2_PARAMETERS', SIA2_PARAMETERS_DESC) + def list_collections(self): + """ + Return information of available IRSA SIAv2 collections to be used in ``query_sia`` queries. + + Returns + ------- + collections : A `~astropy.table.Table` object. + A table listing all the possible collections for IRSA SIA queries. + """ + query = "SELECT DISTINCT collection from caom.observation ORDER by collection" + collections = self.query_tap(query=query) + return collections.to_table() + @deprecated_renamed_argument(("selcols", "cache", "verbose"), ("columns", None, None), since="0.4.7") def query_region(self, coordinates=None, *, catalog=None, spatial='Cone', radius=10 * u.arcsec, width=None, polygon=None, From e2fc69809c63570f22ac3fd2820a4156f7d20221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 15 Feb 2024 22:58:52 -0800 Subject: [PATCH 2/4] TST: adding test for list_collections --- astroquery/ipac/irsa/tests/test_irsa_remote.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/astroquery/ipac/irsa/tests/test_irsa_remote.py b/astroquery/ipac/irsa/tests/test_irsa_remote.py index 584453a944..ed52b629e7 100644 --- a/astroquery/ipac/irsa/tests/test_irsa_remote.py +++ b/astroquery/ipac/irsa/tests/test_irsa_remote.py @@ -71,6 +71,14 @@ def test_list_catalogs(self): # (at the time of writing there are 933 tables in the list). assert len(catalogs) > 900 + def test_list_collections(self): + collections = Irsa.list_collections() + # Number of available collections may change over time, test only for significant drop. + # (at the time of writing there are 110 collections in the list). + assert len(collections) > 100 + assert 'spitzer_seip' in collections['collection'] + assert 'wise_allwise' in collections['collection'] + def test_tap(self): query = "SELECT TOP 5 ra,dec FROM cosmos2015" with pytest.warns(expected_warning=DALOverflowWarning, From 479cff676bb9d7faec01b86bfd99b5c967b1392f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 15 Feb 2024 23:00:21 -0800 Subject: [PATCH 3/4] DOC: adding changelog --- CHANGES.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 54be97c819..2b7d61ef8f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -26,7 +26,10 @@ ipac.irsa ``columns``, and the ``cache`` and ``verbose`` kwargs have been deprecated as they have no effect. [#2823] -- Method to run SIAv2 VO queries is added. [#2837] +- Method to run SIAv2 VO queries, ``query_sia``, is added. [#2837] + +- Method to list available collections for SIA queries, + ``list_collections``, is added. [#2952] gaia ^^^^ From f55b116c5d9578aae868a0cedd99f52bbc7c8301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 15 Feb 2024 23:06:01 -0800 Subject: [PATCH 4/4] DOC: adding docs for list_collections --- docs/ipac/irsa/irsa.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/ipac/irsa/irsa.rst b/docs/ipac/irsa/irsa.rst index a502149c51..cab15dedb1 100644 --- a/docs/ipac/irsa/irsa.rst +++ b/docs/ipac/irsa/irsa.rst @@ -236,6 +236,31 @@ Enhanced Imaging products in the centre of the COSMOS field as an `~astropy.tabl >>> coord = SkyCoord('150.01d 2.2d', frame='icrs') >>> spitzer_images = Irsa.query_sia(pos=(coord, 1 * u.arcmin), collection='spitzer_seip').to_table() +To list available collections for SIA queries, the +`~astroquery.ipac.irsa.IrsaClass.list_collections` method is provided, and +will return a `~astropy.table.Table`: + +.. doctest-remote-data:: + + >>> from astroquery.ipac.irsa import Irsa + >>> Irsa.list_collections() + + collection + object + --------------------- + akari_allskymaps + blast + bolocam_gps + bolocam_lh + bolocam_planck_sz + ... + wise_allsky + wise_allwise + wise_prelim + wise_prelim_2bandcryo + wise_unwise + wise_z0mgs + Now open a cutout image for one of the science images. You could either use the the IRSA on-premise data or the cloud version of it using the ``access_url`` or ``cloud_access`` columns. For more info about fits