Skip to content

Commit

Permalink
Removed unused log and improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Dec 12, 2020
1 parent 85dd4ae commit 84a7c99
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions sunpy/map/mapbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import sunpy.coordinates
import sunpy.io as io
import sunpy.visualization.colormaps
from sunpy import config, log
from sunpy import config
from sunpy.coordinates import HeliographicCarrington, HeliographicStonyhurst, get_earth, sun
from sunpy.coordinates.utils import get_rectangle_coordinates
from sunpy.image.resample import resample as sunpy_image_resample
Expand Down Expand Up @@ -1446,7 +1446,9 @@ def submap(self, bottom_left, *, top_right=None, width: (u.deg, u.pix) = None, h
Returns a submap defined by a rectangle.
Any pixels which have at least part of their area inside the rectangle
are returned.
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.
Parameters
----------
Expand All @@ -1471,9 +1473,6 @@ def submap(self, bottom_left, *, top_right=None, width: (u.deg, u.pix) = None, h
Notes
-----
If top_right is below or to the left of bottom_left, a message is logged
at the debug level to the sunpy logger.
When specifying pixel coordinates, they are specified in Cartesian
order not in numpy order. So, for example, the ``bottom_left=``
argument should be ``[left, bottom]``.
Expand Down Expand Up @@ -1605,12 +1604,6 @@ def submap(self, bottom_left, *, top_right=None, width: (u.deg, u.pix) = None, h
left = np.min(pixel_corners[0]).to_value(u.pix)
right = np.max(pixel_corners[0]).to_value(u.pix)

if left > right:
log.debug("The rectangle is inverted in the left/right direction.")

if bottom > top:
log.debug("The rectangle is inverted in the bottom/top direction.")

# Round the lower left pixel to the nearest integer
# We want 0.5 to be rounded up to 1, so use floor(x + 0.5)
bottom = np.floor(bottom + 0.5)
Expand Down

0 comments on commit 84a7c99

Please sign in to comment.