Skip to content

Commit

Permalink
feat: use hp.map2alm_lsq for lmax higher than 1.5 nside
Browse files Browse the repository at this point in the history
  • Loading branch information
zonca committed Sep 24, 2022
1 parent 86f4a79 commit 07f0076
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pysm3/models/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,16 @@ def apply_smoothing_and_coord_transform(
if input_alm:
alm = input_map.copy()
else:
alm = hp.map2alm(
input_map, lmax=lmax, use_pixel_weights=True if nside > 16 else False
)
if lmax <= 1.5 * nside:
alm = hp.map2alm(
input_map,
lmax=lmax,
use_pixel_weights=True if nside > 16 else False,
)
else:
alm, error, n_iter = hp.map2alm_lsq(
input_map, lmax=lmax, mmax=lmax, tol=1e-6, maxiter=100
)
if fwhm is not None:
hp.smoothalm(alm, fwhm=fwhm.to_value(u.rad), inplace=True, pol=True)
if rot is not None:
Expand Down

0 comments on commit 07f0076

Please sign in to comment.