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

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

nouvelles toi

File size: 5.3 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 boloTens2, // tension en microVolts, avec soustraction offset filtre
22 boloRaw, // tension brute en microVolts, non filtree indexe par bolometre, sans chgt signe
23 boloTemp, // Kelvins, need R(T) -> N/A
24 boloGainAmpli, // gain de l'ampli du bolo
25 boloDACV, // tension de reference du DAC (microVolts)
26 boloDACI, // courant (microAmps)
27 boloRawCN, // compression noise on bolo raw
28 boloTens2T, // total, microVolts, avec consigne DAC
29 boloRes, // Resistance, ohms
30 dilDAC, // dilution DAC, index = 0-47
31 dilSwitch, // dilution, mot de 32 bits
32 sstDiode, // signal brut SST, indice = diode, 0-45
33 sstChannel, // signal brut SST, indice = canal, 0-47
34 sstDiodeCN, // compression noise
35 sstChannelCN, // compression noise
36 sstStarCnt, // nombre d''etoiles detectees durant ce sample
37 sstStarZ, // numero de diode d''une eventuelle etoile, i=etoile 0..n
38 sstStarF, // flux d''une eventuelle etoile, <0 si moins de i+1 etoiles
39 sstStarT, // temps d''une eventuelle etoile, <0 si moins de i+1 etoiles
40 gyroRaw, // valeur brute du gyro, index = 0,1,2
41 gyroTens, // tension gyro, V, index = 0,1,2
42 gyroSpeed, // vitesse gyro, deg/s, index = 0,1,2, calibree...
43 gpsTime, // temps fourni par GPS
44 longitude, // position ballon, degrees
45 latitude, // position ballon, degrees
46 altitude, // position ballon, m
47 tsid, // temps sideral en secondes
48 azimut, // azimut centre optique ???
49 alphaAxis, //
50 deltaAxis, //
51 alphaSst, //
52 deltaSst, //
53 alphaBolo, // sur le ciel, indexe par bolometre
54 deltaBolo // sur le ciel, indexe par bolometre
55};
56
57class TOIInterpolator;
58
59class TOIIter {
60public:
61 TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ?
62 ~TOIIter();
63 bool Next();
64
65 bool canGetValue(int column); // data is available for that...
66 double getValue(int column);
67 bool newValue(int column); // a juste change ?
68 bool extendValue(int column); // une valeur plus ancienne, etendue ?
69 bool interpValue(int column); // une valeur interpolee avec valeur future ?
70 bool isTrig(int column);
71 TOIKind getKind(int column);
72 int getIndex(int column); // si plusieurs, exemple, tension bolo 2
73
74 bool canGetTOI(TOIKind kind, int index=0);
75 double getTOI(TOIKind kind, int index=0);
76
77
78 int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo
79 int getSampleIndex(); // numero d''echantillon
80 double getMJD();
81
82 block_type_param* lastParam();
83 block_type_journal* lastJournal();
84 block_type_reglage* lastReglage();
85 block_type_dilution* lastDilution();
86 block_type_gps* lastGPS();
87 block_type_une_periode* lastUnePeriode();
88 block_type_synchro_sol* lastSynchroSol();
89 block_type_pointage_sol* lastPointageSol();
90 block_type_bolo* lastBolo();
91 block_type_gyro* lastGyro();
92 block_type_sst* lastSST();
93 block_type_bolo_comprime* lastBoloComp();
94 block_type_gyro_comprime* lastGyroComp();
95 block_type_sst_comprime* lastSSTComp();
96
97 ArcheopsFile* currentFile() {if (!initDone) Init(); return file;}
98
99protected:
100 TOIIter();
101 void Init(); // After setting the options, opens the first file.
102 void ScanFiles(); // Parcourt tous les fichiers, cherche le premier echantillon...
103
104 bool NextSample(); // no test of trange
105 bool NextFile();
106
107 ArcheopsFile* file;
108 string directory; // If directory scanning
109 set<string> files; // list of files to be read...
110 map<string, long> file1stSamp; // premier echantillon de chaque fichier
111 set<string>::iterator curFile;
112 bool isOnBoardRecorder;
113
114 int imes;
115
116 double tStart, tEnd;
117
118 //double tBlock0; // MJD du bloc numero zero...
119 //double perEch; // periode d''echantillonage en secondes
120
121 struct info {
122 TOIKind kind;
123 int index;
124 bool triggering;
125 bool interpolated;
126 };
127
128 int getColTOI(TOIKind kind, int index=0);
129
130 long trigMask;
131
132 vector<info> infos;
133
134 friend class TOISvr;
135
136 // Gestion de l''interpolation, par delegation a un autre iterateur
137 TOIIter* rawIter; // iterateur sans interpolation, qui avance avec retard
138 // en bufferisant les valeurs. S''il existe, on lui delegue
139 // toutes les operations agissant sur le fichier.
140 TOIInterpolator* interp; // interpolateurs pour stocker les valeurs
141 long lastSample; // last interpolated sample
142 long maxLookAhead;
143 bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
144
145 AuxGPS* auxGPS;
146 TSid tSid;
147
148 private:
149 bool initDone;
150};
151
152#endif
Note: See TracBrowser for help on using the repository browser.