8000 Add "imshow" as an option for autoalign plotting of maps · Issue #6812 · sunpy/sunpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add "imshow" as an option for autoalign plotting of maps #6812

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

Closed
ayshih opened this issue Mar 1, 2023 · 11 comments · Fixed by #8036
Closed

Add "imshow" as an option for autoalign plotting of maps #6812

ayshih opened this issue Mar 1, 2023 · 11 comments · Fixed by #8036
Labels
Effort Medium Requires a moderate time investment. Feature Request New feature wanted. map Affects the map submodule Package Intermediate Requires good technical knowledge of the package. Priority Low Rapid action not required.

Comments

@ayshih
Copy link
Member
ayshih commented Mar 1, 2023

For autoalign plotting of maps, our current implementation uses pcolormesh(). However, if the pixel-to-pixel transformation between the map's WCS and the axes's WCS is affine (i.e., just scaling and rotation), using imshow(transform=...) would have much better performance than pcolormesh(). The trick is that we'd have to add a clip path to the image produced by imshow() because it can unnecessarily extrapolate data.

We should add imshow() as an option for autoalign plotting.

@nabobalis nabobalis added Feature Request New feature wanted. map Affects the map submodule Priority Low Rapid action not required. Effort Medium Requires a moderate time investment. Package Intermediate Requires good technical knowledge of the package. labels Mar 1, 2023
@aritrasinha108

This comment was marked as outdated.

@nabobalis

This comment was marked as outdated.

@aritrasinha108

This comment was marked as outdated.

@Mihan786Chistie
Copy link
Contributor

For autoalign plotting of maps, our current implementation uses pcolormesh(). However, if the pixel-to-pixel transformation between the map's WCS and the axes's WCS is affine (i.e., just scaling and rotation), using imshow(transform=...) would have much better performance than pcolormesh(). The trick is that we'd have to add a clip path to the image produced by imshow() because it can unnecessarily extrapolate data.

We should add imshow() as an option for autoalign plotting.

Hey @ayshih, can you explain "The trick is that we'd have to add a clip path to the image produced by imshow() because it can unnecessarily extrapolate data."

@ayshih
Copy link
Member Author
ayshih commented Apr 4, 2023

Look at the middle panel of the figure in this comment, and then the addition of a clip path in this later comment.

@Mihan786Chistie

This comment has been minimized.

@Mihan786Chistie

This comment has been minimized.

@Mihan786Chistie

This comment has been minimized.

@Prtm2110
Copy link
Contributor

Hello, what will be the clip path for a map object? Any resources on this will be helpful.

w = data.shape[1]
h = data.shape[0]
path = mp.path.Path([[-0.5,-0.5], [w-0.5,-0.5], [w-0.5,h-0.5], [-0.5,h-0.5], [-0.5,-0.5]])

This clip path from astropy/astropy#14420 (comment) don't seem to be general for all?

@ayshih
Copy link
Member Author
ayshih commented Jan 24, 2025

Those are correctly the pixel coordinates for the four corners of any map. However, the approach of imshow() plus such a clip path works fully only when the pixel-to-pixel transformation between the map's WCS and the axes's WCS is affine (i.e., just scaling and rotation). This stringent requirement means that we'd want to detect when the imshow() approach may be providing a flawed image and emit a warning.

@Prtm2110
Copy link
Contributor
Prtm2110 commented Jan 24, 2025

Thank you for the response! "pixel-to-pixel transformation between the map's WCS and the axes's WCS is affine" how do I exactly go on do this, my rough guess is to check if wcs.cdelt and wcs.pc exits or this is not the right direction I am heading in? Additionally could you please review #7772 if the work done there is correct or any requires changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort Medium Requires a moderate time investment. Feature Request New feature wanted. map Affects the map submodule Package Intermediate Requires good technical knowledge of the package. Priority Low Rapid action not required.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
0