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

Fix: makes extra functions from the trace module private #136

Merged
merged 11 commits into from
Mar 20, 2023
6 changes: 6 additions & 0 deletions changelog/136.removal.rst
Saksham-13 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Removes the functions
1. curvature_radius
2. erase_loop_in_image
3. initial_direction_finding
4. loop_add
from the __all__ variable in `sunkit_image.trace` to make them private.
Saksham-13 marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 4 additions & 8 deletions sunkit_image/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
__all__ = [
"occult2",
"bandpass_filter",
"curvature_radius",
"erase_loop_in_image",
"initial_direction_finding",
"loop_add",
"smooth",
]

Expand Down Expand Up @@ -315,7 +311,7 @@ def smooth(image, width, nanopt="replace"):
return filtered.astype(np.float32)


def erase_loop_in_image(image, istart, jstart, width, xloop, yloop):
def _erase_loop_in_image(image, istart, jstart, width, xloop, yloop):
"""
Makes all the points in a loop and its vicinity as zero in the original
image to prevent them from being traced again.
Expand Down Expand Up @@ -362,7 +358,7 @@ def erase_loop_in_image(image, istart, jstart, width, xloop, yloop):
return image


def loop_add(lengths, xloop, yloop, zloop, iloop, loops):
def _loop_add(lengths, xloop, yloop, zloop, iloop, loops):
"""
Adds the current loop to the output structures by interpolating the
coordinates.
Expand Down Expand Up @@ -420,7 +416,7 @@ def loop_add(lengths, xloop, yloop, zloop, iloop, loops):
return loops, iloop


def initial_direction_finding(image, xstart, ystart, nlen):
def _initial_direction_finding(image, xstart, ystart, nlen):
"""
Finds the initial angle of the loop at the starting point.

Expand Down Expand Up @@ -474,7 +470,7 @@ def initial_direction_finding(image, xstart, ystart, nlen):
return angles[0, np.argmax(flux)]


def curvature_radius(image, rmin, xl, yl, zl, al, ir, ip, nlen, idir):
def _curvature_radius(image, rmin, xl, yl, zl, al, ir, ip, nlen, idir):
"""
Finds the radius of curvature at the given loop point and then uses it to
find the next point in the loop.
Expand Down