Blame view

src/ExternLib/Maglib/MaglibWarpper.hh 2.82 KB
0b31214e   Hacene SI HADJ MOHAND   Maglib
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
/*
 * 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:

afa22fae   Hacene SI HADJ MOHAND   presque
26
27
                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,
6308a1c0   Hacene SI HADJ MOHAND   compil presue
28
                        float& flg, float& xlambr, float& tglc, float& hsl, float& clatgmr, float& clongmr, std::vector<int>& iposmg, int& ifail) {
0b31214e   Hacene SI HADJ MOHAND   Maglib
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
                    /**
                     * 
                     * @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 
6308a1c0   Hacene SI HADJ MOHAND   compil presue
44
45
46
                    int iposmg_size =15;
                    int iposmg_o [iposmg_size];
                    memset(iposmg_o, 0, iposmg_size * sizeof (int));
0b31214e   Hacene SI HADJ MOHAND   Maglib
47
48
49

                    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];
d7cb2fe5   Hacene SI HADJ MOHAND   progress
50
                    float alfag, alfas, deltas, tilt, tetdip, phidip, year;
afa22fae   Hacene SI HADJ MOHAND   presque
51

6308a1c0   Hacene SI HADJ MOHAND   compil presue
52
53
54
                    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);
0b31214e   Hacene SI HADJ MOHAND   Maglib
55

6308a1c0   Hacene SI HADJ MOHAND   compil presue
56
57
                    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);
afa22fae   Hacene SI HADJ MOHAND   presque
58

6308a1c0   Hacene SI HADJ MOHAND   compil presue
59
                    for (int i = 0; i < iposmg_size; i++)
afa22fae   Hacene SI HADJ MOHAND   presque
60
                        iposmg[i] = iposmg_o[i];
0b31214e   Hacene SI HADJ MOHAND   Maglib
61
62
63
64
65
66
67
                }
            };

        }
    }
}
#endif /* MAGLIBWARPER_HH */