Skip to content

Commit

Permalink
Fix doc build
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Feb 13, 2023
1 parent 77448e2 commit d1826f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
19 changes: 9 additions & 10 deletions sunkit_image/asda.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
from skimage import measure

from sunkit_image.utils import calc_gamma, points_in_poly, reform2d, remove_duplicate
from sunkit_image.utils import calculate_gamma, points_in_poly, reform2d, remove_duplicate

__all__ = ["Asda", "Lamb_Oseen"]

Expand Down Expand Up @@ -134,7 +134,7 @@ def gamma_values(self):
for d, (i, j) in enumerate(
product(np.arange(self.r, self.dshape[0] - self.r, 1), np.arange(self.r, self.dshape[1] - self.r, 1))
):
self.gamma[i, j, 0], self.gamma[i, j, 1] = calc_gamma(pm, vel[..., d], pnorm, N)
self.gamma[i, j, 0], self.gamma[i, j, 1] = calculate_gamma(pm, vel[..., d], pnorm, N)
# Transpose back vx & vy
self.vx = self.vx.T
self.vy = self.vy.T
Expand Down Expand Up @@ -206,16 +206,15 @@ def vortex_property(self, image=None):
Has to have the same shape as ``self.vx`` observational image,
which will be used to calculate the average observational values of all swirls.
Outputs
Returns
-------
`tuple`
The returned tuple has four components, each component in order is
``ve``: expanding speed, in the same unit as ``self.vx`` or ``self.vy``.
``vr``: rotational speed, in the same unit as ``self.vx`` or ``self.vy``.
``vc``: velocity of the center, in the form of ``[vx, vy]``.
``ia``: average of the observational values (intensity or magnetic
field strength etc) within the vortices if the parameter
image is given.
The returned tuple has four components, which are:
``ve`` : expanding speed, in the same unit as ``self.vx`` or ``self.vy``.
``vr`` : rotational speed, in the same unit as ``self.vx`` or ``self.vy``.
``vc`` : velocity of the center, in the form of ``[vx, vy]``.
``ia`` : average of the observational values within the vortices if the parameter image is given.
"""
ve, vr, vc, ia = (), (), (), ()
for i in range(len(self.edge_prop["center"])):
Expand Down
2 changes: 1 addition & 1 deletion sunkit_image/utils/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_calculate_gamma():
vel_norm = np.linalg.norm(vel[..., 0], axis=2)
sint = cross / (pnorm * vel_norm + 1e-10)
expected = np.nansum(sint, axis=1) / N
assert np.allclose(expected, utils.calc_gamma(pm, vel[..., 0], pnorm, N))
assert np.allclose(expected, utils.calculate_gamma(pm, vel[..., 0], pnorm, N))


def test_remove_duplicate():
Expand Down
8 changes: 4 additions & 4 deletions sunkit_image/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

__all__ = [
"bin_edge_summary",
"calc_gamma",
"calculate_gamma",
"equally_spaced_bins",
"find_pixel_radii",
"get_radial_intensity_summary",
Expand Down Expand Up @@ -252,7 +252,7 @@ def remove_duplicate(edge):
return new_edge


def calc_gamma(pm, vel, pnorm, N):
def calculate_gamma(pm, vel, pnorm, n):
"""
Calculate gamma values.
Expand All @@ -264,7 +264,7 @@ def calc_gamma(pm, vel, pnorm, N):
Velocity vector.
pnorm : `numpy.ndarray`
Mode of ``pm``.
N : `int`
n : `int`
Number of points.
Returns
Expand All @@ -288,4 +288,4 @@ def calc_gamma(pm, vel, pnorm, N):
cross = np.cross(pm, vel)
vel_norm = np.linalg.norm(vel, axis=2)
sint = cross / (pnorm * vel_norm + 1e-10)
return np.nansum(sint, axis=1) / N
return np.nansum(sint, axis=1) / n

0 comments on commit d1826f8

Please sign in to comment.