cosmodesi / pypower

power spectrum and window function estimation
BSD 3-Clause "New" or "Revised" License
17 stars 5 forks source link

'CatalogSmoothWindow' object is not callable #17

Open zdplayground opened 1 year ago

zdplayground commented 1 year ago

When I calculate window matrix via wm = PowerSpectrumSmoothWindowMatrix(kout, projsin=projsin, projsout=ellsout, window=window, sep=sep, kin_rebin=kin_rebin, kin_lim=kin_lim), it outputs the error:


TypeError Traceback (most recent call last) File :13, in

File /global/common/software/desi/users/adematti/cori/cosmodesiconda/20220713-1.0.0/code/pypower/main/lib/python3.9/site-packages/pypower/smooth_window.py:1043, in PowerSpectrumSmoothWindowMatrix.init(self, kout, projsin, projsout, weightsout, k, kin_rebin, kin_lim, sep, window, xy, q, sum_wa, default_zero, attrs) 1040 self.projsout = [Projection(proj, default_wa_order=None if self.sum_wa else 0) for proj in projsout] 1042 self._set_xw(xin=self.k, xout=kout, weightsout=weightsout, weight=getattr(window, 'wnorm_ref', [1.])[0]) -> 1043 self.run()

File /global/common/software/desi/users/adematti/cori/cosmodesiconda/20220713-1.0.0/code/pypower/main/lib/python3.9/site-packages/pypower/smooth_window.py:1066, in PowerSpectrumSmoothWindowMatrix.run(self) 1045 def run(self): 1046 r""" 1047 Set matrix. Provided arXiv:2106.06324 eq. 2.5: 1048 (...) 1064 Note that we do not include :math:k^{-n} as this factor is included in :class:PowerSpectrumOddWideAngleMatrix. 1065 """ -> 1066 self.corrmatrix = CorrelationFunctionSmoothWindowMatrix(self.sep, self.projsin, projsout=self.projsout, window=self.window, sum_wa=self.sum_wa, default_zero=self.default_zero).projvalue 1068 self.value = [] 1070 krebin = utils.rebin(self.k, len(self.k) // self.kin_rebin, statistic=np.mean)

File /global/common/software/desi/users/adematti/cori/cosmodesiconda/20220713-1.0.0/code/pypower/main/lib/python3.9/site-packages/pypower/smooth_window.py:872, in CorrelationFunctionSmoothWindowMatrix.init(self, sep, projsin, projsout, window, sum_wa, default_zero, attrs) 869 self.projsout = [Projection(proj, default_wa_order=None if self.sum_wa else 0) for proj in projsout] 871 self._set_xw(xin=sep, xout=sep, weight=getattr(window, 'wnorm_ref', [1.])[0]) --> 872 self.run()

File /global/common/software/desi/users/adematti/cori/cosmodesiconda/20220713-1.0.0/code/pypower/main/lib/python3.9/site-packages/pypower/smooth_window.py:905, in CorrelationFunctionSmoothWindowMatrix.run(self) 903 for ell, coeff in zip(ellsw, coeffs): 904 proj = projin.clone(ell=ell) --> 905 block += coeff * window(proj=proj, sep=sep, default_zero=self.default_zero) 906 line.append(block) 907 self.projvalue.append(line)

TypeError: 'CatalogSmoothWindow' object is not callable

adematti commented 1 year ago

please pass window.poles :) I guess I should made the cast automatically