@staticmethod
def _get_map_type(hdu_list, hdu_name):
    """Infer map type from a FITS HDU.

        Only read header, never data, to have good performance.
        """
    if hdu_name is None:
        header = hdu_list[0].header
        if header['NAXIS'] == 0:
            header = hdu_list[1].header
    else:
        header = hdu_list[hdu_name].header
    if 'PIXTYPE' in header and header['PIXTYPE'] == 'HEALPIX':
        return 'hpx'
    else:
        return 'wcs'
