@@ -90,23 +90,24 @@ Authentication
9090Users can log in to acquire proprietary data products. Login is performed
9191via the ALMA CAS (central authentication server).
9292
93- .. code- block:: python
93+ .. doctest- skip::
94+
9495 >> > from astroquery.alma import Alma
9596 >> > alma = Alma()
9697 >> > # First example: TEST is not a valid username, it will fail
97- >> > alma.login(" TEST" ) # doctest: +SKIP
98+ >> > alma.login(" TEST" )
9899 TEST , enter your ALMA password:
99-
100+ < BLANKLINE >
100101 Authenticating TEST on asa.alma.cl ...
101102 Authentication failed!
102103 >> > # Second example: pretend ICONDOR is a valid username
103- >> > alma.login(" ICONDOR" , store_password = True ) # doctest: +SKIP
104+ >> > alma.login(" ICONDOR" , store_password = True )
104105 ICONDOR , enter your ALMA password:
105-
106+ < BLANKLINE >
106107 Authenticating ICONDOR on asa.alma.cl...
107108 Authentication successful!
108109 >> > # After the first login, your password has been stored
109- >> > alma.login(" ICONDOR" ) # doctest: +SKIP
110+ >> > alma.login(" ICONDOR" )
110111 Authenticating ICONDOR on asa.alma.cl...
111112 Authentication successful!
112113
@@ -126,7 +127,7 @@ You can query by object name or by circular region:
126127.. doctest- remote- data::
127128 >> > from astroquery.alma import Alma
128129 >> > m83_data = Alma.query_object(' M83' )
129- >> > m83_data.colnames # doctest: +SKIP
130+ >> > m83_data.colnames # doctest: +IGNORE_OUTPUT
130131 [' obs_publisher_did' , ' obs_collection' , ' facility_name' , ' instrument_name' ,
131132 ' obs_id' , ' dataproduct_type' , ' calib_level' , ' target_name' , ' s_ra' ,
132133 ' 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:
153154 >> > galactic_center = coordinates.SkyCoord(0 * u.deg, 0 * u.deg,
154155 ... frame = ' galactic' )
155156 >> > gc_data = Alma.query_region(galactic_center, 1 * u.deg)
156- >> > print (gc_data) # doctest: +IGNORE_OUTPUT
157+ >> > print (gc_data) # doctest: +IGNORE_OUTPUT
157158 obs_publisher_did obs_collection facility_name ... scientific_category lastModified
158159 ...
159160 -------------------------- - -------------- ------------ - ... -------------------------- - ---------------------- -
160161 ADS / JAO .ALMA # 2012.1.00133.S ALMA JAO ... ISM and star formation 2021-09-30T16:34:41.133
161162
163+
162164Querying by other parameters
163165============================
164166
@@ -182,7 +184,7 @@ to run, it is just shown as an example):
182184
183185.. code- block:: python
184186
185- >> > Alma.query_sia(pol = ' XX' ) # doctest: +SKIP
187+ >> > Alma.query_sia(pol = ' XX' ) # doctest: +SKIP
186188
187189Finally, the ' ' query_tap' ' method is the most general way of querying the ALMA
188190metadata. This method is used to send queries to the service using the
@@ -191,26 +193,31 @@ format.
191193
192194.. code- block:: python
193195.. 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
195198 < 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
197200 ...
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
201204
202205One can also query by keyword, spatial resolution, etc:
203206
204207.. code- block:: python
205208.. 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
207213
208214
209215Use the ' ' help_tap' ' method to learn about the ALMA ' ObsCore' keywords and
210216their types.
211217
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
214221 Table to query is " voa.ObsCore" .
215222 For example: " select top 1 * from ivoa.ObsCore"
216223 The scheme of the table is as follows.
@@ -281,6 +288,7 @@ their types.
281288 type char(16 * ) Type flags.
282289 velocity_resolution double m/ s Estimated velocity resolution from all the spectral windows, from frequency resolution.
283290
291+
284292Downloading Data
285293================
286294
@@ -294,11 +302,12 @@ are >100 GB!
294302 >> > from astroquery.alma import Alma
295303 >> > m83_data = Alma.query_object(' M83' )
296304 >> > uids = np.unique(m83_data[' member_ous_uid' ])
297- >> > print (uids) # doctest: +IGNORE_OUTPUT
305+ >> > print (uids)
298306 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+ ...
302311
303312The new ```get_data_info``` method can be used to get information about the
304313data such as the file names, their urls, sizes etc (this method replaces
@@ -307,15 +316,17 @@ but is now deprecated):
307316
308317.. code- block:: python
309318.. doctest- remote- data::
310- >> > link_list = Alma.get_data_info(uids)
319+
320+ >> > link_list = Alma.get_data_info(uids[:3 ])
311321
312322By default, ALMA data is delivered as tarball files. However, the content of
313323some of these files can be listed and accessed individually. To get information
314324on the individual files:
315325
316326.. code- block:: python
317327.. 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 )
319330
320331You can then go on to download those files. The download will be cached so
321332that 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:
324335
325336.. code- block:: python
326337.. 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 )
330344
331345You can also do the downloading all in one step:
332346
333347.. 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
336350
337351If you have huge files, sometimes the transfer fails, so you will need to
338352restart 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:
342356
343357.. code- block:: python
344358
345- >> > myAlma.download_files(link_list, cache = True , verify_only = True )
359+ >> > myAlma.download_files(link_list, cache = True , verify_only = True ) # doctest: +SKIP
346360
347361
348362Downloading FITS data
@@ -362,7 +376,7 @@ files:
362376 >> > uid_url_table = Alma.get_data_info(result[' obs_id' ][0 ], expand_tarfiles = True )
363377 >> > # downselect to just the FITSf files
364378 >> > 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
366380
367381You might want to look at the READMEs from a bunch of files so you know what
368382kind of S/ N to expect:
@@ -371,14 +385,15 @@ kind of S/N to expect:
371385.. doctest- remote- data::
372386
373387 >> > 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
375389
376390
377391Further Examples
378392================
379393There are some nice examples of using the ALMA query tool in conjunction with other astroquery
380394tools in :doc:`../ gallery` , especially :ref:`gallery- almaskyview` .
381395
396+
382397Reference/ API
383398============ =
384399
0 commit comments