Skip to content

Commit eb99253

Browse files
authored
Merge pull request #785 from keflavich/alma_accept_kwargs
ALMA: Allow kwargs as input
2 parents 3c935b6 + 251b15e commit eb99253

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

astroquery/alma/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def query_region_async(self, coordinate, radius, cache=True, public=True,
105105
science=science, **kwargs)
106106

107107
def query_async(self, payload, cache=True, public=True, science=True,
108-
view_format='raw', get_query_payload=False):
108+
view_format='raw', get_query_payload=False, **kwargs):
109109
"""
110110
Perform a generic query with user-specified payload
111111
@@ -125,6 +125,7 @@ def query_async(self, payload, cache=True, public=True, science=True,
125125

126126
url = urljoin(self._get_dataarchive_url(), 'aq/')
127127

128+
payload.update(kwargs)
128129
payload.update({'result_view': view_format, 'format': 'VOTABLE',
129130
'download': 'true'})
130131
if public:

docs/alma/alma.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ Region queries are just like any other in astroquery:
127127
>>> print(len(gc_data))
128128
383
129129
130+
Querying by other parameters
131+
============================
132+
133+
As of version 0.3.4, you can also query other fields by keyword. For example,
134+
if you want to find all projects with a particular PI, you could do:
135+
136+
.. code-block:: python
137+
138+
>>> rslt = Alma.query_object('W51', pi_name='Ginsburg', public=False)
139+
130140
Downloading Data
131141
================
132142

0 commit comments

Comments
 (0)