Import standard modules:


In [71]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from IPython.display import HTML 
HTML('../style/course.css') #apply general CSS


Out[71]:

Import section specific modules:


In [72]:
from IPython.display import HTML
HTML('../style/code_toggle.html')


Out[72]:
The raw code for this notebook is by default hidden for easier reading. To toggle on/off the raw code, click here.

Direction Cosine Coordinates

There is another useful astronomical coordinate system that we ought to introduce at this juncture, namely the direction cosine coordinate system. The direction cosine coordinate system is quite powerful and allows us to redefine the fundamental reference point on the celestial sphere, from which we measure all other celestial objects, to an arbitrary location (i.e. we can make local sky-maps around our own chosen reference point; the vernal equinox need not be our fundamental reference point). Usually this arbitrary location is chosen to be the celestial source that we are interested in observing. We generally refer to this arbitrary location as the field centre or phase centre.

Note: The direction cosine coordinate system is useful for another reason, when we use it to image interferometric data, then it becomes evident that there exists a Fourier relationship between the sky brightness function and the measurements that an interferometer makes (see Chapter 4 ➞).

We use three coordinates in the direction cosine coordinate system, namely $l$, $m$ and $n$. The coordinates $l$, $m$ and $n$ are dimensionless direction cosines, i.e.

\begin{eqnarray} l &=& \cos(\alpha) = \frac{a_1}{|\mathbf{a}|}\\ m &=& \cos(\beta) = \frac{a_2}{|\mathbf{a}|}\\ n &=& \cos(\gamma) = \frac{a_3}{|\mathbf{a}|} \end{eqnarray}

Figure 3.4.1: Definition of direction cosines.

The quantities $\alpha$, $\beta$, $\gamma$, $a_1$, $a_2$, $a_3$ and $\mathbf{a}$ are all defined in . Moreover, $|\cdot|$ denotes the magnitude of its operand. The definitions above also imply that $l^2+m^2+n^2 = 1$. When $|\mathbf{a}|=1$ then we may simply interpret $l$, $m$ and $n$ as Cartesian coordinates, i.e. we may simply relabel the axes $x$, $y$ and $z$ (in ) to $l$, $m$ and $n$.

