next up previous contents
Next: Function: equatorial_to_horizon() Up: Galactic Modelling Previous: Function: galactic_to_equatorial()   Contents

Example: galactic2equatorial program

This is a simple implementation of the function galactic_to_equatorial() that converts a specified Galactic longitude and latitude to right ascension and declination (epoch 1950). The Galactic coordinates are entered in decimal degrees as command line arguments. Some examples:

  1. The North Galactic pole is $b=90^\circ$, or $\alpha_{1950}=12^{\mathrm{\scriptstyle h}}49^{\mathrm{\scriptstyle m}}$ and $\delta_{1950}=+27^\circ24'$. The output of the command galactic2equatorial 0 90 is
    l   (deg):   0.00
    b   (deg): +90.00
    RA  (hms):  12 48 59
    Dec (dms): +27 23 59
  2. The Galactic center is $\ell=b=0$, or $\alpha_{1950}=17^{\mathrm{\scriptstyle h}}42^{\mathrm{\scriptstyle m}}
24^{\mathrm{\scriptstyle s}}$ and $\delta_{1950}=-28^\circ55'$. The output of the command galactic2equatorial 0 0 is
    l   (deg):   0.00
    b   (deg):  +0.00
    RA  (hms):  17 42 26
    Dec (dms): -28 55 00
  3. The Large Magellanic Cloud is $\ell=280\makebox[\deglen]{\makebox[0pt]{$^\circ$}\makebox[0pt]{.}}5$ and $b=-32\makebox[\deglen]{\makebox[0pt]{$^\circ$}\makebox[0pt]{.}}9$, or $\alpha_{2000}=05^{\mathrm{\scriptstyle h}}23^{\mathrm{\scriptstyle m}}
34\makebox[\seclen]{\makebox[0pt]{$^{\mathrm{\scriptstyle s}}$}\makebox[0pt]{.}}598$ and $\delta_{2000}=-69^\circ45'22\makebox[\arcseclen]{\makebox[0pt]{$''$}\makebox[0pt]{.}}33$. The output of the command galactic2equatorial 280.5 -32.9 is
    l   (deg): 280.50
    b   (deg): -32.90
    RA  (hms):  05 23 48
    Dec (dms): -69 49 36
These examples show that the output is correct to the accuracy of the input coordinates.

Jolien Creighton,


Bruce Allen 2000-11-19