From 973dda47633d99c844ff08f354f17a2b75a7f448 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 12 Aug 2017 22:04:02 +0800 Subject: utils/transform.py: Update comment and minor cleanups Signed-off-by: Aaron LI --- fg21sim/utils/transform.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fg21sim/utils/transform.py b/fg21sim/utils/transform.py index 63fad94..3fc64ca 100644 --- a/fg21sim/utils/transform.py +++ b/fg21sim/utils/transform.py @@ -156,7 +156,7 @@ def circle2ellipse(imgcirc, bfraction, rotation=0.0): Input image grid containing a circle at the center bfraction : float The fraction of the semi-minor axis w.r.t. the semi-major axis - (assumed to be the width of the input image), to determine the + (i.e., the half width of the input image), to determine the shrunk size (height) of the output image. Should be a fraction within [0, 1] rotation : float, optional @@ -175,9 +175,7 @@ def circle2ellipse(imgcirc, bfraction, rotation=0.0): # Pad the shrunk image to have the same size as input imgout = np.zeros(shape=(nrow, ncol)) r1 = int((nrow - nrow2) / 2) - r2 = r1 + nrow2 - imgout[r1:r2, :] = img2 + imgout[r1:(r1+nrow2), :] = img2 # Rotate the ellipse - imgout = ndimage.rotate(imgout, angle=rotation, reshape=False, - order=1) + imgout = ndimage.rotate(imgout, angle=rotation, reshape=False, order=1) return imgout -- cgit v1.2.2