Skip to content

Commit 7da77a3

Browse files
authored
Merge pull request #3010 from esdc-esac-esa-int/ESA_ehst_fix_get_datalabs
EHSTPCR-1181: fix for get_datalabs_path
2 parents e35220b + baa8a7c commit 7da77a3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ esa.hubble
219219

220220
- New method ``get_datalabs_path`` to return the complete path of a file in
221221
datalabs by combining the datalabs volume path with the path of the file
222-
in the table ehst.artifact [#2998]
222+
in the table ehst.artifact [#2998, #3010]
223223

224224
esa.jwst
225225
^^^^^^^^

astroquery/esa/hubble/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,10 @@ def get_datalabs_path(self, filename, default_volume=None):
10181018
The complete path of the file name in Datalabs
10191019
"""
10201020

1021+
# FITS files are always compressed
1022+
if filename.endswith('.fits'):
1023+
filename = f"{filename}.gz"
1024+
10211025
query = f"select file_path from ehst.artifact where file_name = '{filename}'"
10221026
job = self.query_tap(query=query)
10231027
if job is None:

astroquery/esa/hubble/tests/test_esa_hubble_remote.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ def test_retrieve_fits_from_program(self):
130130
folder=str(self.temp_folder_for_fits.name))
131131
assert len(os.listdir(self.temp_folder_for_fits.name)) > 0
132132

133-
def test_get_datalabs_path(self):
133+
def test_get_datalabs_path_image(self):
134134
result = esa_hubble.get_datalabs_path(filename='ib4x04ivq_flt.jpg', default_volume=None)
135135
assert result == '/data/user/hub_hstdata_i/i/b4x/04/ib4x04ivq_flt.jpg'
136+
137+
def test_get_datalabs_path_fits(self):
138+
result = esa_hubble.get_datalabs_path(filename='ib4x04ivq_flt.fits', default_volume=None)
139+
assert result == '/data/user/hub_hstdata_i/i/b4x/04/ib4x04ivq_flt.fits.gz'

0 commit comments

Comments
 (0)