MaglibWarpper.hh
2.82 KB
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: MaglibWarper.hh
* Author: hacene
*
* Created on July 21, 2020, 1:16 PM
*/
#ifndef MAGLIBWARPER_HH
#define MAGLIBWARPER_HH
#include "maglib.hh"
namespace AMDA {
namespace Parameters {
namespace maglib {
class maglibWarpper {
public:
static void getPosmag(int iyear, int imonth, int iday, int ihour, int imin, int isec, float& rrmag, float& thetr, float& phir,
int& isatex, int& magout, float& xgsm, float& ygsm, float& zgsm, float& xgse, float& ygse, float& zgse, float& tgl,
float& flg, float& xlambr, float& tglc, float& hsl, float& clatgmr, float& clongmr, std::vector<int>& iposmg, int& ifail) {
/**
*
* @param iyear enre 2000 et 2015
* @param imonth
* @param iday
* @param ihour
* @param imin
* @param isec
* @param rrmag distance radiale geocentrique (rayons terrestres)
* @param thetr colatitude geocentrique (radians)
* @param phir longitude geocentrique (radians)
* @param isatex : 0 = satellite proche (apogee < 8. r. terre.)
i * isatex : 1 = satellite excentrique (apogee > 8. r. terre.)
*/
// declaration
int iposmg_size =15;
int iposmg_o [iposmg_size];
memset(iposmg_o, 0, iposmg_size * sizeof (int));
float rig[3][3], rgi[3][3], rgsm[3][3], rsmg[3][3], rggsm[3][3], rgsmg[3][3], rgse[3][3], rseg[3][3];
float rgdip[3][3], rdipg[3][3], rigsm[3][3], rgsmi[3][3];
float alfag, alfas, deltas, tilt, tetdip, phidip, year;
valfix_(&ifail);
inigeom_(&iyear, &imonth, &iday, &ihour, &imin, &isec, year, &alfag, &tetdip, &phidip, &alfas, &deltas, rig, rgi, rgdip, rdipg, rgsm,
rsmg, &tilt, rggsm, rgsmg, rgse, rseg, rigsm, rgsmi, &ifail);
posmag_(&magout, &isatex, &year, &rrmag, &thetr, &phir, &alfag, &alfas, &deltas, &tilt, rgsm, rggsm, rgsmg, rgdip, rgse, &tetdip,
&phidip, &xgsm, &ygsm, &zgsm, &xgse, &ygse, &zgse, &tgl, &flg, &xlambr, &tglc, &hsl, &clatgmr, &clongmr, iposmg_o, &ifail);
for (int i = 0; i < iposmg_size; i++)
iposmg[i] = iposmg_o[i];
}
};
}
}
}
#endif /* MAGLIBWARPER_HH */