read_map(filename, field=0, dtype=<class 'numpy.float64'>, nest=False, partial=False, hdu=1, h=False, verbose=True, memmap=False)¶
Read a healpix map from a fits file. Partial-sky files, if properly identified, are expanded to full size and filled with UNSEEN.
- filenamestr or HDU or HDUList or pathlib.Path instance
the fits file name
- fieldint 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.
- dtypedata 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. If None, keep the dtype of the input FITS file Default: use np.float64 (WARNING: in a future version this will change to “use the data type of the input FITS file”.)
- nestbool, 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.
- partialbool, 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.
- hduint, optional
the header number to look at (start at 0)
- hbool, optional
If True, return also the header. Default: False.
- verbosebool, optional
If True, print a number of diagnostic messages
- memmapbool, 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.
- 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.