Skip to content

Commit e06d5bb

Browse files
cam72cambsipocz
authored andcommitted
Update doc on weirdness with MAST HST URIs
1 parent 9fc3986 commit e06d5bb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

astroquery/mast/core.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,22 @@ def _download_from_s3(self, dataProduct, localPath, cache=True):
13311331
obs_id = dataProduct['obs_id']
13321332

13331333
obs_id = obs_id.lower()
1334+
1335+
# This next part is a bit funky. Let me explain why:
1336+
# We have 2 different possible URI schemes for HST:
1337+
# mast:HST/product/obs_id_filename.type (old style)
1338+
# mast:HST/product/obs_id/obs_id_filename.type (new style)
1339+
# The first scheme was developed thinking that the obs_id in the filename
1340+
# would *always* match the actual obs_id folder the file was placed in.
1341+
# Unfortunately this assumption was false.
1342+
# We have been trying to switch to the new uri scheme as it specifies the
1343+
# obs_id used in the folder path correctly.
1344+
# The cherry on top is that the obs_id in the new style URI is not always correct either!
1345+
# When we are looking up files we have some code which iterates through all of
1346+
# the possible permutations of the obs_id's last char which can be *ANYTHING*
1347+
#
1348+
# So in conclusion we can't trust the last char obs_id from the file or from the database
1349+
# So with that in mind, hold your nose when reading the following:
13341350

13351351
# magic associations logic per Brian - 0-9/a-e we convert to 0
13361352
magicValues = "123456789abcde"

0 commit comments

Comments
 (0)