Skip to content

Commit bf85bb1

Browse files
tinuademargaretbsipocz
authored andcommitted
in progress
1 parent e274a2b commit bf85bb1

File tree

1 file changed

+54
-55
lines changed

1 file changed

+54
-55
lines changed

docs/alma/alma.rst

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. doctest-skip-all
2-
31
.. _astroquery.alma:
42

53
********************************
@@ -24,18 +22,15 @@ supports object and region based querying and data staging and retrieval.
2422
You can get interactive help to find out what keywords to query for:
2523

2624
.. code-block:: python
27-
28-
>>> from astroquery.alma import Alma
29-
>>> Alma.help()
30-
Most common ALMA query keywords are listed below. These keywords are part
31-
of the ALMA ObsCore model, an IVOA standard for metadata representation
32-
(3rd column). They were also present in original ALMA Web form and, for
33-
backwards compatibility can be accessed with their old names (2nd column).
34-
More elaborate queries on the ObsCore model are possible with `query_sia`
35-
or `query_tap` methods
36-
Description Original ALMA keyword ObsCore keyword
25+
.. doctest-remote-data::
26+
>>> from astroquery.alma import Alma
27+
>>> Alma.help()
28+
<BLANKLINE>
29+
Most common ALMA query keywords are listed below. These keywords are part of the ALMA ObsCore model, an IVOA standard for metadata representation (3rd column). They were also present in original ALMA Web form and, for backwards compatibility can be accessed with their old names (2nd column).
30+
More elaborate queries on the ObsCore model are possible with `query_sia` or `query_tap` methods
31+
Description Original ALMA keyword ObsCore keyword
3732
-------------------------------------------------------------------------------------------------------
38-
33+
<BLANKLINE>
3934
Position
4035
Source name (astropy Resolver) source_name_resolver SkyCoord.from_name
4136
Source name (ALMA) source_name_alma target_name
@@ -44,25 +39,25 @@ You can get interactive help to find out what keywords to query for:
4439
Angular resolution (arcsec) spatial_resolution spatial_resolution
4540
Largest angular scale (arcsec) spatial_scale_max spatial_scale_max
4641
Field of view (arcsec) fov s_fov
47-
42+
<BLANKLINE>
4843
Energy
4944
Frequency (GHz) frequency frequency
5045
Bandwidth (Hz) bandwidth bandwidth
5146
Spectral resolution (KHz) spectral_resolution em_resolution
5247
Band band_list band_list
53-
48+
<BLANKLINE>
5449
Time
5550
Observation date start_date t_min
5651
Integration time (s) integration_time t_exptime
57-
52+
<BLANKLINE>
5853
Polarization
59-
Polarisation type (Single, Dual, Full) polarisation_type pol_states
60-
54+
Polarisation type (Single, Dual, Full) polarisation_type pol_states
55+
<BLANKLINE>
6156
Observation
62-
Line sensitivity (10 km/s) (mJy/beam) line_sensitivity sensitivity_10kms
57+
Line sensitivity (10 km/s) (mJy/beam) line_sensitivity sensitivity_10kms
6358
Continuum sensitivity (mJy/beam) continuum_sensitivity cont_sensitivity_bandwidth
6459
Water vapour (mm) water_vapour pvw
65-
60+
<BLANKLINE>
6661
Project
6762
Project code project_code proposal_id
6863
Project title project_title obs_title
@@ -71,18 +66,24 @@ You can get interactive help to find out what keywords to query for:
7166
Project abstract project_abstract proposal_abstract
7267
Publication count publication_count NA
7368
Science keyword science_keyword science_keyword
74-
69+
<BLANKLINE>
7570
Publication
7671
Bibcode bibcode bib_reference
7772
Title pub_title pub_title
7873
First author first_author first_author
7974
Authors authors authors
8075
Abstract pub_abstract pub_abstract
8176
Year publication_year pub_year
82-
77+
<BLANKLINE>
8378
Options
8479
Public data only public_data data_rights
8580
Science observations only science_observations calib_level
81+
<BLANKLINE>
82+
Examples of queries:
83+
Alma.query('proposal_id':'2011.0.00131.S'}
84+
Alma.query({'band_list': ['5', '7']}
85+
Alma.query({'source_name_alma': 'GRB021004'})
86+
Alma.query(payload=dict(project_code='2017.1.01355.L', source_name_alma='G008.67'))
8687

8788
Authentication
8889
==============
@@ -91,14 +92,14 @@ Users can log in to acquire proprietary data products. Login is performed
9192
via the ALMA CAS (central authentication server).
9293

9394
.. code-block:: python
94-
95+
.. doctest-remote-data::
9596
>>> from astroquery.alma import Alma
9697
>>> alma = Alma()
9798
>>> # First example: TEST is not a valid username, it will fail
9899
>>> alma.login("TEST") # doctest: +SKIP
99100
TEST, enter your ALMA password:
100101

101-
Authenticating TEST on asa.alma.cl...
102+
Authenticating TEST on asa.alma.cl ...
102103
Authentication failed!
103104
>>> # Second example: pretend ICONDOR is a valid username
104105
>>> alma.login("ICONDOR", store_password=True) # doctest: +SKIP
@@ -124,27 +125,24 @@ Querying Targets and Regions
124125
You can query by object name or by circular region:
125126

126127
.. code-block:: python
127-
128+
.. doctest-remote-data::
128129
>>> from astroquery.alma import Alma
129130
>>> m83_data = Alma.query_object('M83')
130131
>>> print(len(m83_data))
131-
830
132+
352
132133
>>> m83_data.colnames
133-
['obs_publisher_did', 'obs_collection', 'facility_name', 'instrument_name',
134-
'obs_id', 'dataproduct_type', 'calib_level', 'target_name', 's_ra',
135-
's_dec', 's_fov', 's_region', 's_resolution', 't_min', 't_max',
136-
't_exptime', 't_resolution', 'em_min', 'em_max', 'em_res_power',
137-
'pol_states', 'o_ucd', 'access_url', 'access_format', 'proposal_id',
138-
'data_rights', 'gal_longitude', 'gal_latitude', 'band_list',
139-
'em_resolution', 'bandwidth', 'antenna_arrays', 'is_mosaic',
140-
'obs_release_date', 'spatial_resolution', 'frequency_support',
141-
'frequency', 'velocity_resolution', 'obs_creator_name', 'pub_title',
142-
'first_author', 'authors', 'pub_abstract', 'publication_year',
143-
'proposal_abstract', 'schedblock_name', 'proposal_authors',
144-
'sensitivity_10kms', 'cont_sensitivity_bandwidth', 'pwv', 'group_ous_uid',
145-
'member_ous_uid', 'asdm_uid', 'obs_title', 'type', 'scan_intent',
146-
'science_observation', 'spatial_scale_max', 'qa2_passed', 'bib_reference',
147-
'science_keyword', 'scientific_category', 'lastModified']
134+
['access_url', 'access_format', 'proposal_id', 'data_rights', 'gal_longitude',
135+
'gal_latitude', 'obs_publisher_did', 'obs_collection', 'facility_name',
136+
'instrument_name', 'obs_id', 'dataproduct_type', 'calib_level', 'target_name',
137+
's_ra', 's_dec', 's_fov', 's_region', 's_resolution', 't_min', 't_max', 't_exptime',
138+
't_resolution', 'em_min', 'em_max', 'em_res_power', 'pol_states', 'o_ucd', 'band_list',
139+
'em_resolution', 'authors', 'pub_abstract', 'publication_year', 'proposal_abstract',
140+
'schedblock_name', 'proposal_authors', 'sensitivity_10kms', 'cont_sensitivity_bandwidth',
141+
'pwv', 'group_ous_uid', 'member_ous_uid', 'asdm_uid', 'obs_title', 'type', 'scan_intent',
142+
'science_observation', 'spatial_scale_max', 'bandwidth', 'antenna_arrays', 'is_mosaic',
143+
'obs_release_date', 'spatial_resolution', 'frequency_support', 'frequency', 'velocity_resolution',
144+
'obs_creator_name', 'pub_title', 'first_author', 'qa2_passed', 'bib_reference', 'science_keyword',
145+
'scientific_category', 'lastModified']
148146

149147

150148
Please note that some of the column names are duplicated. First group of names
@@ -157,14 +155,14 @@ Region queries are just like any other in astroquery:
157155

158156

159157
.. code-block:: python
160-
158+
.. doctest-remote-data::
161159
>>> from astropy import coordinates
162160
>>> from astropy import units as u
163161
>>> galactic_center = coordinates.SkyCoord(0*u.deg, 0*u.deg,
164162
... frame='galactic')
165163
>>> gc_data = Alma.query_region(galactic_center, 1*u.deg)
166164
>>> print(len(gc_data))
167-
383
165+
24
168166

169167
Querying by other parameters
170168
============================
@@ -173,30 +171,31 @@ As of version 0.3.4, you can also query other fields by keyword. For example,
173171
if you want to find all projects with a particular PI, you could do:
174172

175173
.. code-block:: python
176-
174+
.. doctest-remote-data::
177175
>>> rslt = Alma.query_object('W51', pi_name='*Ginsburg*', public=False)
178176

179177
The ''query_sia'' method offers another way to query ALMA using the IVOA SIA
180178
subset of keywords returning results in 'ObsCore' format.
181179

182180
.. code-block:: python
183-
184-
>>> Alma.query_sia(query_sia(pol='XX'))
181+
.. doctest-remote-data::
182+
>>> # Alma.query_sia(pol='XX')
185183

186184
Finally, the ''query_tap'' method is the most general way of querying the ALMA
187185
metadata. This method is used to send queries to the service using the
188186
'ObsCore' columns as constraints. The returned result is also in 'ObsCore'
189187
format.
190188

191189
.. code-block:: python
190+
.. doctest-remote-data::
191+
>>> Alma.query_tap("select * from ivoa.obscore where target_name like '%M83%'") # doctest: +IGNORE_OUTPUT
192192

193-
>>> Alma.query_tap("select * from ivoa.obscore where target_name like '%M83%'")
194193

195194
Use the ''help_tap'' method to learn about the ALMA 'ObsCore' keywords and
196195
their types.
197196

198197
.. code-block:: python
199-
198+
.. doctest-remote-data::
200199
>>> Alma.help_tap()
201200
Table to query is "voa.ObsCore".
202201
For example: "select top 1 * from ivoa.ObsCore"
@@ -276,7 +275,7 @@ cycle 1 data sets tend to be >100 GB!
276275

277276

278277
.. code-block:: python
279-
278+
.. doctest-remote-data::
280279
>>> import numpy as np
281280
>>> uids = np.unique(m83_data['Member ous id'])
282281
>>> print(uids)
@@ -303,7 +302,7 @@ some of these files can be listed and accessed individually. To get information
303302
on the individual files:
304303

305304
.. code-block:: python
306-
305+
.. doctest-remote-data::
307306
>>> link_list = Alma.get_data_info(uids, expand_tarfiles=True)
308307
>>> len(link_list)
309308
>>> 50
@@ -314,15 +313,15 @@ directory is ``~/.astropy/cache/astroquery/Alma/``, but this can be changed by
314313
changing the ``cache_location`` variable:
315314

316315
.. code-block:: python
317-
316+
.. doctest-remote-data::
318317
>>> myAlma = Alma()
319318
>>> myAlma.cache_location = '/big/external/drive/'
320319
>>> myAlma.download_files(link_list, cache=True)
321320

322321
You can also do the downloading all in one step:
323322

324323
.. code-block:: python
325-
324+
.. doctest-remote-data::
326325
>>> myAlma.retrieve_data_from_uid(uids[0])
327326

328327
If you have huge files, sometimes the transfer fails, so you will need to
@@ -343,7 +342,7 @@ If you want just the QA2-produced FITS files, you can download the tarball,
343342
extract the FITS file, then delete the tarball:
344343

345344
.. code-block:: python
346-
345+
.. doctest-remote-data::
347346
>>> from astroquery.alma.core import Alma
348347
>>> from astropy import coordinates
349348
>>> from astropy import units as u
@@ -360,8 +359,8 @@ extract the FITS file, then delete the tarball:
360359
You might want to look at the READMEs from a bunch of files so you know what kind of S/N to expect:
361360

362361
.. code-block:: python
363-
364-
>>> filelist = Alma.download_and_extract_files(tarball_files['access_url'], regex='.*README$')
362+
.. doctest-remote-data::
363+
>>> filelist = Alma.download_and_extract_files(uid_url_table['URL'], regex='.*README$')
365364

366365

367366
Further Examples

0 commit comments

Comments
 (0)