source: Sophya/trunk/Poubelle/archTOI.old/toiiter.h@ 394

Last change on this file since 394 was 394, checked in by ansari, 26 years ago

Integration detecteur d'etoiles DY

File size: 4.5 KB
Line 
1// toiiter.h
2// Eric Aubourg CEA/DAPNIA/SPP juillet 1999
3
4#ifndef TOIITER_H
5#define TOIITER_H
6
7
8#include <vector>
9#include <set>
10#include <map>
11#include <string>
12#include "archeopsfile.h"
13#include "auxgps.h"
14#include "tsid.h"
15
16enum TOIKind {
17 sampleNum, // Numero d''echantillon (timer interne transputer)
18 internalTime, // temps transputer depuis debut manip, en secondes.
19 mjd, // UTC (en jours, MJD = JD - 2450000). index=0 : premier bloc GPS. 1: + sioux.
20 boloTens, // tension en microVolts, filtree avec filtre carre indexe par bolometre
21 boloRaw, // tension brute, non filtree indexe par bolometre
22 boloTemp, // Kelvins
23 sstDiode, // signal brut SST, indice = diode, 0-45
24 sstChannel, // signal brut SST, indice = canal, 0-47
25 sstStarZ, // numero de diode d''une eventuelle etoile, i=etoile 0..n
26 sstStarF, // flux d''une eventuelle etoile, <0 si moins de i+1 etoiles
27 sstStarT, // temps d''une eventuelle etoile, <0 si moins de i+1 etoiles
28 gyroRaw, // valeur brute du gyro, index = 0,1,2
29 gpsTime, // temps fourni par GPS
30 longitude, // position ballon
31 latitude, // position ballon
32 altitude, // position ballon
33 tsid, // temps sideral en secondes
34 azimut, // a preciser, reconstruit SST, magneto, autres...
35 alphaAxis, //
36 deltaAxis, //
37 alphaSst, //
38 deltaSst, //
39 alphaBolo, // sur le ciel, indexe par bolometre
40 deltaBolo // sur le ciel, indexe par bolometre
41};
42
43class TOIInterpolator;
44
45class TOIIter {
46public:
47 TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ?
48 ~TOIIter();
49 bool Next();
50
51 bool canGetValue(int column); // data is available for that...
52 double getValue(int column);
53 bool newValue(int column); // a juste change ?
54 bool extendValue(int column); // une valeur plus ancienne, etendue ?
55 bool interpValue(int column); // une valeur interpolee avec valeur future ?
56 bool isTrig(int column);
57 TOIKind getKind(int column);
58 int getIndex(int column); // si plusieurs, exemple, tension bolo 2
59
60 bool canGetTOI(TOIKind kind, int index=0);
61 double getTOI(TOIKind kind, int index=0);
62
63
64 int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo
65 int getSampleIndex(); // numero d''echantillon
66 double getMJD();
67
68 block_type_param* lastParam();
69 block_type_journal* lastJournal();
70 block_type_reglage* lastReglage();
71 block_type_dilution* lastDilution();
72 block_type_gps* lastGPS();
73 block_type_une_periode* lastUnePeriode();
74 block_type_synchro_sol* lastSynchroSol();
75 block_type_pointage_sol* lastPointageSol();
76 block_type_bolo* lastBolo();
77 block_type_gyro* lastGyro();
78 block_type_sst* lastSST();
79 block_type_bolo_comprime* lastBoloComp();
80 block_type_gyro_comprime* lastGyroComp();
81 block_type_sst_comprime* lastSSTComp();
82
83 ArcheopsFile* currentFile() {if (!initDone) Init(); return file;}
84
85protected:
86 TOIIter();
87 void Init(); // After setting the options, opens the first file.
88 void ScanFiles(); // Parcourt tous les fichiers, cherche le premier echantillon...
89
90 bool NextSample(); // no test of trange
91 bool NextFile();
92
93 ArcheopsFile* file;
94 string directory; // If directory scanning
95 set<string> files; // list of files to be read...
96 map<string, long> file1stSamp; // premier echantillon de chaque fichier
97 set<string>::iterator curFile;
98 bool isOnBoardRecorder;
99
100 int imes;
101
102 double tStart, tEnd;
103
104 //double tBlock0; // MJD du bloc numero zero...
105 //double perEch; // periode d''echantillonage en secondes
106
107 struct info {
108 TOIKind kind;
109 int index;
110 bool triggering;
111 bool interpolated;
112 };
113
114 int getColTOI(TOIKind kind, int index=0);
115
116 long trigMask;
117
118 vector<info> infos;
119
120 friend class TOISvr;
121
122 // Gestion de l''interpolation, par delegation a un autre iterateur
123 TOIIter* rawIter; // iterateur sans interpolation, qui avance avec retard
124 // en bufferisant les valeurs. S'il existe, on lui delegue
125 // toutes les operations agissant sur le fichier.
126 TOIInterpolator* interp; // interpolateurs pour stocker les valeurs
127 long lastSample; // last interpolated sample
128 long maxLookAhead;
129 bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
130
131 AuxGPS* auxGPS;
132 TSid tSid;
133
134 private:
135 bool initDone;
136};
137
138#endif
Note: See TracBrowser for help on using the repository browser.