1
- .. doctest-skip-all
2
-
3
1
.. _astroquery.alma :
4
2
5
3
********************************
@@ -24,18 +22,15 @@ supports object and region based querying and data staging and retrieval.
24
22
You can get interactive help to find out what keywords to query for:
25
23
26
24
.. 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
37
32
-------------------------------------------------------------------------------------------------------
38
-
33
+ <BLANKLINE>
39
34
Position
40
35
Source name (astropy Resolver) source_name_resolver SkyCoord.from_name
41
36
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:
44
39
Angular resolution (arcsec) spatial_resolution spatial_resolution
45
40
Largest angular scale (arcsec) spatial_scale_max spatial_scale_max
46
41
Field of view (arcsec) fov s_fov
47
-
42
+ <BLANKLINE>
48
43
Energy
49
44
Frequency (GHz) frequency frequency
50
45
Bandwidth (Hz) bandwidth bandwidth
51
46
Spectral resolution (KHz) spectral_resolution em_resolution
52
47
Band band_list band_list
53
-
48
+ <BLANKLINE>
54
49
Time
55
50
Observation date start_date t_min
56
51
Integration time (s) integration_time t_exptime
57
-
52
+ <BLANKLINE>
58
53
Polarization
59
- Polarisation type (Single, Dual, Full) polarisation_type pol_states
60
-
54
+ Polarisation type (Single, Dual, Full) polarisation_type pol_states
55
+ <BLANKLINE>
61
56
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
63
58
Continuum sensitivity (mJy/beam) continuum_sensitivity cont_sensitivity_bandwidth
64
59
Water vapour (mm) water_vapour pvw
65
-
60
+ <BLANKLINE>
66
61
Project
67
62
Project code project_code proposal_id
68
63
Project title project_title obs_title
@@ -71,18 +66,24 @@ You can get interactive help to find out what keywords to query for:
71
66
Project abstract project_abstract proposal_abstract
72
67
Publication count publication_count NA
73
68
Science keyword science_keyword science_keyword
74
-
69
+ <BLANKLINE>
75
70
Publication
76
71
Bibcode bibcode bib_reference
77
72
Title pub_title pub_title
78
73
First author first_author first_author
79
74
Authors authors authors
80
75
Abstract pub_abstract pub_abstract
81
76
Year publication_year pub_year
82
-
77
+ <BLANKLINE>
83
78
Options
84
79
Public data only public_data data_rights
85
80
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'))
86
87
87
88
Authentication
88
89
==============
@@ -91,14 +92,14 @@ Users can log in to acquire proprietary data products. Login is performed
91
92
via the ALMA CAS (central authentication server).
92
93
93
94
.. code-block :: python
94
-
95
+ .. doctest-remote-data ::
95
96
>>> from astroquery.alma import Alma
96
97
>>> alma = Alma()
97
98
>>> # First example: TEST is not a valid username, it will fail
98
99
>>> alma.login(" TEST" ) # doctest: +SKIP
99
100
TEST, enter your ALMA password:
100
101
101
- Authenticating TEST on asa.alma.cl...
102
+ Authenticating TEST on asa.alma.cl ...
102
103
Authentication failed!
103
104
>>> # Second example: pretend ICONDOR is a valid username
104
105
>>> alma.login(" ICONDOR" , store_password = True ) # doctest: +SKIP
@@ -124,27 +125,24 @@ Querying Targets and Regions
124
125
You can query by object name or by circular region:
125
126
126
127
.. code-block :: python
127
-
128
+ .. doctest-remote-data ::
128
129
>>> from astroquery.alma import Alma
129
130
>>> m83_data = Alma.query_object(' M83' )
130
131
>>> print (len (m83_data))
131
- 830
132
+ 352
132
133
>>> 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']
148
146
149
147
150
148
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:
157
155
158
156
159
157
.. code-block :: python
160
-
158
+ .. doctest-remote-data ::
161
159
>>> from astropy import coordinates
162
160
>>> from astropy import units as u
163
161
>>> galactic_center = coordinates.SkyCoord(0 * u.deg, 0 * u.deg,
164
162
... frame= ' galactic' )
165
163
>>> gc_data = Alma.query_region(galactic_center, 1 * u.deg)
166
164
>>> print (len (gc_data))
167
- 383
165
+ 24
168
166
169
167
Querying by other parameters
170
168
============================
@@ -173,30 +171,31 @@ As of version 0.3.4, you can also query other fields by keyword. For example,
173
171
if you want to find all projects with a particular PI, you could do:
174
172
175
173
.. code-block :: python
176
-
174
+ .. doctest-remote-data ::
177
175
>>> rslt = Alma.query_object(' W51' , pi_name = ' *Ginsburg*' , public = False )
178
176
179
177
The ''query_sia'' method offers another way to query ALMA using the IVOA SIA
180
178
subset of keywords returning results in 'ObsCore' format.
181
179
182
180
.. code-block :: python
183
-
184
- >> > Alma.query_sia(query_sia( pol = ' XX' ) )
181
+ .. doctest-remote-data ::
182
+ >>> # Alma.query_sia(pol='XX')
185
183
186
184
Finally, the ''query_tap'' method is the most general way of querying the ALMA
187
185
metadata. This method is used to send queries to the service using the
188
186
'ObsCore' columns as constraints. The returned result is also in 'ObsCore'
189
187
format.
190
188
191
189
.. code-block :: python
190
+ .. doctest-remote-data ::
191
+ >>> Alma.query_tap(" select * from ivoa.obscore where target_name like '%M83%'" ) # doctest: +IGNORE_OUTPUT
192
192
193
- >> > Alma.query_tap(" select * from ivoa.obscore where target_name like '%M83%'" )
194
193
195
194
Use the ''help_tap'' method to learn about the ALMA 'ObsCore' keywords and
196
195
their types.
197
196
198
197
.. code-block :: python
199
-
198
+ .. doctest-remote-data ::
200
199
>>> Alma.help_tap()
201
200
Table to query is "voa.ObsCore".
202
201
For example: "select top 1 * from ivoa.ObsCore"
@@ -276,7 +275,7 @@ cycle 1 data sets tend to be >100 GB!
276
275
277
276
278
277
.. code-block :: python
279
-
278
+ .. doctest-remote-data ::
280
279
>>> import numpy as np
281
280
>>> uids = np.unique(m83_data[' Member ous id' ])
282
281
>>> print (uids)
@@ -303,7 +302,7 @@ some of these files can be listed and accessed individually. To get information
303
302
on the individual files:
304
303
305
304
.. code-block :: python
306
-
305
+ .. doctest-remote-data ::
307
306
>>> link_list = Alma.get_data_info(uids, expand_tarfiles = True )
308
307
>>> len (link_list)
309
308
>>> 50
@@ -314,15 +313,15 @@ directory is ``~/.astropy/cache/astroquery/Alma/``, but this can be changed by
314
313
changing the ``cache_location `` variable:
315
314
316
315
.. code-block :: python
317
-
316
+ .. doctest-remote-data ::
318
317
>>> myAlma = Alma()
319
318
>>> myAlma.cache_location = ' /big/external/drive/'
320
319
>>> myAlma.download_files(link_list, cache = True )
321
320
322
321
You can also do the downloading all in one step:
323
322
324
323
.. code-block :: python
325
-
324
+ .. doctest-remote-data ::
326
325
>>> myAlma.retrieve_data_from_uid(uids[0 ])
327
326
328
327
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,
343
342
extract the FITS file, then delete the tarball:
344
343
345
344
.. code-block :: python
346
-
345
+ .. doctest-remote-data ::
347
346
>>> from astroquery.alma.core import Alma
348
347
>>> from astropy import coordinates
349
348
>>> from astropy import units as u
@@ -360,8 +359,8 @@ extract the FITS file, then delete the tarball:
360
359
You might want to look at the READMEs from a bunch of files so you know what kind of S/N to expect:
361
360
362
361
.. 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$' )
365
364
366
365
367
366
Further Examples
0 commit comments