Skip to content

Commit

Permalink
Get cloud URIs for HLSPs
Browse files Browse the repository at this point in the history
test case, changelog
  • Loading branch information
snbianco committed Nov 6, 2024
1 parent 30c69ee commit ed3bdff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ mast
- Present users with an error when nonexistent query criteria are used in ``mast.MastMissions`` query functions. [#3126]

- Present users with an error when nonexistent query criteria are used in ``mast.Catalogs.query_region`` and
``mast.Catalogs.query_object`` [#3126]
``mast.Catalogs.query_object``. [#3126]

- Handle HLSP data products in ``Observations.get_cloud_uris``. [#3126]

mpc
^^^
Expand Down
2 changes: 1 addition & 1 deletion astroquery/mast/tests/test_mast_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def test_get_cloud_uri(self, test_data_uri, expected_cloud_uri):
assert len(uri) > 0, f'Product for dataURI {test_data_uri} was not found in the cloud.'
assert uri == expected_cloud_uri, f'Cloud URI does not match expected. ({uri} != {expected_cloud_uri})'

@pytest.mark.parametrize("test_obs_id", ["25568122", "31411"])
@pytest.mark.parametrize("test_obs_id", ["25568122", "31411", "107604081"])
def test_get_cloud_uris(self, test_obs_id):
pytest.importorskip("boto3")

Expand Down
2 changes: 2 additions & 0 deletions astroquery/mast/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ def mast_relative_path(mast_uri):
path = path.lstrip("/mast/")
elif '/ps1/' in path:
path = path.replace("/ps1/", "panstarrs/ps1/public/")
elif 'hlsp' in path:
path = path.replace("/hlsp_local/public/", "mast/")

Check warning on line 198 in astroquery/mast/utils.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/utils.py#L197-L198

Added lines #L197 - L198 were not covered by tests
else:
path = path.lstrip("/")
result.append(path)
Expand Down

0 comments on commit ed3bdff

Please sign in to comment.