Commit c81d636f by Martin Reinecke

### cleanup, tests

parent 265d8296
 ... ... @@ -41,8 +41,7 @@ kmax=lmax # the a_lm arrays follow the same conventions as those in healpy slmT = random_alm(lmax, mmax) # build beam a_lm (pencil beam for now) blmT = deltabeam(lmax,kmax) # build beam a_lm blmT = random_alm(lmax, mmax) t0=time.time() ... ... @@ -66,7 +65,7 @@ bar2 = np.zeros((nth,nph)) for ith in range(nth): for iph in range(nph): rbeam=interpol_ng.rotate_alm(blmT, lmax, ptg[ith,iph,2],ptg[ith,iph,0],ptg[ith,iph,1]) bar2[ith,iph] = convolve(slmT, rbeam, lmax) bar2[ith,iph] = convolve(slmT, rbeam, lmax).real plt.subplot(2,2,2) plt.imshow(bar2) plt.subplot(2,2,3) ... ...
 ... ... @@ -17,7 +17,7 @@ #include "alm.h" #include "mr_util/math/fft.h" #include "mr_util/bindings/pybind_utils.h" #include using namespace std; using namespace mr; ... ... @@ -107,12 +107,10 @@ template class Interpolator a1(l,m)=a2(l,m)=0.; else { a1(l,m) = slmT(l,m)*blmT(l,k).real()*T(spinsign*lnorm[l]); auto tmp = blmT(l,k)*T(spinsign*lnorm[l]); a1(l,m) = slmT(l,m)*tmp.real(); if (k>0) { complex tmp = slmT(l,m)*complex(0,blmT(l,k).imag())*T(-spinsign*lnorm[l]); a2(l,m) = complex(-tmp.imag(), tmp.real()); } a2(l,m) = slmT(l,m)*tmp.imag(); } } size_t kidx1 = (k==0) ? 0 : 2*k-1, ... ...
 import numpy as np import pytest from numpy.testing import assert_ import interpol_ng import pysharp pmp = pytest.mark.parametrize def _l2error(a, b): return np.sqrt(np.sum(np.abs(a-b)**2)/np.sum(np.abs(a)**2)) def _assert_close(a, b, epsilon): err = _l2error(a, b) if (err >= epsilon): print("Error: {} > {}".format(err, epsilon)) assert_(err
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!