(
    map_in,
    fwhm=0.0,
    sigma=None,
    beam_window=None,
    pol=True,
    iter=3,
    lmax=None,
    mmax=None,
    use_weights=False,
    use_pixel_weights=False,
    datapath=None,
    verbose=True,
    nest=False,
)
return output_map
Smooth a map with a Gaussian symmetric beam.

    No removal of monopole or dipole is performed.

    Parameters
    ----------
    map_in : array or sequence of 3 arrays
      Either an array representing one map, or a sequence of
      3 arrays representing 3 maps, accepts masked arrays
    fwhm : float, optional
      The full width half max parameter of the Gaussian [in
      radians]. Default:0.0
    sigma : float, optional
      The sigma of the Gaussian [in radians]. Override fwhm.
    beam_window: array, optional
      Custom beam window function. Override fwhm and sigma.
    pol : bool, optional
      If True, assumes input maps are TQU. Output will be TQU maps.
      (input must be 1 or 3 alms)
      If False, each map is assumed to be a spin 0 map and is
      treated independently (input can be any number of alms).
      If there is only one input map, it has no effect. Default: True.
    iter : int, scalar, optional
      Number of iteration (default: 3)
    lmax : int, scalar, optional
      Maximum l of the power spectrum. Default: 3*nside-1
    mmax : int, scalar, optional
      Maximum m of the alm. Default: lmax
    use_weights: bool, scalar, optional
      If True, use the ring weighting. Default: False.
    use_pixel_weights: bool, optional
      If True, use pixel by pixel weighting, healpy will automatically download the weights, if needed
      See the map2alm docs for details about weighting
    datapath : None or str, optional
      If given, the directory where to find the pixel weights data.
      See the docstring of `map2alm` for details on how to set it up
    verbose : bool, optional
      Deprecated, has not effect.
    nest : bool, optional
      If True, the input map ordering is assumed to be NESTED. Default: False (RING)
      This function will temporary reorder the NESTED map into RING to perform the
      smoothing and order the output back to NESTED. If the map is in RING ordering
      no internal reordering will be performed.

    Returns
    -------
    maps : array or list of 3 arrays
      The smoothed map(s)
