source: trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc@ 9517

Last change on this file since 9517 was 9516, checked in by tbretz, 15 years ago
*** empty log message ***
File size: 1.4 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 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//
35RaDec 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
47void 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
Note: See TracBrowser for help on using the repository browser.