Skip to content

Commit 0c752a0

Browse files
keflavichbsipocz
authored andcommitted
WIP cont'd: query a less dense region, fix some non-functional
(nonsense?) examples
1 parent fb55541 commit 0c752a0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docs/alma/alma.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,22 +340,26 @@ extract the FITS file, then delete the tarball:
340340
>>> from astroquery.alma.core import Alma
341341
>>> from astropy import coordinates
342342
>>> from astropy import units as u
343-
>>> orionkl = coordinates.SkyCoord('5:35:14.461 -5:21:54.41', frame='fk5',
344-
... unit=(u.hour, u.deg))
345-
>>> result = Alma.query_region(orionkl, radius=0.034*u.deg)
346-
>>> uid_url_table = Alma.get_data_info(result['obs_id'])
343+
>>> s255ir = coordinates.SkyCoord(93.26708333, 17.97888889, frame='fk5',
344+
... unit=(u.deg, u.deg))
345+
>>> result = Alma.query_region(s255ir, radius=0.034*u.deg)
346+
>>> uid_url_table = Alma.get_data_info(result['obs_id'][0])
347347
>>> # Extract the data with tarball file size < 1GB
348348
>>> small_uid_url_table = uid_url_table[uid_url_table['content_length'] < 10**9]
349-
>>> # get the first 10 files...
349+
>>> # get the first 3 files...
350350
>>> tarball_files = uid_url_table[uid_url_table['content_type'] == 'application/x-tar']
351-
>>> filelist = Alma.download_and_extract_files(tarball_files[1:10]['access_url'])
351+
>>> # sort so we only have to download smaller files for this example
352+
>>> tarball_files.sort('content_length')
353+
>>> # this will download a big file or few
354+
>>> # filelist = Alma.download_files(tarball_files['access_url'])
352355
353356
You might want to look at the READMEs from a bunch of files so you know what kind of S/N to expect:
354357
355358
.. code-block:: python
356359
.. doctest-remote-data::
357360
358-
>>> filelist = Alma.download_and_extract_files(uid_url_table['URL'], regex='.*README$') # doctest: +IGNORE_OUTPUT
361+
>>> readmes = [url for url in uid_url_table['access_url'] if 'README' in url]
362+
>>> filelist = Alma.download_files(readmes[:2])
359363
360364
361365
Further Examples

0 commit comments

Comments
 (0)