apply_smoothing_and_coord_transform¶
- pysm3.apply_smoothing_and_coord_transform(input_map, fwhm=None, beam_window=None, rot=None, lmax=None, output_nside=None, output_car_resol=None, return_healpix=True, return_car=False, input_alm=False, map2alm_lsq_maxiter=None, map_dist=None, pre_applied_fwhm=None)[source] [edit on github]¶
Apply smoothing and coordinate rotation to an input map
it applies the
healpy.smoothingGaussian smoothing kernel ifmap_distis None, otherwise applies distributed smoothing withlibsharp. In the distributed case, no rotation is supported.If the input map carries a pre-applied beam (the
pre_applied_fwhmattribute, set by the models of components whose templates are not beam-free), or one is provided with thepre_applied_fwhmargument, and a targetfwhmis requested, only the differential beamsqrt(max(fwhm**2 - pre_applied_fwhm**2, 0))is applied, so that the requested resolution is not over-smoothed by double-applying part of the beam the map already has. Afwhmnot larger than the pre-applied beam results in no smoothing (a map cannot be deconvolved), with a warning. In serial execution, the returned HEALPix map is tagged with the beam it carries after smoothing, so that repeated smoothing stays differential; in the distributed case the smoothed map is not tagged.- Parameters:
- input_mapndarray
Input map, of shape
(3, npix)This is assumed to have no beam at this point, as the simulated small scale template on which the simulations are based have no beam, unless a pre-applied beam is declared withpre_applied_fwhmor attached to the map as attribute.- fwhmastropy.units.Quantity
Full width at half-maximum, defining the Gaussian kernels to be applied.
- pre_applied_fwhmastropy.units.Quantity or string, optional
FWHM of the Gaussian beam already applied to the input map, any angular unit (e.g.
"56 arcmin"). If None (default), it is detected from thepre_applied_fwhmattribute of the input map, if present. An explicit value, including 0, takes precedence over the attribute.- beam_window: array, optional
Custom beam window function (\(B_\ell\))
- rot: hp.Rotator
Apply a coordinate rotation give a healpy
Rotator, e.g. if the inputs are in Galactic,hp.Rotator(coord=("G", "C"))rotates to Equatorial- output_nsideint
HEALPix output map Nside, if None, use the same as the input
- lmaxint
lmax for the map2alm step, if None, it is set to 2.5 * nside if output_nside is equal or higher than nside. It is set to 1.5 * nside if output_nside is lower than nside
- output_car_resolastropy.Quantity
CAR output map resolution, generally in arcmin
- return_healpixbool
Whether to return the HEALPix map
- return_carbool
Whether to return the CAR map
- input_almbool
Instead of starting from a map,
input_mapis a set of Alm- map2alm_lsq_maxiterint
Number of iteration for the least squares map to Alm transform, setting it to 0 uses the standard map2alm, the default of 10 makes the transform slow if the input map is not band limited, for example if has point sources or sharp features. If ell_max is <= 1.5 nside, this setting is ignored and
map2almwith pixel weights is used.- map_distpysm.MapDistribution, optional
Distribution object for parallel computing with MPI. When it is not None, the smoothing is executed with
libsharpon the distributed map: no rotation (other than identity), no bandpass CAR output and no change of output NSIDE are supported, and the returned map is not tagged with its beam. With no beam to apply, the input map is returned unchanged.
- Returns:
- smoothed_mapnp.ndarray or tuple of np.ndarray
Array containing the smoothed sky or tuple of HEALPix and CAR maps