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 | //
|
---|
20 | // coordinates of earth: heliocentric, equatorial, J2000
|
---|
21 | //
|
---|
22 | /*
|
---|
23 | double veb[3]; // barycentric velocity
|
---|
24 | double ceb[3]; // barycentric coordinates
|
---|
25 | double veh[3]; // heliocentric velocity
|
---|
26 |
|
---|
27 | slaEvp(GetMjd() + fDt, 2000.0, veb, ceb, veh, fEarth);
|
---|
28 | */
|
---|
29 | }
|
---|
30 |
|
---|
31 | // --------------------------------------------------------------------------
|
---|
32 | //
|
---|
33 | // coordinates of planet: topocentric, equatorial, J2000
|
---|
34 | //
|
---|
35 | RaDec SlaPlanets::CalcPlanetRaDec(ePlanets_t planet) const
|
---|
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(GetTT(), planet, GetElong(), GetPhi(), &ra, &dec, &diam);
|
---|
43 |
|
---|
44 | //
|
---|
45 | // ---- apparent to mean ----
|
---|
46 | //
|
---|
47 | // This is a stupid workaround because SlaStars assumes
|
---|
48 | // RA/DEC to be mean values rather than apparent
|
---|
49 | //
|
---|
50 | double rm=0, dm=0;
|
---|
51 | slaAmpqk (ra, dec, (double*)fAmprms, &rm, &dm);
|
---|
52 |
|
---|
53 | return RaDec(rm, dm);
|
---|
54 | }
|
---|
55 |
|
---|
56 | void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
|
---|
57 | {
|
---|
58 | // coordinates of planet: topocentric, equatorial, J2000
|
---|
59 | const RaDec rd = CalcPlanetRaDec(planet);
|
---|
60 |
|
---|
61 | double az, el;
|
---|
62 | slaDe2h(GetAlpha()-rd.Ra(), rd.Dec(), GetPhi(), &az, &el);
|
---|
63 |
|
---|
64 | fZdAz[planet].Set(TMath::Pi()/2-el, az);
|
---|
65 | }
|
---|
66 |
|
---|