File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -321,5 +321,27 @@ def print_catalogs(self):
321321 for catname in catalogs :
322322 print ("{:30s} {:s}" .format (catname , catalogs [catname ]))
323323
324+ def list_columns (self , catalog , * , full = False ):
325+ """
326+ Return list of columns of a given IRSA catalog.
327+
328+ Parameters
329+ ----------
330+ catalog : str
331+ The name of the catalog.
332+ full : bool
333+ If True returns the full schema as a `~astropy.table.Table`.
334+ If False returns a dictionary of the column names and their description.
335+ """
336+
337+ query = f"SELECT * from TAP_SCHEMA.columns where table_name='{ catalog } '"
338+
339+ column_table = self .query_tap (query ).to_table ()
340+
341+ if full :
342+ return column_table
343+ else :
344+ return {column ['column_name' ]: column ['description' ] for column in column_table }
345+
324346
325347Irsa = IrsaClass ()
You can’t perform that action at this time.
0 commit comments