Skip to content

Commit 7785a12

Browse files
authored
Merge pull request #3294 from keflavich/alma_proprietary_doc
Add example of how to get non-public (proprietary) data
2 parents 97b7b8f + 4b0c754 commit 7785a12

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

astroquery/alma/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,11 @@ def query_async(self, payload, *, public=True, science=True,
594594
if science is not None:
595595
payload['science_observation'] = science
596596
if public is not None:
597+
if 'public_data' in kwargs:
598+
warnings.warn("Both public and public_data are set. "
599+
"The ``public`` kwarg takes precedence. "
600+
"If you want ``public_data`` to be respected, "
601+
"set ``public=None``.")
597602
payload['public_data'] = public
598603

599604
query = _gen_sql(payload)

docs/alma/alma.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,27 @@ or if you wanted all projects by a given PI:
178178
179179
>>> Alma.query(payload=dict(pi_name='Ginsburg, Adam'))
180180
181+
Querying For Proprietary Data
182+
-----------------------------
183+
184+
To query for proprietary (non-public) data, set ``public=False`` or ``public=None``.
185+
If you want to download the products, you need to first authenticate using the ``login`` method.
186+
187+
.. doctest-skip::
188+
189+
>>> from astroquery.alma import Alma
190+
>>> alma = Alma()
191+
>>> # First login to access proprietary data
192+
>>> alma.login("username") # Will prompt for password
193+
>>> # include both public and proprietary data using public=None
194+
>>> proprietary_data = alma.query(payload=dict(project_code='2017.1.01355.L', public=None))
195+
>>> # restrict to only proprietary data with public=False
196+
>>> only_proprietary = alma.query_region('W51', radius=25*u.arcmin, public=False)
197+
198+
Setting ``public=False`` will include only proprietary data, while
199+
``public=None`` will include both public and proprietary data.
200+
201+
181202
The ``query_sia`` method offers another way to query ALMA using the IVOA SIA
182203
subset of keywords returning results in 'ObsCore' format. For example,
183204
to query for all images that have ``'XX'`` polarization (note that this query is too large

0 commit comments

Comments
 (0)