| 1 | #include "SlaPlanets.h"
|
|---|
| 2 |
|
|---|
| 3 | #include <iostream.h>
|
|---|
| 4 |
|
|---|
| 5 | #include "slalib.h"
|
|---|
| 6 |
|
|---|
| 7 | ClassImp(SlaPlanets);
|
|---|
| 8 |
|
|---|
| 9 | SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.)
|
|---|
| 10 | {
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | SlaPlanets::~SlaPlanets()
|
|---|
| 14 | {
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | void 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 |
|
|---|
| 33 | void 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 | }
|
|---|