So the question now arises, how do we use $l$, $m$ and $n$ to uniquely identify a location on the celestial sphere? The direction cosine coordinate system (and the relationship between it and the celestial coordinate sytem) is depicted in . Note that the $n$-axis points toward the field center (which is denoted by $\boldsymbol{s}_c$ in . It should be clear from that we can use $\mathbf{s} = (l,m,n)$ to uniquely idnetify any location on the celestial sphere.

Figure 3.4.2: The source-celestial pole-field center triangle; which enables us to derive the conversion equations between direction cosine and equatorial coordinates. The red plane represents the fundamental plane of the equatorial coordinate system, while the blue plane represents the fundamental plane of the direction cosine coordinate system. We are able to label the orthogonal fundamental axes of the direction cosine coordinate system $l$,$m$ and $n$, since the radius of the celestial sphere is equal to one.

We use the following equations to convert between the equatorial and direction cosine coordinate systems:

Converting between the equatorial and direction cosine coordinates (3.1)

\begin{eqnarray} l &=& \sin \theta \sin \psi = \cos \delta \sin \Delta \alpha \nonumber\\ m &=& \sin \theta \cos \psi = \sin \delta \cos \delta_0 - \cos \delta \sin \delta_0 \cos\Delta \alpha \nonumber\\ \delta &=& \sin^{-1}(m\cos \delta_0 + \sin \delta_0\sqrt{1-l^2-m^2})\nonumber\\ \alpha &=& \alpha_0 + \tan^{-1}\bigg(\frac{l}{\cos\delta_0\sqrt{1-l^2-m^2}-m\sin\delta_0}\bigg)\nonumber \end{eqnarray}

Note: See Appendix ➞ for the derivation of the above relations.

We can obtain the conversion relations above by applying the spherical trigonemetric identities in $\S$ 2.13 ➞ to the triangle depicted in (the one formed by the source the field center and the NCP).

There is another important interpretation of direction cosine coordinates we should be cognisant of. If we project the direction cosine position vector $\mathbf{s}$ of a celestial body onto the $lm$-plane it's projected length will be equal to $\sin \theta$, where $\theta$ is the angular distance between your field center $\mathbf{s}_c$ and $\mathbf{s}$ measured along the surface of the celestial sphere. If $\theta$ is small we may use the small angle approximation, i.e. $\sin \theta \approx \theta$. The projected length of $\mathbf{s}$ is also equal to $\sqrt{l^2+m^2}$, implying that $l^2+m^2 \approx \theta^2$. We may therefore loosely interpret $\sqrt{l^2+m^2}$ as the angular distance measured between the source at $\mathbf{s}$ and the field-center $\mathbf{s}_c$ measured along the surface of the celestial sphere, i.e. we may measure $l$ and $m$ in $^{\circ}$. The explenation above is graphically illustrated in .

Figure 3.4.3: Why do we measure $l$ and $m$ in degrees?

Three interpretations of direction cosine coordinates

• **Direction cosines**: $l$,$m$ and $n$ are direction cosines

• **Cartesian coordinates**: $l$,$m$ and $n$ are Cartesian coordinates if we work on the unit sphere

Angular distance: $\sqrt{l^2+m^2}$ denotes the angular distance $\theta$, $(l,m,n)$ is from the field center (if $\theta$ is sufficiently small).

Example

Here we have a couple of sources given in RA ($\alpha$) and DEC ($\delta$):

  • Source 1: (5h 32m 0.4s,60$^{\circ}$17' 57'') - 1Jy
  • Source 2: (5h 36m 12.8s,61$^{\circ}$ 12' 6.9'') - 0.5Jy
  • Source 3: (5h 40m 45.5s,61$^{\circ}$ 56' 34'') - 0.2Jy

The field center is located at $(\alpha_0,\delta_0) = $ (5h 30m,60$^{\circ}$). The first step is to convert right ascension and declination into radians with

\begin{eqnarray} \alpha_{\textrm{rad}} &=& \frac{\pi}{12} \bigg(h + \frac{m}{60} + \frac{s}{3600}\bigg)\\ \delta_{\textrm{rad}} &=& \frac{\pi}{180} \bigg(d + \frac{m_{\textrm{arcmin}}}{60}+\frac{s_{\textrm{arcsec}}}{3600}\bigg) \end{eqnarray}

In the above equations $h,~m,~s,~d,~m_{\textrm{arcmin}}$ and $s_{\textrm{arcsec}}$ respectively denote hours, minutes, seconds, degrees, arcminutes and arcseconds. If we apply the above to our three sources we obtain


In [75]:
RA_rad = (np.pi/12) * np.array([5. + 30./60, 5 + 32./60 + 0.4/3600, 5 + 36./60 + 12.8/3600, 5 + 40./60 + 45.5/3600])
DEC_rad = (np.pi/180)*np.array([60., 60. + 17.0/60 + 57./3600, 61. + 12./60 + 6.9/3600, 61 + 56./60 + 34./3600])
Flux_sources_labels = np.array(["", "1 Jy", "0.5 Jy", "0.2 Jy"])
Flux_sources = np.array([1., 0.5, 0.1]) #in Janskys
print "RA (rad) of Sources and Field Center = ", RA_rad
print "DEC (rad) of Sources = ", DEC_rad


RA (rad) of Sources and Field Center =  [ 1.43989663  1.44865237  1.46700741  1.48683872]
DEC (rad) of Sources =  [ 1.04719755  1.05241899  1.06817495  1.08110542]

Recall that we can use to convert between equatorial and direction cosine coordinates, in terms of the current example this translates into the python code below. Note that before we can do the conversion we first need to calculate $\Delta \alpha$.


In [76]:
RA_delta_rad = RA_rad-RA_rad[0] #calculating delta alpha

l = np.cos(DEC_rad) * np.sin(RA_delta_rad)
m = (np.sin(DEC_rad) * np.cos(DEC_rad[0]) - np.cos(DEC_rad) * np.sin(DEC_rad[0]) * np.cos(RA_delta_rad))
print "l (degrees) = ", l*(180./np.pi)
print "m (degrees) = ", m*(180./np.pi)


l (degrees) =  [ 0.          0.24855826  0.74818685  1.26458942]
m (degrees) =  [ 0.          0.30010768  1.21061225  1.96811494]

Plotting the result.


In [77]:
fig = plt.figure()
ax = fig.add_subplot(111)
plt.xlim([-4., 4.])
plt.ylim([-4., 4.])
plt.xlabel("$l$ [degrees]")
plt.ylabel("$m$ [degrees]")
plt.plot(l[0], m[0], "bx")
plt.hold("on")
plt.plot(l[1:]*(180/np.pi), m[1:]*(180/np.pi), "ro")
counter = 1
for xy in zip(l[1:]*(180/np.pi)+0.25, m[1:]*(180/np.pi)+0.25):                                              
    ax.annotate(Flux_sources_labels[counter], xy=xy, textcoords='offset points',horizontalalignment='right',
                verticalalignment='bottom')  
    counter = counter + 1

plt.grid()


/home/trienko/NASSP/fundamentals/lib/python2.7/site-packages/ipykernel/__main__.py:8: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
    Future behavior will be consistent with the long-time default:
    plot commands add elements without first clearing the
    Axes and/or Figure.

Figure 3.4.4:

Future Additions:
  • figure: projection plot similar to white book figure 2-9