diff --git a/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py b/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py index 3760b0ffa1..2863fbfe40 100644 --- a/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py +++ b/jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py @@ -41,6 +41,7 @@ def __init__(self, *args, **kwargs): self.table.headers_avail = ["Title", "Instrument", "DateObs", "URL"] self.table.headers_visible = ["Title", "Instrument", "DateObs"] + self._populate_url_only = False self.table.show_rowselect = True self.table.item_key = "URL" @@ -117,11 +118,18 @@ def vue_query_resource(self, *args, **kwargs): self.results_loading = False # Stop loading spinner try: + if self._populate_url_only: + self.table.headers_visible = ["URL"] + else: + self.table.headers_visible = ["Title", "Instrument", "DateObs"] for result in sia_results: - self.table.add_item({"Title": str(result.title), - "URL": str(result.getdataurl()), - "Instrument": str(result.instr), - "DateObs": str(result.dateobs)}) + if self._populate_url_only: + self.table.add_item({"URL": str(result.getdataurl())}) + else: + self.table.add_item({"Title": str(result.title), + "URL": str(result.getdataurl()), + "Instrument": str(result.instr), + "DateObs": str(result.dateobs)}) self.hub.broadcast(SnackbarMessage( f"{len(sia_results)} SIA results populated!", sender=self, color="success")) except Exception as e: @@ -134,9 +142,13 @@ def vue_load_selected_data(self,event): self.data_loading = True # Start loading spinner for entry in self.table.selected_rows: try: + if self._populate_url_only: + data_label = f"{self.source}_{self.resource_selected}_{entry['URL']}" + else: + data_label = f"{self.source}_{self.resource_selected}_{entry['Title']}" self.app._jdaviz_helper.load_data( fits.open(str(entry["URL"])), # Open URL as FITS object - data_label=f"{self.source}_{self.resource_selected}_{entry['Title']}") + data_label=data_label) except Exception as e: self.hub.broadcast(SnackbarMessage( f"Unable to load file to viewer: {entry['URL']}: {e}", sender=self, color="error"))