diff --git a/pycs/astro/wl/mass_mapping.py b/pycs/astro/wl/mass_mapping.py index e53f256..a879776 100755 --- a/pycs/astro/wl/mass_mapping.py +++ b/pycs/astro/wl/mass_mapping.py @@ -1200,6 +1200,11 @@ def sparse_wiener_filtering( ) RMS_ShearMap = np.sqrt(InshearData.Ncov / 2.0) # shape = (nx, ny) + # shape = ([nimgs], [Nrea], nx, ny) + # TODO: complex or complex128? Same question for real-valued arrays + xg = np.zeros_like(gamma1, dtype=complex) # Gaussian + sparse components + xs = np.zeros_like(gamma1, dtype=complex) # sparse component + xw = np.zeros_like(gamma1, dtype=complex) # Gaussian component SigmaNoise = np.min(RMS_ShearMap) # float Esn_Sparse = SigmaNoise / RMS_ShearMap # shape = (nx, ny) Esn_Sparse[Esn_Sparse == np.inf] = 0 @@ -1250,11 +1255,7 @@ def sparse_wiener_filtering( InshearData, mask, Nrea=Nrea, inpshape=inpshape ) # shape = ([nimgs], [Nrea], nx, ny) - # shape = ([nimgs], [Nrea], nx, ny) - # TODO: complex or complex128? Same question for real-valued arrays - xg = np.zeros_like(gamma1, dtype=complex) # Gaussian + sparse components - xs = np.zeros_like(gamma1, dtype=complex) # sparse component - xw = np.zeros_like(gamma1, dtype=complex) # Gaussian component + for n in range(niter): resi1, resi2 = self.get_resi( diff --git a/pycs/sparsity/sparse2d/starlet.py b/pycs/sparsity/sparse2d/starlet.py index 352490d..38f342c 100644 --- a/pycs/sparsity/sparse2d/starlet.py +++ b/pycs/sparsity/sparse2d/starlet.py @@ -903,13 +903,13 @@ def threshold( if dim in (0, 2): # SigmaNoise: scalar or shape = (nx, ny) # The noise level is obtained at each scale by multiplying by self.TabNorm Thres = ( - SigmaNoise * (self.TabNsigma * self.TabNorm)[:, np.newdim, np.newdim] + SigmaNoise * (self.TabNsigma * self.TabNorm)[:, np.newaxis, np.newaxis] ) # shape = (ns, nx, ny) elif dim == 1: # SigmaNoise: shape = (ns,) Thres = SigmaNoise * self.TabNsigma # shape = (ns,) else: # SigmaNoise: shape = (ns, nx, ny) Thres = ( - SigmaNoise * self.TabNsigma[:, np.newdim, np.newdim] + SigmaNoise * self.TabNsigma[:, np.newaxis, np.newaxis] ) # shape = (ns, nx, ny) if ThresCoarse: