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

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

nouvelles tois

File size: 5.4 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 boloTemp, // Kelvins, need R(T) -> N/A
24 boloGainAmpli, // gain de l'ampli du bolo
[408]25 boloDACV, // tension de reference du DAC (microVolts)
[410]26 boloDACI, // courant (microAmps)
[407]27 boloRawCN, // compression noise on bolo raw
[416]28 boloTensCN, // compression noise on bolo (microVolts), no filter
[407]29 boloTens2T, // total, microVolts, avec consigne DAC
[410]30 boloRes, // Resistance, ohms
31 dilDAC, // dilution DAC, index = 0-47
32 dilSwitch, // dilution, mot de 32 bits
[407]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
[419]45 longitude, // position ballon, degrees +=EST
46 latitude, // position ballon, degrees +=NORD
[407]47 altitude, // position ballon, m
48 tsid, // temps sideral en secondes
49 azimut, // azimut centre optique ???
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};
[310]57
[315]58class TOIInterpolator;
[310]59
60class TOIIter {
61public:
[315]62 TOIIter(TOIIter const&); // $CHECK$ prevoir operator = ?
[310]63 ~TOIIter();
64 bool Next();
65
[315]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 ?
[342]71 bool isTrig(int column);
[310]72 TOIKind getKind(int column);
[315]73 int getIndex(int column); // si plusieurs, exemple, tension bolo 2
[310]74
[315]75 bool canGetTOI(TOIKind kind, int index=0);
76 double getTOI(TOIKind kind, int index=0);
77
78
[342]79 int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo
80 int getSampleIndex(); // numero d''echantillon
[358]81 double getMJD();
[310]82
83 block_type_param* lastParam();
84 block_type_journal* lastJournal();
85 block_type_reglage* lastReglage();
86 block_type_dilution* lastDilution();
87 block_type_gps* lastGPS();
88 block_type_une_periode* lastUnePeriode();
89 block_type_synchro_sol* lastSynchroSol();
90 block_type_pointage_sol* lastPointageSol();
91 block_type_bolo* lastBolo();
92 block_type_gyro* lastGyro();
93 block_type_sst* lastSST();
94 block_type_bolo_comprime* lastBoloComp();
95 block_type_gyro_comprime* lastGyroComp();
96 block_type_sst_comprime* lastSSTComp();
[342]97
[393]98 ArcheopsFile* currentFile() {if (!initDone) Init(); return file;}
[310]99
100protected:
101 TOIIter();
102 void Init(); // After setting the options, opens the first file.
[350]103 void ScanFiles(); // Parcourt tous les fichiers, cherche le premier echantillon...
[310]104
[350]105 bool NextSample(); // no test of trange
[310]106 bool NextFile();
107
108 ArcheopsFile* file;
[350]109 string directory; // If directory scanning
110 set<string> files; // list of files to be read...
111 map<string, long> file1stSamp; // premier echantillon de chaque fichier
[310]112 set<string>::iterator curFile;
[342]113 bool isOnBoardRecorder;
[310]114
115 int imes;
116
117 double tStart, tEnd;
118
[394]119 //double tBlock0; // MJD du bloc numero zero...
120 //double perEch; // periode d''echantillonage en secondes
[310]121
122 struct info {
123 TOIKind kind;
124 int index;
125 bool triggering;
126 bool interpolated;
127 };
128
[315]129 int getColTOI(TOIKind kind, int index=0);
130
[310]131 long trigMask;
132
133 vector<info> infos;
134
135 friend class TOISvr;
136
[342]137 // Gestion de l''interpolation, par delegation a un autre iterateur
[315]138 TOIIter* rawIter; // iterateur sans interpolation, qui avance avec retard
[401]139 // en bufferisant les valeurs. S''il existe, on lui delegue
[315]140 // toutes les operations agissant sur le fichier.
141 TOIInterpolator* interp; // interpolateurs pour stocker les valeurs
142 long lastSample; // last interpolated sample
143 long maxLookAhead;
[342]144 bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
[315]145
[358]146 AuxGPS* auxGPS;
[363]147 TSid tSid;
[358]148
[310]149 private:
[393]150 bool initDone;
[310]151};
152
153#endif
Note: See TracBrowser for help on using the repository browser.