gammapy/maps/hpx.py
def to_header(self, format="gadf", **kwargs):
        """Build and return FITS header for this HEALPIX map."""
        header = fits.Header()
        format = kwargs.get("format", HPX_FITS_CONVENTIONS[format])

        # FIXME: For some sparse maps we may want to allow EXPLICIT
        # with an empty region string
        indxschm = kwargs.get("indxschm", None)

        if indxschm is None:
            if self._region is None:
                indxschm = "IMPLICIT"
            elif self.is_regular == 1:
                indxschm = "EXPLICIT"
            else:
                indxschm = "LOCAL"

        if "FGST" in format.convname.upper():
            header["TELESCOP"] = "GLAST"
            header["INSTRUME"] = "LAT"

        header[format.frame] = frame_to_coordsys(self.frame)
        header["PIXTYPE"] = "HEALPIX"
        header["ORDERING"] = self.ordering
        header["INDXSCHM"] = indxschm
        header["ORDER"] = np.max(self._order)
        header["NSIDE"] = np.max(self._nside)
        header["FIRSTPIX"] = 0
        header["LASTPIX"] = np.max(self._maxpix) - 1
        header["HPX_CONV"] = format.convname.upper()

        if self.frame == "icrs":
            header["EQUINOX"] = (2000.0, "Equinox of RA & DEC specifications")

        if self.region:
            header["HPX_REG"] = self._region

        return header
Build and return FITS header for this HEALPIX map.
Build and return FITS header for this HEALPIX map.
Build and return FITS header for this HEALPIX map .
def to_header(self, format="gadf", **kwargs):
        header = fits.Header()
        format = kwargs.get("format", HPX_FITS_CONVENTIONS[format])
        indxschm = kwargs.get("indxschm", None)
        if indxschm is None:
            if self._region is None:
                indxschm = "IMPLICIT"
            elif self.is_regular == 1:
                indxschm = "EXPLICIT"
            else:
                indxschm = "LOCAL"
        if "FGST" in format.convname.upper():
            header["TELESCOP"] = "GLAST"
            header["INSTRUME"] = "LAT"
        header[format.frame] = frame_to_coordsys(self.frame)
        header["PIXTYPE"] = "HEALPIX"
        header["ORDERING"] = self.ordering
        header["INDXSCHM"] = indxschm
        header["ORDER"] = np.max(self._order)
        header["NSIDE"] = np.max(self._nside)
        header["FIRSTPIX"] = 0
        header["LASTPIX"] = np.max(self._maxpix) - 1
        header["HPX_CONV"] = format.convname.upper()
        if self.frame == "icrs":
            header["EQUINOX"] = (2000.0, "Equinox of RA & DEC specifications")
        if self.region:
            header["HPX_REG"] = self._region
        return header
def to_header ( self , format = "gadf" , ** kwargs ) : header = fits . Header ( ) format = kwargs . get ( "format" , HPX_FITS_CONVENTIONS [ format ] ) indxschm = kwargs . get ( "indxschm" , None ) if indxschm is None : if self . _region is None : indxschm = "IMPLICIT" elif self . is_regular == 1 : indxschm = "EXPLICIT" else : indxschm = "LOCAL" if "FGST" in format . convname . upper ( ) : header [ "TELESCOP" ] = "GLAST" header [ "INSTRUME" ] = "LAT" header [ format . frame ] = frame_to_coordsys ( self . frame ) header [ "PIXTYPE" ] = "HEALPIX" header [ "ORDERING" ] = self . ordering header [ "INDXSCHM" ] = indxschm header [ "ORDER" ] = np . max ( self . _order ) header [ "NSIDE" ] = np . max ( self . _nside ) header [ "FIRSTPIX" ] = 0 header [ "LASTPIX" ] = np . max ( self . _maxpix ) - 1 header [ "HPX_CONV" ] = format . convname . upper ( ) if self . frame == "icrs" : header [ "EQUINOX" ] = ( 2000.0 , "Equinox of RA & DEC specifications" ) if self . region : header [ "HPX_REG" ] = self . _region return header
Build and return FITS header for this HEALPIX map.
Build and return FITS header for this HEALPIX map .
"""Build and return FITS header for this HEALPIX map.""" # FIXME: For some sparse maps we may want to allow EXPLICIT # with an empty region string
self
format