/[PAMELA software]/DarthVader/OrbitalInfo/src/OrbitalInfo.cpp
ViewVC logotype

Contents of /DarthVader/OrbitalInfo/src/OrbitalInfo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Wed Oct 1 15:25:44 2008 UTC (16 years, 2 months ago) by mocchiut
Branch: MAIN
Changes since 1.10: +33 -43 lines
Orientation infos added to OrbitalInfo, OrbitalInfo class changed, small changes in the Makefile

1 #include <OrbitalInfo.h>
2
3 using namespace std;
4
5 ClassImp(OrbitalInfoTrkVar);
6 ClassImp(OrbitalInfo);
7
8 OrbitalInfoTrkVar::OrbitalInfoTrkVar(){
9 this->Clear();
10 }
11
12 void OrbitalInfoTrkVar::Clear(Option_t *t){
13 trkseqno = 0;
14 pitch = -1000.;
15 }
16
17
18 OrbitalInfo::OrbitalInfo(){
19 OrbitalInfoTrk = 0; //ELENA
20 this->Clear();
21 }
22
23 void OrbitalInfo::Delete(Option_t *t){ //ELENA
24 //
25 if(OrbitalInfoTrk){
26 OrbitalInfoTrk->Delete(); //ELENA
27 delete OrbitalInfoTrk; //ELENA
28 }
29 //
30 }; //ELENA
31
32 void OrbitalInfo::Set(){//ELENA
33 if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA
34 }//ELENA
35
36
37 void OrbitalInfo::Clear(Option_t *t){
38 //
39 if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
40 //
41 absTime = 0;
42 OBT = 0;
43 pkt_num = 0;
44
45 lon = -1000.;
46 lat = -1000.;
47 alt = -1000.;
48
49 Bnorth = -1000.;
50 Beast = -1000.;
51 Bdown = -1000.;
52 Babs = -1000.;
53 BB0 = -1000.;
54 L = -1000.;
55
56 londip = -1000.;
57 latdip = -1000.;
58 altdip = -1000.;
59
60 loncgm = -1000.;
61 latcgm = -1000.;
62 altcgm = -1000.;
63
64 loncbm = -1000.;
65 latcbm = -1000.;
66 altcbm = -1000.;
67
68 std::fill_n(cutoff, 20, 0.);
69
70 // Quaternions
71 q0 = -1000.;
72 q1 = -1000.;
73 q2 = -1000.;
74 q3 = -1000.;
75
76 // Euler angles (nadir reference frame)
77 theta = -1000.;
78 phi = -1000.;
79 etha = -1000.;
80
81 // Euler angles (local field reference frame)
82 // thetamag = -1000.;
83 // phimag = -1000.;
84 // ethamag = -1000.;
85
86 pamzenitangle = -1000.;
87 pamBangle = -1000.;
88
89
90 mode = 0;
91 // std::fill_n(goodAttitude, 5, 0);
92 }
93
94 /**
95 * Fills a struct cOrbitalInfo with values from a OrbitalInfo object (to put data into a F77 common).
96 */
97 void OrbitalInfo::GetLevel2Struct(cOrbitalInfo *l2) const{
98 l2->abstime = absTime;
99 l2->obt = OBT;
100 l2->pkt_num = pkt_num;
101
102 l2->lon = lon;
103 l2->lat = lat;
104 l2->alt = alt;
105
106 l2->Bnorth = Bnorth;
107 l2->Beast = Beast;
108 l2->Bdown = Bdown;
109 l2->Babs = Babs;
110 l2->BB0 = BB0;
111 l2->L = L;
112
113 l2->londip = londip;
114 l2->latdip = latdip;
115 l2->altdip = altdip;
116
117 l2->loncgm = loncgm;
118 l2->latcgm = latcgm;
119 l2->altcgm = altcgm;
120
121 l2->loncbm = loncbm;
122 l2->latcbm = latcbm;
123 l2->altcbm = altcbm;
124
125 memcpy(l2->cutoff, cutoff, sizeof(cutoff));
126
127 // Quaternions
128 l2->q0 = q0;
129 l2->q1 = q1;
130 l2->q2 = q2;
131 l2->q3 = q3;
132
133 // Euler angles (nadir reference frame)
134 l2->theta = theta;
135 l2->phi = phi;
136 l2->etha = etha;
137
138 l2->mode = mode;
139 // Euler angles (local field reference frame)
140 // l2->thetamag = thetamag;
141 // l2->phimag = phimag;
142 // l2->ethamag = ethamag;
143
144 // memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
145 }
146
147 void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
148 absTime = l2->abstime;
149 OBT = l2->obt;
150 pkt_num = l2->pkt_num;
151
152 lon = l2->lon;
153 lat = l2->lat;
154 alt = l2->alt;
155
156 l2->Bnorth = Bnorth;
157 l2->Beast = Beast;
158 l2->Bdown = Bdown;
159 l2->Babs = Babs;
160 BB0 = l2->BB0;
161 L = l2->L;
162
163 londip = l2->londip;
164 latdip = l2->latdip;
165 altdip = l2->altdip;
166
167 loncgm = l2->loncgm;
168 latcgm = l2->latcgm;
169 altcgm = l2->altcgm;
170
171 loncbm = l2->loncbm;
172 latcbm = l2->latcbm;
173 altcbm = l2->altcbm;
174
175 memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
176
177 // Quaternions
178 q0 = l2->q0;
179 q1 = l2->q1;
180 q2 = l2->q2;
181 q3 = l2->q3;
182
183 // Euler angles (nadir reference frame)
184 theta = l2->theta;
185 phi = l2->phi;
186 etha = l2->etha;
187
188 mode = l2->mode;
189 // Euler angles (local field reference frame)
190 // thetamag = l2->thetamag;
191 // phimag = l2->phimag;
192 // ethamag = l2->ethamag;
193
194 // memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
195 }
196

  ViewVC Help
Powered by ViewVC 1.1.23