From a13aa0b9e3f59078e5e049c0f70974e7a465f78b Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 26 Feb 2016 09:45:06 +0100 Subject: [PATCH] Add HowTo for sky coordinate transformation. --- doc/source/howto/sky.rst | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/doc/source/howto/sky.rst b/doc/source/howto/sky.rst index 90cc081..1c85a56 100644 --- a/doc/source/howto/sky.rst +++ b/doc/source/howto/sky.rst @@ -1,6 +1,37 @@ -Sky maps, sky coordinates and sky regions +Sky coordinates, sky maps and sky regions ----------------------------------------- +How to convert a sky coordinate from celestial to Galactic? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To convert from celestial to Galactic coordinates you can set a sky +direction in celestial coordinates and read it back in Galactic +coordinates. + +Python: + +.. code-block:: python + + >>> import gammalib + >>> dir=gammalib.GSkyDir() + >>> dir.radec_deg(83.63,22.01) + >>> l=dir.l_deg() + >>> b=dir.b_deg() + >>> print(l,b) + (184.55973405309402, -5.7891829467816827) + +C++: + +.. code-block:: cpp + + #include "GammaLib.hpp" + GSkyDir dir; + dir.radec_deg(83.63,22.01); + double l = dir.l_deg(); + double b = dir.b_deg(); + std::cout << l << ", " << b << std::endl; + + How to convert sky map projections? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- libgit2 0.21.4