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

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

nouvelles toi

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