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

Annotation of /DarthVader/OrbitalInfo/src/OrbitalInfo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Thu Nov 30 15:46:45 2006 UTC (18 years ago) by pam-rm2
Branch: MAIN
CVS Tags: v2r01, v3r00
Changes since 1.5: +172 -1 lines
Modified OrbitalInfo class and structure to hold magnetic and quaterions stuff.

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

  ViewVC Help
Powered by ViewVC 1.1.23