00001
00002
00004 #ifndef __Omicron__
00005 #define __Omicron__
00006
00007 #include "GwollumPlot.h"
00008 #include "IO.h"
00009 #include "ffl.h"
00010 #include "Streams.h"
00011 #include "Spectrum.h"
00012 #include "Sample.h"
00013 #include "Triggers.h"
00014 #include "EventMap.h"
00015 #include "TMath.h"
00016 #include "Otile.h"
00017 #include "Odata.h"
00018 #include "Date.h"
00019
00020 using namespace std;
00021
00022
00031 class Omicron {
00032
00033 public:
00034
00047 Omicron(const string aOptionFile);
00048
00052 virtual ~Omicron(void);
00071 bool Process(Segments *aSeg);
00072
00086 bool Scan(const double aTimeCenter);
00087
00092 bool ScanTriggers(const double aTimeCenter);
00093
00101 bool InitSegments(Segments *aSeg);
00102
00116 bool MakeDirectories(const double aGPS = 0);
00117
00124 bool NewChunk(void);
00125
00140 int ConditionVector(const int aChNumber, const int aInVectSize, double *aInVect);
00141
00147 int MakeTriggers(const int aChNumber);
00148
00154 bool WriteTriggers(const int aChNumber);
00155
00165 bool MakeMaps(const int aChNumber, const double aTimeCenter);
00166
00175 bool WriteMaps(void);
00176
00181 bool ScanReport(const string aScanDir="");
00182
00183
00184
00185
00189 inline vector <string> GetChannelList(void){return fChannels;};
00190
00194 inline int GetChunkDuration(void){return fChunkDuration;};
00195
00199 inline int GetSegmentDuration(void){return fSegmentDuration;};
00200
00204 inline int GetOverlapDuration(void){return fOverlapDuration;};
00205
00209 inline int GetSampleFrequency(void){return fSampleFrequency;};
00210
00214 void PrintStatusInfo(void);
00215
00219 inline bool GetStatus(void){ return status_OK; };
00220
00221 private:
00222
00223
00224 bool status_OK;
00225 time_t timer;
00226 time_t timer_start;
00227 struct tm * ptm;
00228
00229
00230 bool ReadOptions(void);
00231 string fOptionFile;
00232 vector <string> fOptionName;
00233 vector <string> fOptionType;
00234 string fMaindir;
00235 vector <string> fOutdir;
00236 vector <string> fChannels;
00237 vector <string> fInjChan;
00238 vector <double> fInjFact;
00239 string fFflFile;
00240 string fTrigDir;
00241 int fSampleFrequency;
00242 vector <double> fFreqRange;
00243 vector <double> fQRange;
00244 int fChunkDuration;
00245 int fSegmentDuration;
00246 int fOverlapDuration;
00247 double fMismatchMax;
00248 vector <int> fWindows;
00249 int fWindowMax;
00250 string ffftplan;
00251 double fSNRThreshold;
00252 int fNtriggerMax;
00253 vector <string> fClusterAlgo;
00254 double fcldt;
00255 int fVerbosity;
00256 string fOutFormat;
00257 string fStyle;
00258 bool writepsd;
00259 bool writetimeseries;
00260 string fWriteMode;
00261
00262
00263 Segments *inSegments;
00264 Segments **outSegments;
00265 int *chunk_ctr;
00266 int *cor_chunk_ctr;
00267 int *cor_data_ctr;
00268 int *max_chunk_ctr;
00269
00270
00271 Odata *dataseq;
00272 Sample **sample;
00273 Streams **streams;
00274 Spectrum *spectrum;
00275 ffl *FFL;
00276 Otile *tile;
00277 Triggers **triggers;
00278
00279
00280 int ChunkSize;
00281 int OverlapSize;
00282 int SegmentSize;
00283 double *ChunkVect;
00284 double *SegVect;
00285
00286
00287 bool Condition(double **aDataRe, double **aDataIm);
00288 double* GetTukeyWindow(const int aSize, const int aFractionSize);
00289 double *TukeyWindow;
00290 fft *offt;
00291 double **dataRe;
00292 double **dataIm;
00293
00294
00295 int MapChNumber;
00296 TH2D **Qmap;
00297 TH2D **Qmap_full;
00298 double Qmap_center;
00299 int *loudest_qmap;
00300 GwollumPlot *GPlot;
00301 string fScandir;
00302
00303
00304 void SaveAPSD(const int c, const string type="PSD");
00305 void SaveTS(const int c, double tcenter=0);
00306 bool *first_save;
00307 void PrintASCIIlogo(void);
00308
00309 ClassDef(Omicron,0)
00310 };
00311
00312 #endif
00313
00314