Skip to content

Commit 5a8b149

Browse files
committed
ENH: adding servicetype kwarg to list_collection
1 parent 1e8c4dd commit 5a8b149

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

astroquery/ipac/irsa/core.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,29 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,
116116

117117
query_sia.__doc__ = query_sia.__doc__.replace('_SIA2_PARAMETERS', SIA2_PARAMETERS_DESC)
118118

119-
def list_collections(self):
119+
def list_collections(self, servicetype='sia'):
120120
"""
121121
Return information of available IRSA SIAv2 collections to be used in ``query_sia`` queries.
122122
123+
Parameters
124+
----------
125+
servicetype : str or None
126+
Service type to list collections for.
127+
Currently supported ones are: 'SIA'.
128+
123129
Returns
124130
-------
125131
collections : A `~astropy.table.Table` object.
126132
A table listing all the possible collections for IRSA SIA queries.
127133
"""
128-
query = "SELECT DISTINCT collection from caom.observation ORDER by collection"
134+
135+
servicetype = servicetype.upper()
136+
137+
if servicetype == 'SIA':
138+
query = "SELECT DISTINCT collection from caom.observation ORDER by collection"
139+
else:
140+
raise ValueError("servicetype should be 'sia'")
141+
129142
collections = self.query_tap(query=query)
130143
return collections.to_table()
131144

0 commit comments

Comments
 (0)