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

Last change on this file since 1757 was 1757, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1#include "SlaPlanets.h"
2
3#include <iostream.h>
4
5#include "slalib.h"
6
7ClassImp(SlaPlanets);
8
9SlaPlanets::SlaPlanets() : Slalib(), fDt(slaDt(2000.0)/60./60./24.)
10{
11}
12
13SlaPlanets::~SlaPlanets()
14{
15}
16
17void SlaPlanets::SetMjd(const double mjd)
18{
19 Slalib::SetMjd(mjd);
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(mjd + fDt, 2000.0, veb, ceb, veh, fEarth);
29}
30
31#include "SlaStars.h"
32
33void SlaPlanets::UpdatePlanetPos(ePlanets_t planet)
34{
35 /*
36 double cp[6] = { 0, 0, 0, 0, 0, 0 };
37
38 double coord[6];
39
40 switch (planet)
41 {
42 case kEMoon:
43 //
44 // -- approximate geocentric pos and vel --
45 //
46 slaDmoon(GetMjd() + fDt, coord);
47 break;
48
49 case kEMercury:
50 case kEVenus:
51 case kEMars:
52 case kEJupiter:
53 case kESaturn:
54 case kEUranus:
55 case kENeptune:
56 case kEPluto:
57 case kESun:
58 {
59 */
60 //
61 // coordinates of planet: heliocentric, equatoril, J2000
62 //
63 double ra,dec,diam;
64 // TDB, planet, elong, phi, *ra, *dec, *diam
65
66 // One can use TT instead of TDB for all plenets
67 // (except the moon)
68
69 const double tt = GetMjd() + slaDtt(GetMjd())/60./60./24.;
70
71 // FIXME: Shell be UT1
72 const double ut1 = fmod(GetMjd(), 1);
73
74 // tt should be tdb, but tt can be used
75 const double tdb = tt + slaRcc(tt, ut1, GetElong(), 8300*cos(GetPhi()), 8300*sin(GetPhi() ))/60./60./24.;
76 /*
77 cout << "Dt: " << slaDtt(GetMjd()) << endl;
78 cout << "Rc: " << slaRcc(tt, ut1, GetElong(), 8300*cos(GetPhi()), 8300*sin(GetPhi() )) << endl;
79 */
80 slaRdplan(tt, planet, GetElong(), GetPhi(),
81 &ra, &dec, &diam);
82 /*
83 switch (planet)
84 {
85 case kEMoon: cout << "Moon: "; break;
86 case kEMercury: cout << "Merkur: "; break;
87 case kEVenus: cout << "Venus: "; break;
88 case kEMars: cout << "Mars: "; break;
89 case kEJupiter: cout << "Jupiter: "; break;
90 case kESaturn: cout << "Saturn: "; break;
91 case kEUranus: cout << "Uranus: "; break;
92 case kENeptune: cout << "Neptun: "; break;
93 case kEPluto: cout << "Pluto: "; break;
94 case kESun: cout << "Sonne: "; break;
95 }
96
97 cout << (int)(ra*12/TMath::Pi()) << "h"<< (int)(ra*12/TMath::Pi()*60)%60 <<"min ";
98 cout << (int)(dec*kRad2Deg) << "deg" << (int)(dec*kRad2Deg*60)%60 << "min" << endl;
99 */
100 /*
101 SlaStars sla;
102 sla.SetMjd(GetMjd());
103 ZdAz za = sla.CalcZdAz(RaDec(ra,dec));
104 cout << za.Zd()*kRad2Deg << " " << fmod(za.Az()*kRad2Deg+720,360.) << endl;
105 fZdAz[planet] = za;
106 */
107
108 double az, el;
109 slaDe2h(GetAlpha()-ra, dec, GetPhi(), &az, &el);
110
111 cout << 90-el*kRad2Deg << " " << fmod(az*kRad2Deg+720,360.) << endl;
112 fZdAz[planet].Set(TMath::Pi()/2-el, az);
113 /*
114 }
115 // !! Fall through!
116 break;
117 case kESun:
118 coord[0] = cp[0] - fEarth[0];
119 coord[1] = cp[1] - fEarth[1];
120 coord[2] = cp[2] - fEarth[2];
121 break;
122 }
123 fZdAz[planet] = XYZ2ZdAz(coord);
124
125 if (planet==kESun)
126 {
127 cout << fZdAz[kESun].Zd()*kRad2Deg << " " << fZdAz[kESun].Az()*kRad2Deg << endl;
128 }*/
129}
Note: See TracBrowser for help on using the repository browser.