Skip to content
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

map.rotate doesn't take scale into account when padding image #3285

Open
amunozj opened this issue Jul 29, 2019 · 1 comment

Comments

@amunozj
Copy link

commented Jul 29, 2019

Description

Scale is not taking into account when padding the image, only rotation. This results on cropped images when using magnification. The opposite doesn't happen if you reduce the image. The image retains its original dimension, even though the Sun is tiny.

Expected behavior

The image should be padded to accommodate the entire scaled image when upscaling.

Actual behavior

Using a magnification in which the Sun's radius ends up larger than the original field of view keeps the original image dimension and crops anything that doesn't fit the new field of view.

This is because the padding is determined using:

        # Calculate the shape in pixels to contain all of the image data
        extent = np.max(np.abs(np.vstack((self.data.shape @ rmatrix,
                                          self.data.shape @ rmatrix.T))), axis=0)

It may be necessary to pad the image based on scale, prior to rotation

Steps to Reproduce

Open any test map and use map.rotate(scale=4) The resulting image is visibly cropped.

@Cubostar

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

I can work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.