(m)
Describe the type of the map (valid, single, sequence of maps).
    Checks : the number of maps, that all maps have same length and that this
    length is a valid map size (using :func:`isnpixok`).

    Parameters
    ----------
    m : sequence
      the map to get info from

    Returns
    -------
    info : int
      -1 if the given object is not a valid map, 0 if it is a single map,
      *info* > 0 if it is a sequence of maps (*info* is then the number of
      maps)

    Examples
    --------
    >>> import healpy as hp
    >>> hp.pixelfunc.maptype(np.arange(12))
    0
    >>> hp.pixelfunc.maptype([np.arange(12), np.arange(12)])
    2
Describe the type of the map (valid, single, sequence of maps).
    Checks : the number of maps, that all maps have same length and that this
    length is a valid map size (using :func:`isnpixok`).
Describe the type of the map ( valid single sequence of maps ) . Checks : the number of maps that all maps have same length and that this length is a valid map size ( using : func : isnpixok ) .
def maptype(m):
    """Describe the type of the map (valid, single, sequence of maps).
    Checks : the number of maps, that all maps have same length and that this
    length is a valid map size (using :func:`isnpixok`).

    Parameters
    ----------
    m : sequence
      the map to get info from

    Returns
    -------
    info : int
      -1 if the given object is not a valid map, 0 if it is a single map,
      *info* > 0 if it is a sequence of maps (*info* is then the number of
      maps)

    Examples
    --------
    >>> import healpy as hp
    >>> hp.pixelfunc.maptype(np.arange(12))
    0
    >>> hp.pixelfunc.maptype([np.arange(12), np.arange(12)])
    2
    """
    if not hasattr(m, "__len__"):
        raise TypeError("input map is a scalar")
    if len(m) == 0:
        raise TypeError("input map has length zero")

    try:
        npix = len(m[0])
    except TypeError:
        npix = None

    if npix is not None:
        for mm in m[1:]:
            if len(mm) != npix:
                raise TypeError("input maps have different npix")
        if isnpixok(len(m[0])):
            return len(m)
        else:
            raise TypeError("bad number of pixels")
    else:
        if isnpixok(len(m)):
            return 0
        else:
            raise TypeError("bad number of pixels")
def maptype ( m ) : if not hasattr ( m , "__len__" ) : raise TypeError ( "input map is a scalar" ) if len ( m ) == 0 : raise TypeError ( "input map has length zero" ) try : npix = len ( m [ 0 ] ) except TypeError : npix = None if npix is not None : for mm in m [ 1 : ] : if len ( mm ) != npix : raise TypeError ( "input maps have different npix" ) if isnpixok ( len ( m [ 0 ] ) ) : return len ( m ) else : raise TypeError ( "bad number of pixels" ) else : if isnpixok ( len ( m ) ) : return 0 else : raise TypeError ( "bad number of pixels" )