source: trunk/MagicSoft/Cosy/catalog/Slalib.cc@ 1858

Last change on this file since 1858 was 1758, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 720 bytes
Line 
1#include "Slalib.h"
2
3#include <time.h>
4#include <iostream.h> // cout
5
6#include "coord.h"
7
8#include "slalib.h"
9
10ClassImp(Slalib);
11
12Slalib::Slalib(MObservatory::LocationName_t key) : Timer(), MObservatory(key)
13{
14}
15
16Slalib::~Slalib()
17{
18}
19
20void Slalib::SetMjd(double mjd)
21{
22 Timer::SetMjd(mjd);
23 fAlpha = slaGmst(mjd) + GetElong();
24}
25
26ZdAz Slalib::XYZ2ZdAz(double coord[3]) const
27{
28 //
29 // -- xyz to spherical coordinates --
30 //
31 double ra, dec;
32 slaDcc2s(coord, &ra, &dec);
33
34 //
35 // radec[rad] -> hadec[rad]
36 //
37 const double ha = fAlpha-ra;
38
39 //
40 // hadec[rad] -> altaz[rad]
41 //
42 double alt, az;
43 slaDe2h(ha, dec, GetPhi(), &az, &alt);
44
45 return ZdAz(kPiDiv2-alt, az);
46}
Note: See TracBrowser for help on using the repository browser.