-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual Observatory plugin for Jdaviz #2872
base: main
Are you sure you want to change the base?
Conversation
ea36f51
to
cd73c0e
Compare
…lect source before resource, add manual coordinate toggle to viewer dropdown
…istry calls while typing the source name
Sorry, I just reread your previous message. I do not want to block the user from loading data. I just want to warn them that they will not see the images aligned if they do not link by WCS. |
@camipacifici I just pushed up 10d712d which provides a warning when:
On point 2, I figured a warning about misaligned data would be nonsensical if there's only one dataset total (the one the user is loading). Give it a try and see if it's the behavior you're expecting. Thanks! |
TEST: Combine load_data error test to main load_data test
Hi Cami, On the smaller points, I pushed up a change that should fix the "hanging" issue. I forcibly stopped the plugin whenever a load data error occurred, but forgot to properly clear the loading flag. Instead, now a load_data error should not stop the plugin; it will notify via snackbar message and then move on to other selected files. On the lack of linking error message, that one concerns me; let me explicitly spell out what conditions it should hit and you let me know which path you were in, or if you hit a case I'm not covering:
I have a test that checks for these conditions in CI, which is passing, so I'm concerned you may have found a scenario I'm not covering for. If you are in one of the above, could you detail what was in your data_collection when you tried to download from the VO, and were expecting the warning? Lastly, SkyView is down at the moment due to a storage system error so I'll test your other error message once it comes back online. Thanks! |
Hi Cami! Now that SkyView is back up I was able to start debugging your aforementioned issue. In short, I did get an error, but it was a download timeout error, not the
|
jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py
Outdated
Show resolved
Hide resolved
Hi @camipacifici! I've implemented basic versions of the two requests you had:
NOTE: I have a pyvo PR There are still nice-to-haves I'd like to add when I have a chance, such as detecting when the coordinates pulled are out of date (probably by changing the color of the centering icon), but hopefully this increment gives you enough to try out the behavior. Let me know your thoughts! |
Hi @camipacifici! Another quick update. So... I know we were concerned about the performance of auto-updating coordinates during pan-zoom, but I was curious and went ahead and implemented it anyways to see how it would perform. Surprisingly, it does quite well! Any lag I feel doesn't seem to get worse if I enable the "following" switch (alternatively, I don't see a lag improvement when I disable the toggle): Please try it out and see how it performs on your side! I feel like it massively improves the user experience in searching for coordinates, but if it doesn't work for you, I can always remove it. Thanks! |
Taking a quick look at the screenshots, if the two hover texts are for the different layers, they look the same to me; it appears somehow the two copies got added with the same name some how. I'll try to reproduce and see how the data label is being applied; I could have sworn when a data label already exists, Jdaviz automatically appends a |
Careful, they are not the same. One is gsd04 and one is gsd12_sect32. |
Hmm, no idea then! I'll poke around and see if I find anything |
from pyvo.utils import vocabularies | ||
from pyvo import registry | ||
from pyvo.dal.exceptions import DALFormatError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is pyvo considered a dependency (should be added to pyproject.toml) or optional (try/except on the import and then set a disabled message on the plugin instructing to install pyvo in order to use the plugin)?
Either way, should merging this be blocked waiting for the 1.6 release of pyvo or is it partially functional without?
@@ -39,7 +39,7 @@ | |||
</template> | |||
</v-select> | |||
</div> | |||
<div style="line-height: 64px; width=32px" class="only-show-in-tray"> | |||
<div style="line-height: 64px; width:32px" class="only-show-in-tray"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! 😬
<div style="line-height: 64px; width:32px" class="only-show-in-tray"> | |
<div style="line-height: 64px; width: 32px" class="only-show-in-tray"> |
self.wavebands = [ | ||
w.lower() for w in vocabularies.get_vocabulary("messenger")["terms"] | ||
] | ||
self.waveband_selected = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this use a SelectPluginComponent
?
# Check mixin object initialized | ||
if hasattr(self, "viewer"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elsewhere we do the following instead which might help readability (whitespace after this will also need updating):
# Check mixin object initialized | |
if hasattr(self, "viewer"): | |
# Check mixin object initialized | |
if not hasattr(self, "viewer"): | |
return |
for viewer in self.viewer.viewers: | ||
if viewer == self.viewer.selected_obj: | ||
viewer.state.add_callback("zoom_center_x", self.vue_center_on_data) | ||
viewer.state.add_callback("zoom_center_y", self.vue_center_on_data) | ||
else: | ||
# If not subscribed anyways, remove_callback should produce a no-op | ||
viewer.state.remove_callback( | ||
"zoom_center_x", self.vue_center_on_data | ||
) | ||
viewer.state.remove_callback( | ||
"zoom_center_y", self.vue_center_on_data | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this just use the new/old information in the event instead of looping through everything?
viewer.state.remove_callback( | ||
"zoom_center_y", self.vue_center_on_data | ||
) | ||
self.vue_center_on_data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want this regardless of coord_follow_viewer_pan
? If so, can you please add an inline comment why its here?
# Reset Table | ||
self.table.items = [] | ||
self._populate_url_only = False | ||
self.table.headers_visible = ["Title", "Instrument", "DateObs"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this wait until we know it will be successful? Otherwise any exception will leave the table reset (or maybe that makes sense).
self._populate_url_only = False | ||
self.table.headers_visible = ["Title", "Instrument", "DateObs"] | ||
|
||
self.results_loading = True # Start loading spinner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above - could use with_spinner
decorator.
except Exception: | ||
try: | ||
# If that didn't work, try parsing it as an object name | ||
coord = SkyCoord.from_name( | ||
self.source, frame=self.coordframe_selected | ||
) | ||
except Exception: | ||
raise LookupError( | ||
f"Unable to resolve source coordinates: {self.source}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above - are there specific exceptions we can catch?
v-model="radius_unit_selected" | ||
attach | ||
:items="radius_unit_items.map(i => i.label)" | ||
label="Unit"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-model="radius_unit_selected" | |
attach | |
:items="radius_unit_items.map(i => i.label)" | |
label="Unit"> | |
v-model="radius_unit_selected" | |
attach | |
:items="radius_unit_items.map(i => i.label)" | |
label="Unit"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing there aren't any actual changes here - can this be removed from the diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more comments from testing the plugin itself - overall this seems to have a lot of edge cases covered and a lot of UI-polish, most of my comments are related to tooltips and using some re-usable components that now exist in jdaviz so that we have consistent styling.
<v-btn | ||
id="querybtn" | ||
@click="query_registry_resources" | ||
icon | ||
:loading="resources_loading"> | ||
<v-icon>mdi-refresh</v-icon> | ||
</v-btn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this button could use a tooltip. Is there anytime its useful to trigger this manually since it seems to automatically update when changing waveband?
<div style="border: 1px solid gray;" class="pa-2"> | ||
<strong>Note:</strong> | ||
Surveys which have not implemented coverage information will also be excluded. If you are expecting a survey that doesn't appear, try disabling coverage filtering. | ||
</div>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this have a max-width or something set? Right now this results in an extremely wide tooltip which might not fit at smaller resolutions, etc.
<v-btn | ||
id="autocenterbtn" | ||
@click="center_on_data" | ||
:disabled="viewer_centered" | ||
icon> | ||
<v-icon> | ||
{{ viewer_centered ? 'mdi-crosshairs-gps' : 'mdi-crosshairs' }} | ||
</v-icon> | ||
</v-btn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without a label, this would benefit from a tooltip
<v-row class="row-no-outside-padding"> | ||
<v-col> | ||
<v-btn | ||
block | ||
color="primary" | ||
:loading="results_loading" | ||
:disabled="!all_fields_filled" | ||
text | ||
@click="query_resource">Query Archive</v-btn> | ||
</v-col> | ||
</v-row> | ||
|
||
<jupyter-widget :widget="table_widget"></jupyter-widget> | ||
|
||
<v-row class="row-no-outside-padding"> | ||
<v-col> | ||
<v-btn color="primary" :loading="data_loading" text @click="load_selected_data">Load Data</v-btn> | ||
</v-col> | ||
</v-row> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these use plugin-action-button
which should also provide consistent styling/layout (right now the first button takes the full width due to block
while the second does not and is right-aligned)?
></v-select> | ||
</v-row> | ||
|
||
<j-plugin-section-header>Common Options</j-plugin-section-header> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there room in the future for more in this section or will it remain just the search radius? Maybe the header can either be more specific ("search radius/terms") or the section just removed and search criteria lumped in with source selection?
<j-tooltip tipid='plugin-vo-filter-coverage'> | ||
<span> | ||
<v-btn icon @click.stop="resource_filter_coverage = !resource_filter_coverage"> | ||
<v-icon>mdi-filter{{ resource_filter_coverage ? '' : '-remove' }}</v-icon> | ||
</v-btn> | ||
Filter by Coverage | ||
</span> | ||
</j-tooltip> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should just be a switch instead so that there is no ambiguity about whether its enabled or not.
Description
NOTE: This PR depends on https://github.com/astropy/pyvo/tree/main until it is released with the changes introduced in astropy/pyvo#594
This PR introduces a new plugin to query resources and load data products published by collaborators of the International Virtual Observatory Alliance. This Plugin currently queries resources implementing the original 1.0 version of the Simple Image Access protocol by specifying a source and a waveband and loads the selected products into Imviz. Though currently only implemented into Imviz, I placed this plugin into the
default
config in hopes this plugin can be expanded to also work for Specviz via the Simple Spectrum Access Protocol, and Cubeviz as well. Documentation and Unit Tests have been implemented, and this is formally ready to review!Additionally, I placed the VO plugin closer to the top mainly for my own testing, but also because loading data generally occurs before data analysis. Feel free to adjust the location of the plugin within the plugin bar to your liking.
Thanks for your inputs/help getting us this far! We at the HEASARC hope this is a useful contribution to the Jdaviz tool and community :)
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.