gammapy/maps/hpx.py
def _get_ref_dir(self):
        """Compute the reference direction for this geometry."""
        import healpy as hp

        if self.region == "explicit":
            idx = unravel_hpx_index(self._ipix, self._maxpix)
            nside = self._get_nside(idx)
            vec = hp.pix2vec(nside, idx[0], nest=self.nest)
            vec = np.array([np.mean(t) for t in vec])
            lonlat = hp.vec2ang(vec, lonlat=True)
            return SkyCoord(lonlat[0], lonlat[1], frame=self.frame, unit="deg")

        return get_hpxregion_dir(self.region, self.frame)
Compute the reference direction for this geometry.
Compute the reference direction for this geometry.
Compute the reference direction for this geometry .
def _get_ref_dir(self):
        import healpy as hp
        if self.region == "explicit":
            idx = unravel_hpx_index(self._ipix, self._maxpix)
            nside = self._get_nside(idx)
            vec = hp.pix2vec(nside, idx[0], nest=self.nest)
            vec = np.array([np.mean(t) for t in vec])
            lonlat = hp.vec2ang(vec, lonlat=True)
            return SkyCoord(lonlat[0], lonlat[1], frame=self.frame, unit="deg")
        return get_hpxregion_dir(self.region, self.frame)
def _get_ref_dir ( self ) : import healpy as hp if self . region == "explicit" : idx = unravel_hpx_index ( self . _ipix , self . _maxpix ) nside = self . _get_nside ( idx ) vec = hp . pix2vec ( nside , idx [ 0 ] , nest = self . nest ) vec = np . array ( [ np . mean ( t ) for t in vec ] ) lonlat = hp . vec2ang ( vec , lonlat = True ) return SkyCoord ( lonlat [ 0 ] , lonlat [ 1 ] , frame = self . frame , unit = "deg" ) return get_hpxregion_dir ( self . region , self . frame )
Compute the reference direction for this geometry.
Compute the reference direction for this geometry .
"""Compute the reference direction for this geometry."""
self