Added columns and column_filters parameters to query_region and query_region_async methods
@@ -436,7 +436,8 @@ class BaseWFAUClass(QueryWithLogin):
def query_region(self, coordinates, radius=1 * u.arcmin,
programme_id=None, database=None,
- verbose=False, get_query_payload=False, system='J2000'):
+ verbose=False, get_query_payload=False, system='J2000',
+ columns=['default'], column_filters=''):
"""
Used to query a region around a known identifier or given
coordinates from the catalog.
@@ -468,6 +469,11 @@ class BaseWFAUClass(QueryWithLogin):
system : 'J2000' or 'Galactic'
The system in which to perform the query. Can affect the output
data columns.
+ columns : list, optional.
+ Columns to include. Default to 'default'.
+ column_filters : str, optional
+ Filters to apply to the search (SQL condition). Default is empty
+ (no filters applied).
Returns
-------
@@ -488,7 +494,8 @@ class BaseWFAUClass(QueryWithLogin):
programme_id=programme_id,
database=database,
get_query_payload=get_query_payload,
- system=system)
+ system=system, columns=columns,
+ column_filters=column_filters)
if get_query_payload:
return response
@@ -498,7 +505,8 @@ class BaseWFAUClass(QueryWithLogin):
def query_region_async(self, coordinates, radius=1 * u.arcmin,
programme_id=None,
database=None, get_query_payload=False,
- system='J2000'):
+ system='J2000', columns=['default'],
+ column_filters=''):
"""
Serves the same purpose as `query_region`. But
returns the raw HTTP response rather than the parsed result.
@@ -524,6 +532,11 @@ class BaseWFAUClass(QueryWithLogin):
get_query_payload : bool, optional
If `True` then returns the dictionary sent as the HTTP request.
Defaults to `False`.
+ columns : list, optional.
+ Columns to include. Default to 'default'.
+ column_filters : str, optional
+ Filters to apply to the search (SQL condition). Default is empty
+ (no filters applied).
Returns
-------
@@ -555,8 +568,8 @@ class BaseWFAUClass(QueryWithLogin):
request_payload['format'] = 'VOT'
request_payload['compress'] = 'NONE'
request_payload['rows'] = 1
- request_payload['select'] = 'default'
- request_payload['where'] = ''
+ request_payload['select'] = ','.join(columns)
+ request_payload['where'] = column_filters
# for some reason, this is required on the VISTA website
if self.archive is not None:
