def _hcc_hg(self, x, y, z): """Converts hcc coordinates to Stonyhurst heliographic. x - x coordinate in meters y - y coordinate in meters z - z coordinate in meters Calculations taken and shortened from sunpy.wcs. """ cosb = M.cos(M.deg2rad(self.B0)) sinb = M.sin(M.deg2rad(self.B0)) hecr = M.sqrt(x**2 + y**2 + z**2) hgln = M.arctan2(x, z*cosb - y*sinb) \ + M.deg2rad(self.L0) hglt = M.arcsin((y * cosb + z * sinb)/hecr) return hgln*180/np.pi, hglt*180/np.pi