Skip to content

Commit 4d0ec25

Browse files
committed
add option in ALMA downloader to skip downloading and only do
verification
1 parent d17805e commit 4d0ec25

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

astroquery/alma/core.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,8 @@ def _HEADER_data_size(self, files):
685685
return data_sizes, totalsize.to(u.GB)
686686

687687
def download_files(self, files, savedir=None, cache=True,
688-
continuation=True, skip_unauthorized=True,):
688+
continuation=True, skip_unauthorized=True,
689+
verify_only=False):
689690
"""
690691
Given a list of file URLs, download them
691692
@@ -706,6 +707,10 @@ def download_files(self, files, savedir=None, cache=True,
706707
If you receive "unauthorized" responses for some of the download
707708
requests, skip over them. If this is False, an exception will be
708709
raised.
710+
verify_only : bool
711+
Option to go through the process of checking the files to see if
712+
they're the right size, but not actually download them. This
713+
option may be useful if a previous download run failed partway.
709714
"""
710715

711716
if self.USERNAME:
@@ -744,14 +749,15 @@ def download_files(self, files, savedir=None, cache=True,
744749
filename)
745750

746751
try:
747-
self._download_file(file_link,
748-
filename,
749-
timeout=self.TIMEOUT,
750-
auth=auth,
751-
cache=cache,
752-
method='GET',
753-
head_safe=False,
754-
continuation=continuation)
752+
if not verify_only:
753+
self._download_file(file_link,
754+
filename,
755+
timeout=self.TIMEOUT,
756+
auth=auth,
757+
cache=cache,
758+
method='GET',
759+
head_safe=False,
760+
continuation=continuation)
755761

756762
downloaded_files.append(filename)
757763
except requests.HTTPError as ex:

0 commit comments

Comments
 (0)