Smooth a map with a Gaussian symmetric beam.
Smooth a map with a Gaussian symmetric beam .
def smoothing(
    map_in,
    fwhm=0.0,
    sigma=None,
    beam_window=None,
    pol=True,
    iter=3,
    lmax=None,
    mmax=None,
    use_weights=False,
    use_pixel_weights=False,
    datapath=None,
    verbose=True,
    nest=False,
):
    """Smooth a map with a Gaussian symmetric beam.

    No removal of monopole or dipole is performed.

    Parameters
    ----------
    map_in : array or sequence of 3 arrays
      Either an array representing one map, or a sequence of
      3 arrays representing 3 maps, accepts masked arrays
    fwhm : float, optional
      The full width half max parameter of the Gaussian [in
      radians]. Default:0.0
    sigma : float, optional
      The sigma of the Gaussian [in radians]. Override fwhm.
    beam_window: array, optional
      Custom beam window function. Override fwhm and sigma.
    pol : bool, optional
      If True, assumes input maps are TQU. Output will be TQU maps.
      (input must be 1 or 3 alms)
      If False, each map is assumed to be a spin 0 map and is
      treated independently (input can be any number of alms).
      If there is only one input map, it has no effect. Default: True.
    iter : int, scalar, optional
      Number of iteration (default: 3)
    lmax : int, scalar, optional
      Maximum l of the power spectrum. Default: 3*nside-1
    mmax : int, scalar, optional
      Maximum m of the alm. Default: lmax
    use_weights: bool, scalar, optional
      If True, use the ring weighting. Default: False.
    use_pixel_weights: bool, optional
      If True, use pixel by pixel weighting, healpy will automatically download the weights, if needed
      See the map2alm docs for details about weighting
    datapath : None or str, optional
      If given, the directory where to find the pixel weights data.
      See the docstring of `map2alm` for details on how to set it up
    verbose : bool, optional
      Deprecated, has not effect.
    nest : bool, optional
      If True, the input map ordering is assumed to be NESTED. Default: False (RING)
      This function will temporary reorder the NESTED map into RING to perform the
      smoothing and order the output back to NESTED. If the map is in RING ordering
      no internal reordering will be performed.

    Returns
    -------
    maps : array or list of 3 arrays
      The smoothed map(s)
    """

    if not cb.is_seq(map_in):
        raise TypeError("map_in must be a sequence")

    # save the masks of inputs
    masks = pixelfunc.mask_bad(map_in)

    if cb.is_seq_of_seq(map_in):
        nside = pixelfunc.get_nside(map_in)
        n_maps = len(map_in)
    else:
        nside = pixelfunc.get_nside(map_in)
        n_maps = 0

    check_max_nside(nside)

    if nest:
        map_in = pixelfunc.reorder(map_in, inp=None, out=None, r2n=None, n2r=True)

    if pol or n_maps in (0, 1):
        # Treat the maps together (1 or 3 maps)
        alms = map2alm(
            map_in,
            lmax=lmax,
            mmax=mmax,
            iter=iter,
            pol=pol,
            use_weights=use_weights,
            use_pixel_weights=use_pixel_weights,
            datapath=datapath,
        )
        smoothalm(
            alms,
            fwhm=fwhm,
            sigma=sigma,
            beam_window=beam_window,
            pol=pol,
            mmax=mmax,
            inplace=True,
        )
        output_map = alm2map(
            alms,
            nside,
            lmax=lmax,
            mmax=mmax,
            pixwin=False,
            pol=pol,
        )
    else:
        # Treat each map independently (any number)
        output_map = []
        for m in map_in:
            alm = map2alm(
                m,
                lmax=lmax,
                mmax=mmax,
                iter=iter,
                pol=pol,
                use_weights=use_weights,
                use_pixel_weights=use_pixel_weights,
                datapath=datapath,
            )
            smoothalm(
                alm,
                fwhm=fwhm,
                sigma=sigma,
                beam_window=beam_window,
                inplace=True,
            )
            output_map.append(alm2map(alm, nside, pixwin=False))
        output_map = np.array(output_map)
    output_map[masks] = UNSEEN

    if nest:
        output_map = pixelfunc.reorder(
            output_map, inp=None, out=None, r2n=True, n2r=False
        )

    return output_map
def smoothing ( map_in , fwhm = 0.0 , sigma = None , beam_window = None , pol = True , iter = 3 , lmax = None , mmax = None , use_weights = False , use_pixel_weights = False , datapath = None , verbose = True , nest = False , ) : if not cb . is_seq ( map_in ) : raise TypeError ( "map_in must be a sequence" ) # save the masks of inputs masks = pixelfunc . mask_bad ( map_in ) if cb . is_seq_of_seq ( map_in ) : nside = pixelfunc . get_nside ( map_in ) n_maps = len ( map_in ) else : nside = pixelfunc . get_nside ( map_in ) n_maps = 0 check_max_nside ( nside ) if nest : map_in = pixelfunc . reorder ( map_in , inp = None , out = None , r2n = None , n2r = True ) if pol or n_maps in ( 0 , 1 ) : # Treat the maps together (1 or 3 maps) alms = map2alm ( map_in , lmax = lmax , mmax = mmax , iter = iter , pol = pol , use_weights = use_weights , use_pixel_weights = use_pixel_weights , datapath = datapath , ) smoothalm ( alms , fwhm = fwhm , sigma = sigma , beam_window = beam_window , pol = pol , mmax = mmax , inplace = True , ) output_map = alm2map ( alms , nside , lmax = lmax , mmax = mmax , pixwin = False , pol = pol , ) else : # Treat each map independently (any number) output_map = [ ] for m in map_in : alm = map2alm ( m , lmax = lmax , mmax = mmax , iter = iter , pol = pol , use_weights = use_weights , use_pixel_weights = use_pixel_weights , datapath = datapath , ) smoothalm ( alm , fwhm = fwhm , sigma = sigma , beam_window = beam_window , inplace = True , ) output_map . append ( alm2map ( alm , nside , pixwin = False ) ) output_map = np . array ( output_map ) output_map [ masks ] = UNSEEN if nest : output_map = pixelfunc . reorder ( output_map , inp = None , out = None , r2n = True , n2r = False ) return output_map