From 1dac5196f633aed37de583531fd7a5bca239da01 Mon Sep 17 00:00:00 2001 From: Jennifer Medina Date: Wed, 20 Oct 2021 00:54:57 -0400 Subject: [PATCH 1/2] fixing string formatting typos in download_hsc_spectra() --- astroquery/mast/collections.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/astroquery/mast/collections.py b/astroquery/mast/collections.py index eb9377aa8e..7c2377ed32 100644 --- a/astroquery/mast/collections.py +++ b/astroquery/mast/collections.py @@ -85,8 +85,7 @@ def query_region_async(self, coordinates, radius=0.2*u.deg, catalog="Hsc", E.g. when using a slow internet connection. page : int, optional Default None. - Can be used to override the default behavior of all results being returned to - obtain a specific page of results. + Can be used to override the default behavior of all results being returned to obtain a specific page of results. **kwargs Other catalog-specific keyword args. These can be found in the (service documentation)[https://mast.stsci.edu/api/v0/_services.html] @@ -466,9 +465,10 @@ def download_hsc_spectra(self, spectra, download_dir=None, cache=True, curl_flag if spec['SpectrumType'] < 2: data_url = f'https://hla.stsci.edu/cgi-bin/getdata.cgi?config=ops&dataset={spec["DatasetName"]}' else: - data_url = f'https://hla.stsci.edu/cgi-bin/ecfproxy?file_id=spec["DatasetName"].fits' + data_url = f'https://hla.stsci.edu/cgi-bin/ecfproxy?file_id={spec["DatasetName"]}.fits' - local_path = os.path.join(base_dir, "{spec['DatasetName']}.fits") + filename = spec['DatasetName'] + local_path = os.path.join(base_dir, f'{filename}.fits') status = "COMPLETE" msg = None From 03c8f7213177ab132962fa35d1411719d155688e Mon Sep 17 00:00:00 2001 From: Jennifer V Medina Date: Thu, 21 Oct 2021 13:05:39 -0400 Subject: [PATCH 2/2] Update astroquery/mast/collections.py Co-authored-by: Eero Vaher --- astroquery/mast/collections.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/astroquery/mast/collections.py b/astroquery/mast/collections.py index 7c2377ed32..39d66dbeff 100644 --- a/astroquery/mast/collections.py +++ b/astroquery/mast/collections.py @@ -467,8 +467,7 @@ def download_hsc_spectra(self, spectra, download_dir=None, cache=True, curl_flag else: data_url = f'https://hla.stsci.edu/cgi-bin/ecfproxy?file_id={spec["DatasetName"]}.fits' - filename = spec['DatasetName'] - local_path = os.path.join(base_dir, f'{filename}.fits') + local_path = os.path.join(base_dir, f'{spec["DatasetName"]}.fits') status = "COMPLETE" msg = None