MaglibWarpper.hh 3.11 KB
/*
 * 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  getMLT(float & tgl){
                    mlt_calculation_(&tgl);
                }

                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, int iposmg[15], 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 

                    float rig[3][3] = {0.0};
                    float rgi[3][3] = {0.0};
                    float rgsm[3][3] = {0.0};
                    float rsmg[3][3] = {0.0};
                    float rggsm[3][3] = {0.0};
                    float rgsmg[3][3] = {0.0};
                    float rgse[3][3] = {0.0};
                    float rseg[3][3] = {0.0};
                    float rgdip[3][3] = {0.0};
                    float  rdipg[3][3] = {0.0};
                    float rigsm[3][3] = {0.0};
                    float rgsmi[3][3] = {0.0};
                    float alfag, alfas, deltas, tilt, tetdip, phidip, year;

                    valfix_(&ifail);
                    
                    inigeom_modified_(&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, &ifail);
                    
                   
                }
            };

        }
    }
}
#endif /* MAGLIBWARPER_HH */