00001
00002
00004 #ifndef __Omicron__
00005 #define __Omicron__
00006
00007 #include "IO.h"
00008 #include "Otile.h"
00009 #include "Odata.h"
00010 #include "Date.h"
00011 #include "InjEct.h"
00012 #include "ffl.h"
00013
00014 using namespace std;
00015
00016
00025 class Omicron {
00026
00027 public:
00028
00050 Omicron(const string aOptionFile);
00051
00055 virtual ~Omicron(void);
00069 bool InitSegments(Segments *aSeg, const double aTimeOffset=0.0);
00070
00084 bool MakeDirectories(const int aId = 0);
00085
00092 bool NewChunk(void);
00093
00098 bool NewChannel(void);
00099
00109 bool LoadData(double **aDataVector, int *aSize);
00110
00131 int Condition(const int aInVectSize, double *aInVect);
00132
00139 bool Project(void);
00140
00147 bool WriteOutput(void);
00148
00152 void PrintStatusInfo(void);
00153
00154
00163 Segments* GetTriggerSegments(TH1D *aThr=NULL, const double aInfValue=1e20);
00164
00168 inline vector <string> GetChannels(void){return fChannels;};
00169
00173 inline int GetChunkDuration(void){return fChunkDuration;};
00174
00178 inline int GetSegmentDuration(void){return fSegmentDuration;};
00179
00183 inline int GetOverlapDuration(void){return fOverlapDuration;};
00184
00188 inline int GetSampleFrequency(void){return fSampleFrequency;};
00189
00194 void PrintMessage(const string aMessage);
00195
00199 inline bool GetStatus(void){ return status_OK; };
00200
00204 inline int GetVerbosity(void){ return fVerbosity; };
00205
00209 inline string GetVersion(void){ return "v2r1"; };
00210
00211 private:
00212
00213
00214 bool status_OK;
00215 time_t timer;
00216 time_t timer_start;
00217 struct tm * ptm;
00218 int chanindex;
00219 double timeoffset;
00220
00221
00222 void ReadOptions(void);
00223 string fOptionFile;
00224 vector <string> fOptionName;
00225 vector <string> fOptionType;
00226 string fFflFile;
00227 vector <string> fChannels;
00228 int fSampleFrequency;
00229 string fMaindir;
00230 int fVerbosity;
00231 string fOutProducts;
00232 string fOutFormat;
00233 string fOutStyle;
00234 int fChunkDuration;
00235 int fSegmentDuration;
00236 int fOverlapDuration;
00237 vector <double> fFreqRange;
00238 vector <double> fQRange;
00239 double fMismatchMax;
00240 double fSNRThreshold_trigger;
00241 double fSNRThreshold_map;
00242 int fNTriggerMax;
00243 string fClusterAlgo;
00244 double fcldt;
00245 int fTileDown;
00246 vector <int> fWindows;
00247 int fsnrscale;
00248 vector <string> fInjChan;
00249 vector <double> fInjFact;
00250 string fInjFilePat;
00251
00252
00253 Segments *inSegments;
00254 Segments **outSegments;
00255 int chunk_ctr;
00256 int *chan_ctr;
00257 int *chan_data_ctr;
00258 int *chan_cond_ctr;
00259 int *chan_proj_ctr;
00260 int *chan_write_ctr;
00261 double *chan_mapsnrmax;
00262 vector <int> mapcenter;
00263 vector <int> chunkstart;
00264 vector <int> chunkstop;
00265
00266
00267 Odata *dataseq;
00268 Spectrum *spectrum;
00269 ffl *FFL;
00270 Otile *tile;
00271 MakeTriggers **triggers;
00272 InjEct **inject;
00273
00274
00275 double *ChunkVect;
00276 double *SegVect;
00277
00278
00279 bool Whiten(double **aDataRe,
00280 double **aDataIm);
00281 double* GetTukeyWindow(const int aSize, const int aFractionSize);
00282 double *TukeyWindow;
00283 fft *offt;
00284 double **dataRe;
00285 double **dataIm;
00286
00287
00288 string maindir;
00289 vector <string> outdir;
00290 void SaveAPSD(const string type="PSD");
00291 void SaveTS(void);
00292 void MakeHtml(void);
00293
00294
00295 GwollumPlot *GPlot;
00296 void PrintASCIIlogo(void);
00297 static const string colorcode[17];
00298 string GetColorCode(const double aSNRratio);
00299
00300
00301 ClassDef(Omicron,0)
00302 };
00303
00304 #endif
00305
00306