Skip to content

Commit

Permalink
Respond to review
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Dec 15, 2020
1 parent 3531f1a commit e036349
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions changelog/4727.bugfix.rst → changelog/4727.breaking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@ left coordinates of the input rectangle in world coordinates were considered
when calculating the pixel bounding box. All four corners are once again taken
into account now, meaning that `~sunpy.map.GenericMap.submap` correctly returns
the smallest pixel box which contains all four corners of the input rectangle.


To revert to the previous 2.0 behaviour, first convert the top right and bottom
left coordinates to pixel space before calling submap with::

top_right = smap.wcs.world_to_pixel(top_right) * u.pix
bottom_left = smap.wcs.world_to_pixel(bottom_left) * u.pix
smap.submap(bottom_left=bottom_left, top_right=top_right)


This will define the rectangle in pixel space.
2 changes: 1 addition & 1 deletion sunpy/map/mapbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ def submap(self, bottom_left, *, top_right=None, width: (u.deg, u.pix) = None, h
Any pixels which have at least part of their area inside the rectangle
are returned. If the rectangle is defined in world coordinates, the
smallest array which contains all four corners of the rectangle as
defined in world coordinates are defined.
defined in world coordinates is returned.
Parameters
----------
Expand Down

0 comments on commit e036349

Please sign in to comment.