1 | #include "SlaPlanets.h"
|
---|
2 |
|
---|
3 | #include <iostream>
|
---|
4 |
|
---|
5 | #include "slalib.h"
|
---|
6 |
|
---|
7 | ClassImp(SlaPlanets);
|
---|
8 |
|
---|
9 | using namespace std;
|
---|
10 |
|
---|
11 | SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : SlaStars(key), fDt(slaDt(2000.0)/60./60./24.)
|
---|
12 | {
|
---|
13 | }
|
---|
14 |
|
---|
15 | void SlaPlanets::SetMjd(double mjd)
|
---|
16 | {
|
---|
17 | SlaStars::SetMjd(mjd);
|
---|
18 |
|
---|
19 | fTt = GetMjd() + slaDtt(GetMjd())/60./60./24.;
|
---|
20 |
|
---|
21 | //
|
---|
22 | // coordinates of earth: heliocentric, equatoril, J2000
|
---|
23 | //
|
---|
24 | double veb[3]; // barycentric velocity
|
---|
25 | double ceb[3]; // barycentric coordinates
|
---|
26 | double veh[3]; // heliocentric velocity
|
---|
27 |
|
---|
28 | slaEvp(GetMjd() + fDt, 2000.0, veb, ceb, veh, fEarth);
|
---|
29 | }
|
---|
30 |
|
---|
31 | // --------------------------------------------------------------------------
|
---|
32 | //
|
---|
33 | // coordinates of planet: topocentric, equatorial, J2000
|
---|
34 | //
|
---|
35 | RaDec SlaPlanets::CalcPlanetRaDec(ePlanets_t planet)
|
---|
36 | {
|
---|
37 | // coordinates of planet: topocentric, equatorial, J2000
|
---|
38 | double ra, dec, diam;
|
---|
39 |
|
---|
40 | // One can use TT instead of TDB for all planets (except the moon?)
|
---|
41 | // TDB, planet, elong, phi, *ra, *dec, *diam
|
---|
42 | slaRdplan(fTt, planet, GetElong(), GetPhi(), &ra, &dec, &diam);
|
---|
43 |
|
---|
44 | return RaDec(ra, dec);
|
---|
45 | }
|
---|
46 |
|
---|
47 | void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
|
---|
48 | {
|
---|
49 | // coordinates of planet: topocentric, equatorial, J2000
|
---|
50 | const RaDec rd = CalcPlanetRaDec(planet);
|
---|
51 |
|
---|
52 | double az, el;
|
---|
53 | slaDe2h(GetAlpha()-rd.Ra(), rd.Dec(), GetPhi(), &az, &el);
|
---|
54 |
|
---|
55 | fZdAz[planet].Set(TMath::Pi()/2-el, az);
|
---|
56 | }
|
---|
57 |
|
---|