def nside_for_nbsrc(nbsrc):
    """
    Chooses the best suited NSIDE value according
    to the number of sources
    """
    if nbsrc>1e8:
        return 256
    elif nbsrc>1e7:
        return 128
    elif nbsrc>1e6:
        return 64
    else:
        return 32