source: trunk/Cosy/catalog/SlaPlanets.cc@ 16547

Last change on this file since 16547 was 10021, checked in by tbretz, 14 years ago
Added conversion from apparent to mean place for celestial objects to get the meaning of Ra/Dec consistent with the ones in the base classes.
File size: 1.6 KB
Line 
1#include "SlaPlanets.h"
2
3#include <iostream>
4
5#include "slalib.h"
6
7ClassImp(SlaPlanets);
8
9using namespace std;
10
11SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : SlaStars(key)//, fDt(slaDt(2000.0)/60./60./24.)
12{
13}
14
15void 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//
35RaDec 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
56void 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
Note: See TracBrowser for help on using the repository browser.