def clean_pixels(maplike,sampler,d_params=None,**sampler_args):
    """ Function to combine a given MapLike likelihood object and a given
    sampler.

    Parameters
    ----------
    maplike: MapLike
        Instance of the Maplike method.
    sampler: function
        Which sampling function to be used.
    d_params: (list(float))
        Expected width for each parameter (pass None if no idea).
    sampler_args: dict
        Keyword arguments containing hyperparameters specific to whichever
        sampler was chosen.

    Returns
    -------
    list(array_like(float))
        List of MCMC chains corresponding to the pixels in `ipix`.
    """
    outputs=sampler(maplike.marginal_spectral_likelihood,
                    pos0=maplike.var_prior_mean,
                    dpos=d_params,
                    **sampler_args)
    return outputs