-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathClass_Iono.h
314 lines (224 loc) · 10.7 KB
/
Class_Iono.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
/*-------------------------------------------------------------------
Purpose: C++ Class to compute second and third order ionospheric effects
-------------------------------------------------------------------
Author: Haroldo Antonio Marques
Programa de Pos-Graduacao em Ciencias Cartograficas
FCT/UNESP - Presidente Prudente - SP, Brazil
FAPESP PROCESS: 05/03522-1
Date: July of 2007
-------------------------------------------------------------------
Observation:
-------------------------------------------------------------------*/
//c::1304.13, SAH, change path, use one directory for all *.cpp/*.h files
//c::1304.13, SAH, comment out geodcgeomag()
//------------------------------------------------------------------------------------
#ifndef CLASSIONO_H
#define CLASSIONO_H
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <stdlib.h>
#include <iomanip>
#include <ios>
//#include ".\IGRF11\IGRF11.h"
//#include "fortran.h" //Class to mix C/C++ and Fortran (available at: http://arnholm.org/software/index.htm)
//#include "../IGRF11/Class_IGRF11.h"
#include "Class_IGRF11.h"
using namespace std;
using namespace IGRF11;
//for linux compiling C/C++ and fortran together
//extern "C" void geodcgeomag_ (int *day, float *ut, float *lat, float *lon,
// float *mlat, float *mlon, float *mlt, int *ler);
//for Windows DLL
//extern "C" __declspec(dllimport) void _stdcall GEODCGEOMAG( int *DAY,float *UT,float *LAT, float *LON,
// float *MLAT,float *MLON,float *MLT,int *ler);
namespace CIONO{
class Class_Iono : public Class_IGRF11{
public:
//---- added by SH
void azelIPP(double staX, double staY, double staZ,
double svX, double svY, double svZ,
double Re, double htIono,
double *az, double *elv, double *dist,
double *pplat, double *pplon, double *zp);
int xyz_to_geod ( double a, double finv, double x, double y, double z,
double *dlat, double *dlon, double *h);
void xyzIPP(double staX, double staY, double staZ,
double svX, double svY, double svZ,
double Re, double htIono,
double *xipp, double *yipp, double *zipp);
//---- added by SH
double zl,Elevm,Azm, //zenith, elevation and azimuth angle (geomagnetic system)
Az,El,Zen, //zenith, elevation and azimuth angle(Terrestrial system)
var_I2_L1,
var_I2_L2;
//Class iono constructor
Class_Iono( double phi_pn_mag = 79.8, //magnetic north pole latitude
double long_pn_mag = 288.1, //magnetic north pole longitude
double h_ion = 450000.0, //ionospheric layer height (m)
double R_e = 6371000.0, //Equatorial Earth axis
double B_eq = 3.12E-05, //Geomagnetic induction magnitude at equator (Tesla)
double Ne_max_in = 3.0e12); //Electrons Density Maximum
~Class_Iono();//destructor
//transform to geomagnetic e compute ionospheric effects
void Calc_Iono( double TEC,int read_tec, int MJD,double fracOfDay,
double Xs,double Ys,double Zs,
double Xest,double Yest,double Zest,
double lat,double lamb,double h,
const int Geomag_Type,char Name_IGRF_Model[]);
//Cartesianas para Curvilinear coordinates
void Cart_Curv( double x,double y,double z,double &fi,double &lamb,
double &h);
//Curvilinear coordinates to cartesians
void Curv_Cart( double lat,double longi,double h,double &X,
double &Y, double &Z);
//geodetic coordinates of the pierce point
void Pierce_Point_Coord( double Xest,double Yest,double Zest,
double Xsat,double Ysat,double Zsat,
double lat,double lamb, double h);
//Get Methods
double Get_I1_L1(); //first order iono
double Get_I1_L2();
double Get_I1_L5();
double Get_I2_L1(); //Second order iono
double Get_I2_L2();
double Get_I2_L5();
double Get_I3_L1(); //Third order iono
double Get_I3_L2();
double Get_I3_L5();
int Get_year();
int Get_month();
int Get_day();
int Get_dayofyear();
int Get_hour();
int Get_min();
double Get_sec();
//ellipsoide parameters
double Get_Major_Semi_Axis(); //Semi-major axis
double Get_Minor_Semi_Axis(); //semi-minor axis
double Get_f(); //flattenig
double Get_exc(); //excentricity
//magnetic north pole coordenates
double Get_lat_pn_mag();
double Get_lamb_pn_mag();
double Get_lat_ps_mag();
double Get_lamb_ps_mag();
double Get_Re();
double Get_hion();
double Get_Beq();
double Get_f1();
double Get_f2();
double Get_f5();
double Get_lamb_l1();
double Get_lamb_l2();
double Get_lamb_l5();
double Get_c();
double Get_Ne_max();
//Pierce point coordinates
double Get_lat_ion();
double Get_lamb_ion();
double Get_PI();
//Set Methods
void Set_year(int value);
void Set_month(int value);
void Set_day(int value);
void Set_dayofyear(int value);
void Set_hour(int value);
void Set_min(int value);
void Set_sec(double value);
void Set_I1_L1(double value); //first order iono
void Set_I1_L2(double value);
void Set_I1_L5(double value);
void Set_I2_L1(double value); //Second order iono
void Set_I2_L2(double value);
void Set_I2_L5(double value);
void Set_I3_L1(double value); //Third order iono
void Set_I3_L2(double value);
void Set_I3_L5(double value);
//ellipsoid parameters
void Set_Major_Semi_Axis(double value);
void Set_Minor_Semi_Axis(double value);
void Set_f(double value);
void Set_exc(double value);
void Set_lat_pn_mag(double value);
void Set_lamb_pn_mag(double value);
void Set_lat_ps_mag(double value);
void Set_lamb_ps_mag(double value);
void Set_Re(double value);
void Set_hion(double value);
void Set_Beq(double value);
void Set_f1(double value);
void Set_f2(double value);
void Set_f5(double value);
void Set_lamb_l1(double value);
void Set_lamb_l2(double value);
void Set_lamb_l5(double value);
void Set_c(double value);
void Set_Ne_max(double value);
private:
void Local_Terrestrial_Vector(double Xest,double Yest,double Zest);
void Project_Vector( double Xs,double Ys,double Zs,
double Xest,double Yest,double Zest,
double lat,double lamb,double h,
double Nm,double Em,double Um,
double &V_proj);
void Ang_Local( double E, double N, double U,
double &Am, double &Em, double &Zm);
double BtJ(double lat_ion_m,double z_m,double a_m);
void Calcula_N(double lat,double &N);
void Cart_Geomag(double Xest,double Yest, double Zest,
double &Xm,double &Ym,double &Zm);
void cart_local (double xestacao,double yestacao,double zestacao,
double xorigem, double yorigem,double zorigem,
double &e,double &n,double &u,double a,double f);
void CartEsfeGeoc_CartGeod(double XEsf,double YEsf,double ZEsf,double quisi,
double &XGeod,double &YGeod,double &ZGeod);
void Curv_EsfeGeoc_Cart(double lat_geoc,double long_geoc,double R,
double &XEsf,double &YEsf,double &ZEsf);
void Geod_Dipolo(double lat,double lamb,double &latdip,double &lambdip);
//First order ionospheric effect
void Iono_First_Order(double TEC); //Not in use
//Second order ionospheric effect
void Iono_Second_Order(double TEC,double BtJ);
//Third order ionospheric effect
void Iono_Third_Order(double TEC);
//Geodetic latitude in geocentric and vice-versa
void Lat_Geod_Geoc(double &lat_geod,double &lat_geoc,int op);
//transform to local system
void Sist_Local(double xest,double yest,double zest,
double xsat,double ysat,double zsat,
double fi, double lambda,
double &e,double &n,double &u);
double I1_L1,I1_L2,I1_L5, //first order iono
I2_L1,I2_L2,I2_L5, //Second order iono
I3_L1,I3_L2,I3_L5; //Third order iono
double lat_ion,lamb_ion; //Pierce point coordinates
//ellipsoid parameters
double a, //semi-major axis
b, //semi-minor axis
f, //flattening
exc, //excentricity
//north pole magnetic
lat_pn_mag,lamb_pn_mag,
lat_ps_mag,lamb_ps_mag,
Re, //Equatorial Earth axis
hion, //ionospheric layer height (m)
Beq, //Geomagnetic induction magnitude at equator (Tesla)
f1,f2,f5,lamb_l1,lamb_l2,lamb_l5, //frequencies and wavelenghts
c,Ne_max;
double pi;
int year,
month,
day,
dayofyear,
hour,
min;
double sec;
double Et[3],Nt[3],Ut[3];
bool Compute_Terr_Local;
};
}//namespace CIONO
#endif
//------------------------------------------------------------------------------------