@@ -90,23 +90,24 @@ Authentication
90
90
Users can log in to acquire proprietary data products. Login is performed
91
91
via the ALMA CAS (central authentication server).
92
92
93
- .. code- block:: python
93
+ .. doctest- skip::
94
+
94
95
>> > from astroquery.alma import Alma
95
96
>> > alma = Alma()
96
97
>> > # First example: TEST is not a valid username, it will fail
97
- >> > alma.login(" TEST" ) # doctest: +SKIP
98
+ >> > alma.login(" TEST" )
98
99
TEST , enter your ALMA password:
99
-
100
+ < BLANKLINE >
100
101
Authenticating TEST on asa.alma.cl ...
101
102
Authentication failed!
102
103
>> > # Second example: pretend ICONDOR is a valid username
103
- >> > alma.login(" ICONDOR" , store_password = True ) # doctest: +SKIP
104
+ >> > alma.login(" ICONDOR" , store_password = True )
104
105
ICONDOR , enter your ALMA password:
105
-
106
+ < BLANKLINE >
106
107
Authenticating ICONDOR on asa.alma.cl...
107
108
Authentication successful!
108
109
>> > # After the first login, your password has been stored
109
- >> > alma.login(" ICONDOR" ) # doctest: +SKIP
110
+ >> > alma.login(" ICONDOR" )
110
111
Authenticating ICONDOR on asa.alma.cl...
111
112
Authentication successful!
112
113
@@ -126,7 +127,7 @@ You can query by object name or by circular region:
126
127
.. doctest- remote- data::
127
128
>> > from astroquery.alma import Alma
128
129
>> > m83_data = Alma.query_object(' M83' )
129
- >> > m83_data.colnames # doctest: +SKIP
130
+ >> > m83_data.colnames # doctest: +IGNORE_OUTPUT
130
131
[' obs_publisher_did' , ' obs_collection' , ' facility_name' , ' instrument_name' ,
131
132
' obs_id' , ' dataproduct_type' , ' calib_level' , ' target_name' , ' s_ra' ,
132
133
' s_dec' , ' s_fov' , ' s_region' , ' s_resolution' , ' t_min' , ' t_max' ,
@@ -153,12 +154,13 @@ Region queries are just like any other in astroquery:
153
154
>> > galactic_center = coordinates.SkyCoord(0 * u.deg, 0 * u.deg,
154
155
... frame = ' galactic' )
155
156
>> > gc_data = Alma.query_region(galactic_center, 1 * u.deg)
156
- >> > print (gc_data) # doctest: +IGNORE_OUTPUT
157
+ >> > print (gc_data) # doctest: +IGNORE_OUTPUT
157
158
obs_publisher_did obs_collection facility_name ... scientific_category lastModified
158
159
...
159
160
-------------------------- - -------------- ------------ - ... -------------------------- - ---------------------- -
160
161
ADS / JAO .ALMA # 2012.1.00133.S ALMA JAO ... ISM and star formation 2021-09-30T16:34:41.133
161
162
163
+
162
164
Querying by other parameters
163
165
============================
164
166
@@ -182,7 +184,7 @@ to run, it is just shown as an example):
182
184
183
185
.. code- block:: python
184
186
185
- >> > Alma.query_sia(pol = ' XX' ) # doctest: +SKIP
187
+ >> > Alma.query_sia(pol = ' XX' ) # doctest: +SKIP
186
188
187
189
Finally, the ' ' query_tap' ' method is the most general way of querying the ALMA
188
190
metadata. This method is used to send queries to the service using the
@@ -191,26 +193,31 @@ format.
191
193
192
194
.. code- block:: python
193
195
.. doctest- remote- data::
194
- >> > Alma.query_tap(" select * from ivoa.obscore where target_name like '%M83%'" ) # doctest: +IGNORE_OUTPUT
196
+
197
+ >> > Alma.query_tap(" select * from ivoa.obscore where target_name like '%M83%'" ) # doctest: +IGNORE_OUTPUT
195
198
< Table length = 364 >
196
- obs_publisher_did obs_collection facility_name ... science_keyword scientific_category lastModified
199
+ obs_publisher_did obs_collection facility_name ... scientific_category lastModified
197
200
...
198
- str33 str4 str3 ... str200 str200 object
199
- -------------------------- - -------------- ------------ - ... ------------------------------------------------------------------------------------ ---------------------- ---------------------- -
200
- ADS / JAO .ALMA # 2016.1.00164.S ALMA JAO ... Starbursts, star formation, Galaxy chemistry Active galaxies 2021-09-30T16:34:41.133
201
+ str33 str4 str3 ... str200 object
202
+ -------------------------- - -------------- ------------ - ... ---------------------- ---------------------- -
203
+ ADS / JAO .ALMA # 2016.1.00164.S ALMA JAO ... Active galaxies 2021-09-30T16:34:41.133
201
204
202
205
One can also query by keyword, spatial resolution, etc:
203
206
204
207
.. code- block:: python
205
208
.. doctest- remote- data::
206
- >> > Alma.query_tap(f " select * from ivoa.obscore WHERE spatial_resolution<=0.1 AND science_keyword in ('Disks around high-mass stars', 'Asymptotic Giant Branch (AGB) stars') AND science_observation='T' " ) # doctest: +IGNORE_OUTPUT
209
+
210
+ >> > Alma.query_tap(" select * from ivoa.obscore WHERE spatial_resolution<=0.1 AND science_keyword "
211
+ ... " in ('Disks around high-mass stars', 'Asymptotic Giant Branch (AGB) stars') "
212
+ ... " AND science_observation='T'" ) # doctest: +IGNORE_OUTPUT
207
213
208
214
209
215
Use the ' ' help_tap' ' method to learn about the ALMA ' ObsCore' keywords and
210
216
their types.
211
217
212
- .. code- block:: python
213
- >> > Alma.help_tap() # doctest: +REMOTE_DATA +IGNORE_OUTPUT
218
+ .. doctest- remote- data::
219
+
220
+ >> > Alma.help_tap() # doctest: +IGNORE_OUTPUT
214
221
Table to query is " voa.ObsCore" .
215
222
For example: " select top 1 * from ivoa.ObsCore"
216
223
The scheme of the table is as follows.
@@ -281,6 +288,7 @@ their types.
281
288
type char(16 * ) Type flags.
282
289
velocity_resolution double m/ s Estimated velocity resolution from all the spectral windows, from frequency resolution.
283
290
291
+
284
292
Downloading Data
285
293
================
286
294
@@ -294,11 +302,12 @@ are >100 GB!
294
302
>> > from astroquery.alma import Alma
295
303
>> > m83_data = Alma.query_object(' M83' )
296
304
>> > uids = np.unique(m83_data[' member_ous_uid' ])
297
- >> > print (uids) # doctest: +IGNORE_OUTPUT
305
+ >> > print (uids)
298
306
member_ous_uid
299
- ---------------------- -
300
- uid:// A001/ X11f/ X30
301
- uid:// A001/ X122/ Xf3
307
+ ---------------------- -
308
+ uid:// A001/ X11f/ X30
309
+ uid:// A001/ X122/ Xf3
310
+ ...
302
311
303
312
The new ```get_data_info``` method can be used to get information about the
304
313
data such as the file names, their urls, sizes etc (this method replaces
@@ -307,15 +316,17 @@ but is now deprecated):
307
316
308
317
.. code- block:: python
309
318
.. doctest- remote- data::
310
- >> > link_list = Alma.get_data_info(uids)
319
+
320
+ >> > link_list = Alma.get_data_info(uids[:3 ])
311
321
312
322
By default, ALMA data is delivered as tarball files. However, the content of
313
323
some of these files can be listed and accessed individually. To get information
314
324
on the individual files:
315
325
316
326
.. code- block:: python
317
327
.. doctest- remote- data::
318
- >> > link_list = Alma.get_data_info(uids, expand_tarfiles = True )
328
+
329
+ >> > link_list = Alma.get_data_info(uids[:3 ], expand_tarfiles = True )
319
330
320
331
You can then go on to download those files. The download will be cached so
321
332
that repeat queries of the same file will not re- download the data. The
@@ -324,15 +335,18 @@ be changed by changing the ``cache_location`` variable:
324
335
325
336
.. code- block:: python
326
337
.. doctest- remote- data::
327
- >> > myAlma = Alma() # doctest: +SKIP
328
- >> > myAlma.cache_location = ' /big/external/drive/' # doctest: +SKIP
329
- >> > myAlma.download_files(link_list, cache = True ) # doctest: +SKIP
338
+ .. doctest- skip::
339
+
340
+ >> > 1 / 0
341
+ >> > myAlma = Alma()
342
+ >> > myAlma.cache_location = ' /big/external/drive/'
343
+ >> > myAlma.download_files(link_list, cache = True )
330
344
331
345
You can also do the downloading all in one step:
332
346
333
347
.. code- block:: python
334
- .. doctest - remote - data::
335
- >> > myAlma.retrieve_data_from_uid(uids[0 ]) # doctest: +SKIP
348
+
349
+ >> > myAlma.retrieve_data_from_uid(uids[0 ]) # doctest: +SKIP
336
350
337
351
If you have huge files, sometimes the transfer fails, so you will need to
338
352
restart the download. By default, the module will resume downloading where the
@@ -342,7 +356,7 @@ download but will return useful information about the state of your downloads:
342
356
343
357
.. code- block:: python
344
358
345
- >> > myAlma.download_files(link_list, cache = True , verify_only = True )
359
+ >> > myAlma.download_files(link_list, cache = True , verify_only = True ) # doctest: +SKIP
346
360
347
361
348
362
Downloading FITS data
@@ -362,7 +376,7 @@ files:
362
376
>> > uid_url_table = Alma.get_data_info(result[' obs_id' ][0 ], expand_tarfiles = True )
363
377
>> > # downselect to just the FITSf files
364
378
>> > fits_urls = [url for url in uid_url_table[' access_url' ] if ' .fits' in url]
365
- >> > filelist = Alma.download_files(fits_urls[:5 ])
379
+ >> > filelist = Alma.download_files(fits_urls[:5 ]) # doctest: +SKIP
366
380
367
381
You might want to look at the READMEs from a bunch of files so you know what
368
382
kind of S/ N to expect:
@@ -371,14 +385,15 @@ kind of S/N to expect:
371
385
.. doctest- remote- data::
372
386
373
387
>> > readmes = [url for url in uid_url_table[' access_url' ] if ' README' in url]
374
- >> > filelist = Alma.download_files(readmes)
388
+ >> > filelist = Alma.download_files(readmes) # doctest: +IGNORE_OUTPUT
375
389
376
390
377
391
Further Examples
378
392
================
379
393
There are some nice examples of using the ALMA query tool in conjunction with other astroquery
380
394
tools in :doc:`../ gallery` , especially :ref:`gallery- almaskyview` .
381
395
396
+
382
397
Reference/ API
383
398
============ =
384
399
0 commit comments