source: trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc@ 9195

Last change on this file since 9195 was 8376, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 1.1 KB
Line 
1#include "SlaPlanets.h"
2
3#include <iostream>
4
5#include "slalib.h"
6
7ClassImp(SlaPlanets);
8
9using namespace std;
10
11SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.)
12{
13}
14
15SlaPlanets::~SlaPlanets()
16{
17}
18
19void SlaPlanets::SetMjd(double mjd)
20{
21 Slalib::SetMjd(mjd);
22
23 fTt = GetMjd() + slaDtt(GetMjd())/60./60./24.;
24
25 //
26 // coordinates of earth: heliocentric, equatoril, J2000
27 //
28 double veb[3]; // barycentric velocity
29 double ceb[3]; // barycentric coordinates
30 double veh[3]; // heliocentric velocity
31
32 slaEvp(GetMjd() + fDt, 2000.0, veb, ceb, veh, fEarth);
33}
34
35void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
36{
37 //
38 // coordinates of planet: topocentric, equatorial, J2000
39 //
40 double ra, dec, diam;
41
42 // One can use TT instead of TDB for all plenets
43 // (except the moon)
44 // TDB, planet, elong, phi, *ra, *dec, *diam
45 slaRdplan(fTt, planet, GetElong(), GetPhi(), &ra, &dec, &diam);
46
47 double az, el;
48 slaDe2h(GetAlpha()-ra, dec, GetPhi(), &az, &el);
49
50 fZdAz[planet].Set(TMath::Pi()/2-el, az);
51}
Note: See TracBrowser for help on using the repository browser.