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

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