Skip to content

Commit 332ac1f

Browse files
authored
Merge pull request #1994 from ceb8/spitzer_bug
MAST: Fixing Spitzer download bug
2 parents 7b63f54 + 3fe4824 commit 332ac1f

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ mast
4444
- Fixed error causing empty products passed to ``Observations.get_product_list()`` to yeild a
4545
non-empty result. [#1921]
4646
- Changed AWS cloud access from RequesterPays to anonymous acces [#1980]
47+
- Fixed error with download of Spitzer data [#1994]
4748

4849
esa/hubble
4950
^^^^^^^^^^

astroquery/mast/observations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def download_file(self, uri, local_path=None, base_url=None, cache=True, cloud_o
535535

536536
# create a local file path if none is input. Use current directory as default.
537537
if not local_path:
538-
filename = uri.rsplit('/', 1)[-1]
538+
filename = os.path.basename(uri)
539539
local_path = os.path.join(os.path.abspath('.'), filename)
540540

541541
# recreate the data_product key for cloud connection check
@@ -606,7 +606,7 @@ def _download_files(self, products, base_dir, cache=True, cloud_only=False,):
606606
local_path = os.path.join(base_dir, data_product['obs_collection'], data_product['obs_id'])
607607
if not os.path.exists(local_path):
608608
os.makedirs(local_path)
609-
local_path = os.path.join(local_path, data_product['productFilename'])
609+
local_path = os.path.join(local_path, os.path.basename(data_product['productFilename']))
610610

611611
# download the files
612612
status, msg, url = self.download_file(data_product["dataURI"], local_path=local_path,

docs/mast/mast.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
MAST Queries (`astroquery.mast`)
77
********************************
88

9-
.. raw:: html
10-
11-
<div class="service-status mast-survey" id="survey-banner" style="background-color: #C75109; border-color: #C75109; color: white; padding-top: 1rem; padding-bottom: 1rem; line-height: 30px; font-size: x-large; display: flex; margin-left: 0rem; margin-right: 0rem; margin-bottom: 1rem; margin-top: 1rem;"><span class="status-message" style="margin-left: 2rem; margin-right: 2rem;">The MAST team wants your feedback on the <a href="https://www.surveymonkey.com/r/mastportal" target="_blank" style="color: white; text-decoration: underline;">MAST Portal</a> and <a href="https://www.surveymonkey.com/r/mastcatalogs" target="_blank" style="color: white; text-decoration: underline;">MAST catalogs</a>. If you use either of these, please take five to ten minutes to fill out the linked survey(s). Thank you!</span></div>
12-
13-
149
Getting Started
1510
===============
1611

0 commit comments

Comments
 (0)