[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 |
|
---|
| 16 | enum TOIKind {
|
---|
[342] | 17 | sampleNum, // Numero d''echantillon (timer interne transputer)
|
---|
[315] | 18 | internalTime, // temps transputer depuis debut manip, en secondes.
|
---|
[350] | 19 | mjd, // UTC (en jours, MJD = JD - 2450000). index=0 : premier bloc GPS. 1: + sioux.
|
---|
[310] | 20 | boloTens, // tension en microVolts, filtree avec filtre carre indexe par bolometre
|
---|
| 21 | boloRaw, // tension brute, non filtree indexe par bolometre
|
---|
[342] | 22 | boloTemp, // Kelvins
|
---|
[350] | 23 | sstDiode, // signal brut SST, indice = diode, 0-45
|
---|
| 24 | sstChannel, // signal brut SST, indice = canal, 0-47
|
---|
[342] | 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
|
---|
[394] | 27 | sstStarT, // temps d''une eventuelle etoile, <0 si moins de i+1 etoiles
|
---|
[342] | 28 | gyroRaw, // valeur brute du gyro, index = 0,1,2
|
---|
| 29 | gpsTime, // temps fourni par GPS
|
---|
[315] | 30 | longitude, // position ballon
|
---|
| 31 | latitude, // position ballon
|
---|
[342] | 32 | altitude, // position ballon
|
---|
[315] | 33 | tsid, // temps sideral en secondes
|
---|
[310] | 34 | azimut, // a preciser, reconstruit SST, magneto, autres...
|
---|
[315] | 35 | alphaAxis, //
|
---|
| 36 | deltaAxis, //
|
---|
[342] | 37 | alphaSst, //
|
---|
| 38 | deltaSst, //
|
---|
[315] | 39 | alphaBolo, // sur le ciel, indexe par bolometre
|
---|
| 40 | deltaBolo // sur le ciel, indexe par bolometre
|
---|
[310] | 41 | };
|
---|
| 42 |
|
---|
[315] | 43 | class TOIInterpolator;
|
---|
[310] | 44 |
|
---|
| 45 | class TOIIter {
|
---|
| 46 | public:
|
---|
[315] | 47 | TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ?
|
---|
[310] | 48 | ~TOIIter();
|
---|
| 49 | bool Next();
|
---|
| 50 |
|
---|
[315] | 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 ?
|
---|
[342] | 56 | bool isTrig(int column);
|
---|
[310] | 57 | TOIKind getKind(int column);
|
---|
[315] | 58 | int getIndex(int column); // si plusieurs, exemple, tension bolo 2
|
---|
[310] | 59 |
|
---|
[315] | 60 | bool canGetTOI(TOIKind kind, int index=0);
|
---|
| 61 | double getTOI(TOIKind kind, int index=0);
|
---|
| 62 |
|
---|
| 63 |
|
---|
[342] | 64 | int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo
|
---|
| 65 | int getSampleIndex(); // numero d''echantillon
|
---|
[358] | 66 | double getMJD();
|
---|
[310] | 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();
|
---|
[342] | 82 |
|
---|
[393] | 83 | ArcheopsFile* currentFile() {if (!initDone) Init(); return file;}
|
---|
[310] | 84 |
|
---|
| 85 | protected:
|
---|
| 86 | TOIIter();
|
---|
| 87 | void Init(); // After setting the options, opens the first file.
|
---|
[350] | 88 | void ScanFiles(); // Parcourt tous les fichiers, cherche le premier echantillon...
|
---|
[310] | 89 |
|
---|
[350] | 90 | bool NextSample(); // no test of trange
|
---|
[310] | 91 | bool NextFile();
|
---|
| 92 |
|
---|
| 93 | ArcheopsFile* file;
|
---|
[350] | 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
|
---|
[310] | 97 | set<string>::iterator curFile;
|
---|
[342] | 98 | bool isOnBoardRecorder;
|
---|
[310] | 99 |
|
---|
| 100 | int imes;
|
---|
| 101 |
|
---|
| 102 | double tStart, tEnd;
|
---|
| 103 |
|
---|
[394] | 104 | //double tBlock0; // MJD du bloc numero zero...
|
---|
| 105 | //double perEch; // periode d''echantillonage en secondes
|
---|
[310] | 106 |
|
---|
| 107 | struct info {
|
---|
| 108 | TOIKind kind;
|
---|
| 109 | int index;
|
---|
| 110 | bool triggering;
|
---|
| 111 | bool interpolated;
|
---|
| 112 | };
|
---|
| 113 |
|
---|
[315] | 114 | int getColTOI(TOIKind kind, int index=0);
|
---|
| 115 |
|
---|
[310] | 116 | long trigMask;
|
---|
| 117 |
|
---|
| 118 | vector<info> infos;
|
---|
| 119 |
|
---|
| 120 | friend class TOISvr;
|
---|
| 121 |
|
---|
[342] | 122 | // Gestion de l''interpolation, par delegation a un autre iterateur
|
---|
[315] | 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;
|
---|
[342] | 129 | bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
|
---|
[315] | 130 |
|
---|
[358] | 131 | AuxGPS* auxGPS;
|
---|
[363] | 132 | TSid tSid;
|
---|
[358] | 133 |
|
---|
[310] | 134 | private:
|
---|
[393] | 135 | bool initDone;
|
---|
[310] | 136 | };
|
---|
| 137 |
|
---|
| 138 | #endif
|
---|