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