healpy.fitsfunc.read_map

healpy.fitsfunc.read_map(filename, field=0, dtype=<type 'numpy.float64'>, nest=False, partial=False, hdu=1, h=False, verbose=True, memmap=False)

Read an healpix map from a fits file. Partial-sky files, if properly identified, are expanded to full size and filled with UNSEEN.

Parameters:

filename : str or HDU or HDUList

the fits file name

field : int or tuple of int, or None, optional

The column to read. Default: 0. By convention 0 is temperature, 1 is Q, 2 is U. Field can be a tuple to read multiple columns (0,1,2) If the fits file is a partial-sky file, field=0 corresponds to the first column after the pixel index column. If None, all columns are read in.

dtype : data type or list of data types, optional

Force the conversion to some type. Passing a list allows different types for each field. In that case, the length of the list must correspond to the length of the field parameter. Default: np.float64

nest : bool, optional

If True return the map in NEST ordering, otherwise in RING ordering; use fits keyword ORDERING to decide whether conversion is needed or not If None, no conversion is performed.

partial : bool, optional

If True, fits file is assumed to be a partial-sky file with explicit indexing, if the indexing scheme cannot be determined from the header. If False, implicit indexing is assumed. Default: False. A partial sky file is one in which OBJECT=PARTIAL and INDXSCHM=EXPLICIT, and the first column is then assumed to contain pixel indices. A full sky file is one in which OBJECT=FULLSKY and INDXSCHM=IMPLICIT. At least one of these keywords must be set for the indexing scheme to be properly identified.

hdu : int, optional

the header number to look at (start at 0)

h : bool, optional

If True, return also the header. Default: False.

verbose : bool, optional

If True, print a number of diagnostic messages

memmap : bool, optional

Argument passed to astropy.io.fits.open, if True, the map is not read into memory, but only the required pixels are read when needed. Default: False.

Returns:

m | (m0, m1, ...) [, header] : array or a tuple of arrays, optionally with header appended

The map(s) read from the file, and the header if h is True.