@@ -132,22 +132,22 @@ def list_collections(self, servicetype=None):
132
132
A table listing all the possible collections for IRSA SIA queries.
133
133
"""
134
134
135
- servicetype = servicetype .upper ()
136
-
137
135
if not servicetype :
138
136
query = "SELECT DISTINCT collection from caom.observation ORDER by collection"
139
- elif servicetype == 'SIA' :
140
- query = ("SELECT DISTINCT o.collection FROM caom.observation o "
141
- "JOIN caom.plane p ON o.obsid = p.obsid "
142
- "WHERE (p.dataproducttype = 'image' OR p.dataproducttype = 'cube') "
143
- "order by collection" )
144
- elif servicetype == 'SSA' :
145
- query = ("SELECT DISTINCT o.collection FROM caom.observation o "
146
- "JOIN caom.plane p ON o.obsid = p.obsid "
147
- "WHERE (p.dataproducttype = 'spectrum' OR p.dataproducttype = 'cube') "
148
- "order by collection" )
149
137
else :
150
- raise ValueError ("if specified, servicetype should be 'SIA' or 'SSA'" )
138
+ servicetype = servicetype .upper ()
139
+ if servicetype == 'SIA' :
140
+ query = ("SELECT DISTINCT o.collection FROM caom.observation o "
141
+ "JOIN caom.plane p ON o.obsid = p.obsid "
142
+ "WHERE (p.dataproducttype = 'image' OR p.dataproducttype = 'cube') "
143
+ "order by collection" )
144
+ elif servicetype == 'SSA' :
145
+ query = ("SELECT DISTINCT o.collection FROM caom.observation o "
146
+ "JOIN caom.plane p ON o.obsid = p.obsid "
147
+ "WHERE (p.dataproducttype = 'spectrum' OR p.dataproducttype = 'cube') "
148
+ "order by collection" )
149
+ else :
150
+ raise ValueError ("if specified, servicetype should be 'SIA' or 'SSA'" )
151
151
152
152
collections = self .query_tap (query = query )
153
153
return collections .to_table ()
0 commit comments