Rename AsmootEstimator get scales
@@ -66,7 +66,30 @@ class ASmoothMapEstimator(Estimator):
self.threshold = threshold
self.method = method
- def kernels(self, pixel_scale):
+ @staticmethod
+ def get_scales(n_scales, factor=np.sqrt(2), kernel=Gaussian2DKernel):
+ """Create list of Gaussian widths.
+
+ Parameters
+ ----------
+ n_scales : int
+ Number of scales
+ factor : float
+ Incremental factor
+
+ Returns
+ -------
+ scales : `~numpy.ndarray`
+ Scale array
+ """
+ if kernel == Gaussian2DKernel:
+ sigma_0 = 1.0 / np.sqrt(9 * np.pi)
+ elif kernel == Tophat2DKernel:
+ sigma_0 = 1.0 / np.sqrt(np.pi)
+
+ return sigma_0 * factor ** np.arange(n_scales)
+
+ def get_kernels(self, pixel_scale):
"""
Ring kernels according to the specified method.
@@ -173,9 +196,8 @@ class ASmoothMapEstimator(Estimator):
* 'scales'
* 'significance'.
"""
-
pixel_scale = counts.geom.pixel_scales.mean()
- kernels = self.kernels(pixel_scale)
+ kernels = self.get_kernels(pixel_scale)
cubes = {}
cubes["counts"] = scale_cube(counts.data, kernels)
@@ -249,13 +271,3 @@ class ASmoothMapEstimator(Estimator):
smoothed["flux"][mask] = cubes["flux"][slice_][mask] / norm
return smoothed
-
- @staticmethod
- def get_scales(n_scales, factor=np.sqrt(2), kernel=Gaussian2DKernel):
- """Create list of Gaussian widths."""
- if kernel == Gaussian2DKernel:
- sigma_0 = 1.0 / np.sqrt(9 * np.pi)
- elif kernel == Tophat2DKernel:
- sigma_0 = 1.0 / np.sqrt(np.pi)
-
- return sigma_0 * factor ** np.arange(n_scales)
