| 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) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.)
|
|---|
| 12 | {
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | SlaPlanets::~SlaPlanets()
|
|---|
| 16 | {
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | void 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 |
|
|---|
| 35 | void 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 | }
|
|---|