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

Imports: changed scipy.signal.gaussian, replaced with scipy.signal.windows.gaussian #4087

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/plotProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def createScatterData():
positionY = positionY + numpy.random.rand(len(positionY)) - 0.5

# Diodes position
lut = scipy.signal.gaussian(max(nbX, nbY), std=8) * 10
lut = scipy.signal.windows.gaussian(max(nbX, nbY), std=8) * 10
yy, xx = numpy.ogrid[:nbY, :nbX]
signal = lut[yy] * lut[xx]
diode1 = numpy.random.poisson(signal * 10)
Expand Down
2 changes: 1 addition & 1 deletion examples/scatterview.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def createData():
positionY = positionY + numpy.random.rand(len(positionY)) - 0.5

# Diodes position
lut = scipy.signal.gaussian(max(nbX, nbY), std=8) * 10
lut = scipy.signal.windows.gaussian(max(nbX, nbY), std=8) * 10
yy, xx = numpy.ogrid[:nbY, :nbX]
signal = lut[yy] * lut[xx]
diode1 = numpy.random.poisson(signal * 10)
Expand Down
14 changes: 7 additions & 7 deletions src/silx/math/fit/test/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def setUp(self):
"fwhm2": 2 * math.sqrt(2 * math.log(2)) * s2,
"area1": h * s1 * math.sqrt(2 * math.pi),
}
# result of `7 * scipy.signal.gaussian(11, 3)`
# result of `7 * scipy.signal.windows.gaussian(11, 3)`
self.scipy_gaussian = numpy.array(
[
1.74546546,
Expand All @@ -71,8 +71,8 @@ def setUp(self):
)

# result of:
# numpy.concatenate((7 * scipy.signal.gaussian(11, 3)[0:5],
# 7 * scipy.signal.gaussian(11, 2.1)[5:11]))
# numpy.concatenate((7 * scipy.signal.windows.gaussian(11, 3)[0:5],
# 7 * scipy.signal.windows.gaussian(11, 2.1)[5:11]))
self.scipy_asym_gaussian = numpy.array(
[
1.74546546,
Expand All @@ -93,7 +93,7 @@ def tearDown(self):
pass

def testGauss(self):
"""Compare sum_gauss with scipy.signals.gaussian"""
"""Compare sum_gauss with scipy.signal.windows.gaussian"""
y = functions.sum_gauss(
self.x,
self.g_params["height"],
Expand All @@ -105,7 +105,7 @@ def testGauss(self):
self.assertAlmostEqual(y[i], self.scipy_gaussian[i])

def testAGauss(self):
"""Compare sum_agauss with scipy.signals.gaussian"""
"""Compare sum_agauss with scipy.signal.windows.gaussian"""
y = functions.sum_agauss(
self.x,
self.g_params["area1"],
Expand All @@ -116,7 +116,7 @@ def testAGauss(self):
self.assertAlmostEqual(y[i], self.scipy_gaussian[i])

def testFastAGauss(self):
"""Compare sum_fastagauss with scipy.signals.gaussian
"""Compare sum_fastagauss with scipy.signal.windows.gaussian
Limit precision to 3 decimal places."""
y = functions.sum_fastagauss(
self.x,
Expand All @@ -128,7 +128,7 @@ def testFastAGauss(self):
self.assertAlmostEqual(y[i], self.scipy_gaussian[i], 3)

def testSplitGauss(self):
"""Compare sum_splitgauss with scipy.signals.gaussian"""
"""Compare sum_splitgauss with scipy.signal.windows.gaussian"""
y = functions.sum_splitgauss(
self.x,
self.g_params["height"],
Expand Down
4 changes: 2 additions & 2 deletions src/silx/opencl/sift/test/test_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
def gaussian_cpu(sigma, size=None, PROFILE=False):
"""
Calculate a 1D gaussian using numpy.
This is the same as scipy.signal.gaussian
This is the same as scipy.signal.windows.gaussian

:param sigma: width of the gaussian
:param size: can be calculated as 1 + 2 * 4sigma
Expand Down Expand Up @@ -127,7 +127,7 @@ def tearDownClass(cls):
def gaussian_gpu_v1(cls, sigma, size=None):
"""
Calculate a 1D gaussian using pyopencl.
This is the same as scipy.signal.gaussian
This is the same as scipy.signal.windows.gaussian

:param sigma: width of the gaussian
:param size: can be calculated as 1 + 2 * 4sigma
Expand Down
Loading