-
Notifications
You must be signed in to change notification settings - Fork 75
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
Footprints plugin #2341
Footprints plugin #2341
Conversation
4cfbbff
to
5e98f91
Compare
5e98f91
to
a61d36c
Compare
This looks great! I really like being able to add and configure as many footprints as I want, from all the instruments. A couple of picky details:
And a couple comments:
|
bc79cdf
to
e2ff232
Compare
Thanks for the feedback @melanieclarke
Fixed
Ah yes, I meant to clean that up after generalizing to all instruments and then forgot. Should be fixed now too, thanks!
I think this will be fixed by rebasing on top of #2326 - I'll rebase soon after I get test coverage up and confirm that is the case.
Ok, let me know if there's anything I can do to help! |
@kecnry - Perfect, thanks! For the NOVT display, it looks like it's a configuration issue. If I use the Imviz configuration without any customization, the footprints work fine. My footprints appear right on top of yours, with the same parameters, as they should! I'll sort out the config issue on my side. |
a7371b4
to
fa6f2e6
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2341 +/- ##
==========================================
+ Coverage 90.66% 90.71% +0.04%
==========================================
Files 153 157 +4
Lines 17576 17969 +393
==========================================
+ Hits 15935 16300 +365
- Misses 1641 1669 +28
☔ View full report in Codecov by Sentry. |
982134f
to
36e1e87
Compare
Few open questions to still consider during review:
|
I thought we agreed to bundle footprints data files and not rely on pysiaf at all? All we need is the vector points for polygons, no? |
We would also need a replacement for |
Just these 12 lines? I'd rather we bundle this and throw in the pysiaf license here as acknowledgment than requiring the whole package. v2d = v2 / 3600.0
v3d = v3 / 3600.0
# Get separate rotation matrices
mv2 = rotate(3, -v2d)
mv3 = rotate(2, v3d)
mra = rotate(3, ra)
mdec = rotate(2, -dec)
mpa = rotate(1, -pa)
# Combine as mra*mdec*mpa*mv3*mv2
m = np.dot(mv3, mv2)
m = np.dot(mpa, m)
m = np.dot(mdec, m)
m = np.dot(mra, m)
return m p.s. Do they mean "altitude" instead of "attitude"? |
* ability to set (and update) a list traitlet in the plugin which can then be used to control visibilities of UI elements, but also can be passed to the user API to disable access to those traitlets (or methods) * will also be useful in other plugins (especially plot options)
* directly from NOVT API docs
* currently with a fixed preset of apertures plotted
* no longer needed in this plugin now that instruments are all generalized to take the same input arguments. Will include as a separate PR to use elsewhere (or if/when this is extended to support more than just JWST instruments)
* fixes color reverting when renaming footprint * lcviz still needs callbacks AFTER the selection is changed
* decided to keep the plugin named "Footprints" for now so that it's more easily discoverable. But at least this way the API won't feel forced when we add more flexibility in the future.
* API calls to traitlets will now update in real-time (even if the plugin is closed) but just won't show the mark. Toggles to is_active will now only change the visibility (still could result in flickering for extreme browser throttling, but at least won't have expensive calls that would exaggerate the problem)
* especially useful with reference data changing since the defaults were set internally
(unless there is only a single image...)
bc65424
to
a2eed6e
Compare
That's a good point - right now I do this logic based on how many are in the app's data collection. Alternatively I guess we could have the viewer dropdown to filter based on the number loaded and the linking type, but maybe it makes more sense to push that down the road to the work to better support the pixel-linked case (which in turn is waiting on the rotation work to get merged which should simplify this greatly and probably would mean removing a lot of these guardrails anyways). If you're ok with that, I'll add a comment to that ticket 🐱 so that we can consider this case as well. |
If we're potentially removing guardrails later then I'd be fine with this case being future work, as long as you add the comment to the appropriate ticket. In that case, consider my already green review to be extra green. |
Yes, I think we definitely want to support the pixel-linking case better in the future, its just really not clear how to do so now in a way that will still be compatible with the ongoing rotation work, so I think for now very conservative guardrails make sense so that we can move forward with other planned work for this plugin, and I've added your and @pllim's comments so we make sure we support all (possible) use-cases for pixel-linking in a hopefully self-consistent and intuitive way down the road. Thanks everyone for the very useful thoughts and reviews! |
Description
IMPORTANT: this PR currently require
pysiaf
to be installed or the plugin is disabled. We may want to either remove this dependency entirely or make it an official dependency that is installed with jdaviz.This pull request implements a new plugin in Imviz to plot an arbitrary number of user-configured footprints from any JWST instrument, adapted from code written by @melanieclarke in https://github.com/spacetelescope/jwst_novt. In the future, this could easily be extended to other instruments or to a generic "overlays" or "regions" plugin.
Basic support for adding and customizing any number of footprints (NOTE some names have been changed to be more general with "overlay"/"preset" instead of "footprint"/"instrument"):
Screen.Recording.2023-08-04.at.2.16.46.PM.mov
Logic for handling multiple viewers:
Screen.Recording.2023-08-04.at.2.20.15.PM.mov
Handling lack of WCS and ability to recenter footprint:
Screen.Recording.2023-08-11.at.10.09.47.AM.mov
Footprints plugin docs
This PR also brings the
EditableSelectPluginComponent
(which allows the user to name/rename/add/delete an arbitrary number of footprint overlays) originally implemented in spacetelescope/lcviz#19 upstream into jdaviz,as well as implementing the concept of. spacetelescope/lcviz#36 will then update lcviz to depend on the implementation here so that we do not have two duplicate implementations.inapplicable_attrs
to use within the plugin user APIs (if we adopt this here, we could follow-up with improvements to plot options and other plugins where some traitlets are not always applicable)TODO
inapplicable_attrs
(or strip into separate PR since no longer needed now that all instruments are generalized and support the same input arguments)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.