@@ -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
353356You 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
361365Further Examples
0 commit comments