Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lightkurve/lksearch into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerapritchard committed Jan 12, 2025
2 parents 83ba6c7 + 6598327 commit 1c5eb36
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/lksearch/MASTSearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ def uris(self):
uris = self.table["dataURI"].values

if conf.PREFER_CLOUD:
# Could optionally suppress warnings for no cloud data. Leave for now
# with warnings.catch_warnings():
# warnings.filterwarnings("ignore", category=NoResultsWarning)
cloud_uris = self.cloud_uris
mask = cloud_uris is not None
mask = pd.notna(cloud_uris)
uris[mask] = cloud_uris[mask]

return uris
Expand Down Expand Up @@ -534,10 +537,14 @@ def _add_s3_url_column(self, joint_table: pd.DataFrame) -> pd.DataFrame:
logging.getLogger("astroquery").setLevel(log.getEffectiveLevel())

Observations.enable_cloud_dataset()
cloud_uris = Observations.get_cloud_uris(
Table.from_pandas(joint_table.loc[pd.notna(joint_table["dataURI"])]),
full_url=True,
)

cloud_uris = [
Observations.get_cloud_uris(
Table.from_pandas(joint_table[ii : ii + 1]), full_url=True
)[0]
for ii in joint_table.loc[pd.notna(joint_table["dataURI"])].index
]

joint_table.loc[pd.notna(joint_table["dataURI"]), "cloud_uri"] = cloud_uris
return joint_table

Expand Down

0 comments on commit 1c5eb36

Please sign in to comment.