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

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

alpha delta a partir croisement galax

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