-
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
Reproject plugin for Imviz #1949
Conversation
Oh, apologies. I did not see the blocker. I will try with a non-gwcs image. |
It should eventually autoload if you wait for it to finish. But if you do something else while it is not done, the callback might be cancelled or something, not sure (it did auto display for me). Like I said, there is a serious performance issue because reprojection is not meant to be some instant on-the-fly visualization; it is very calculation intensive (albeit an one-time overhead but after that it eats the memory). |
I played a bit with this and here are some thoughts in random order:
@orifox @astrofrog thoughts? |
Sure, but Imviz loads the GWCS when it is available. To ask Imviz to use the FITS WCS version is not possible right now. To make that possible is a separate ticket. |
How did you profile this? We have to make sure we're not comparing apples to oranges here. Overhead of GUI/linking is unavoidable in Jdaviz but that is something using |
You can also avoid writing a file by creating |
This is technically possible but it opens up a can of worms for complicated workflows. For example, you load the original image, have markers defined by pixel against the original image, then you reproject, now if you unload the original image, what do you want to happen to those markers? Also, at this rate, why even do reproject inside Jdaviz? I still don't see the point when you can do this all outside of Jdaviz and then load the result after. |
Not sure what you mean here, can you please elaborate, @camipacifici ? |
I was just thinking that this problem can be fixed on the reproject side so that the package does not crush with gwcs.
No profiling, just observation. Nothing major anyway.
Good point, I did not think about that. More use cases to consider here.
Sorry, this is what I thought I understood from Tom's example reprojection. I thought he did not call the reproject package, but just the astropy routines that are used within the reproject package (the pixel-to-pixel method?). |
Did this discussion happen while I was out? Can you please link to his example? Thanks! |
If we can revive that front-end canvas rotation, these users will not need the reproject plugin at all. If they insist on using reproject anyway, they will have to fire off a Python session and learn some Python. Using Python while pretending to not use Python can only go so far. |
https://gist.github.com/astrofrog/720a8ce97700915d9dc965617ebdf874 |
The Gist looks vaguely familiar, I think it is tied to the following effort but I am not sure of the status. I think @astrofrog abandoned it due to performance issues or something? |
@pllim - just FYI reproject v0.10.0 is out with the fixes to the WCS helper to work with GWCS. Let me know if you run into any issues here with this! The gist linked above has the latest approach I worked on and that one was not abandoned due to performance but put on hold while the approach here was explored to see if it would be sufficient, and it sounds from the last SME tag-up like we might also be able to revive the image rotation in the front-end canvas which would be ideal, in which case the on-the-fly reprojection can be abandoned. It is technically possible to use astropy without reproject to do the reprojection (coding it up by hand with pixel_to_pixel) but if reproject is going to be used anyway for the WCS helper then might as well use reproject for the reprojection too, and it could open the door for users to potentially select different reprojection modes (interp, exact, etc). |
66d12af
to
3e56b99
Compare
Codecov ReportBase: 92.04% // Head: 92.06% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1949 +/- ##
==========================================
+ Coverage 92.04% 92.06% +0.02%
==========================================
Files 140 143 +3
Lines 15206 15313 +107
==========================================
+ Hits 13996 14098 +102
- Misses 1210 1215 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
6d07367
to
5b8285d
Compare
I wonder if wrapping in the progress spinner is the difference causing the overflow... 🤔 EDIT: it was the culprit, fixing now |
Ok, it might be unsyncing on any keypress. Please file a follow-up issue/ticket for that and I think its safe to ignore for the purpose of this PR. |
This comment was marked as resolved.
This comment was marked as resolved.
Okay, I think I addressed all the comments thus far, except for the plugin name that is being debated still. Also, when I reproject the larger image in the Imviz example notebook, the image shape is |
Is the compass a blocker or a follow-up bug (thanks for reminding me with the commit to add the note to the docs)? Besides that and the pending naming/placement decision, the code looks good to me! |
Not really. It doesn't always happen. If you reproject the first (larger) image, the second image actually shows up fine on Compass, but not the other way around. I suspect this is a general Compass limitation when two images have vastly different dimensions. I can open up a follow-up ticket after this PR is merged. |
Added new optional dependency of reproject package.
Added tests and updated doc.
but this does not work, halp
rather than below
and fix tests
acting weird after reprojection
4fa1d72
to
575227e
Compare
Cami said I should move this back to draft while Ori & co ponder. |
Superseded by #2179 |
Description
This pull request is to implement a plugin to call
reproject
in Imviz, as requested by user.Pro:
Con:
ImvizDitheredExample.ipynb
)Blocker(s):
Does not work on GWCS until this issue is addressed:find_optimal_celestial_wcs does not accept GWCS astropy/reproject#328TODO
Out of range float values are not JSON compliant
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.