[573] | 1 | // Utilisation des flots d'entree-sortie C++
|
---|
[2322] | 2 | #include <iostream>
|
---|
[573] | 3 |
|
---|
| 4 | #include <math.h>
|
---|
[2615] | 5 | #include "sopnamsp.h"
|
---|
[573] | 6 | #include "nbmath.h"
|
---|
| 7 | // Utilisation de la classe Scan
|
---|
[768] | 8 | #include "sambainit.h"
|
---|
[573] | 9 | #include "scan.h"
|
---|
| 10 | #include "ppersist.h"
|
---|
| 11 | int main()
|
---|
| 12 | {
|
---|
| 13 | // ----- ATTENTION -------
|
---|
[768] | 14 | // Initialisation de Sophya
|
---|
[573] | 15 | // A faire au debut de main()
|
---|
[768] | 16 | SophyaInit();
|
---|
| 17 |
|
---|
[573] | 18 | int nbpix;
|
---|
| 19 | float teta,phi;
|
---|
| 20 | float Ouv,d_tet,Omega[3],fech,T,T0,phi0;
|
---|
| 21 |
|
---|
| 22 | // provisoire : recupere (teta,phi) position du satellite (en degres)
|
---|
| 23 | teta= 0.;
|
---|
| 24 | phi = 0.;
|
---|
| 25 |
|
---|
| 26 | // Ouverture
|
---|
| 27 | Ouv= 90.*(float)Pi/180.;
|
---|
| 28 | // Direction de l'axe de rotation du satellite
|
---|
| 29 | Omega[0]= teta*(float)Pi/180.;
|
---|
| 30 | Omega[1]= phi*(float)Pi/180.;
|
---|
| 31 | // Vitesse de rotation
|
---|
| 32 | Omega[2]= (float)Pi;
|
---|
| 33 | // Frequence
|
---|
| 34 | fech= 30.;
|
---|
| 35 | // Temps max
|
---|
| 36 | T= 2.;
|
---|
| 37 | // Temps initial
|
---|
| 38 | T0= 0.;
|
---|
| 39 | // Offset
|
---|
| 40 | phi0= 0.;
|
---|
| 41 | int npas=15;
|
---|
| 42 | d_tet= (float)Pi*0.5/npas;
|
---|
| 43 | Scan equ(Ouv,Omega,fech,T,T0,phi0);
|
---|
| 44 | nbpix= equ.NbPoints();
|
---|
| 45 | cout << " nb pixels " << nbpix << endl;
|
---|
| 46 | for( int j=0; j<nbpix; j++ ) {
|
---|
| 47 | equ(j)= 100.*(j+1)/npas;
|
---|
| 48 | }
|
---|
| 49 | DVList dvl;
|
---|
| 50 |
|
---|
| 51 | equ.Info()["Temp"]=33.;
|
---|
| 52 | equ.Info()["Texte"]="bla bla bla";
|
---|
| 53 | cout << " scan initial " << endl;
|
---|
| 54 | for( int j=0; j<10; j++ ) {
|
---|
| 55 | cout << " pix no " << j << " val= " << equ(j) << endl;;
|
---|
| 56 | }
|
---|
| 57 | string sfile("scan.out");
|
---|
| 58 | Scan equ2;
|
---|
| 59 | {
|
---|
| 60 | FIO_Scan fsc(equ);
|
---|
| 61 | fsc.Write(sfile);
|
---|
| 62 | FIO_Scan gsc(sfile);
|
---|
| 63 | equ2=(Scan)gsc;
|
---|
| 64 | }
|
---|
| 65 | cout << " scan relu " << endl;
|
---|
| 66 | for( int j=0; j<10; j++ )
|
---|
| 67 | {
|
---|
| 68 | cout << " pix no " << j << " val= " << equ2(j) << endl;
|
---|
| 69 | }
|
---|
| 70 | cout << " fin test persistance scan" << endl;
|
---|
| 71 | }
|
---|