1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 |
|
---|
3 | // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
|
---|
4 | // Eric Aubourg
|
---|
5 | // Christophe Magneville
|
---|
6 | // Reza Ansari
|
---|
7 | // $Id: fitstoirdr.h,v 1.13 2002-09-09 15:33:14 aubourg Exp $
|
---|
8 |
|
---|
9 |
|
---|
10 | #ifndef FITSTOIRDR_H
|
---|
11 | #define FITSTOIRDR_H
|
---|
12 |
|
---|
13 | #include "config.h"
|
---|
14 | #include "toiprocessor.h"
|
---|
15 | #include <string>
|
---|
16 | #include <vector>
|
---|
17 | #include <map>
|
---|
18 | #include "fitsio.h"
|
---|
19 | #include "flagtoidef.h"
|
---|
20 |
|
---|
21 | class FITSTOIReader : public TOIProcessor {
|
---|
22 | public:
|
---|
23 | FITSTOIReader(string fn,int buff_sz=1024);
|
---|
24 | ~FITSTOIReader();
|
---|
25 |
|
---|
26 | void setImplicitSN(long snStart=0);
|
---|
27 |
|
---|
28 | void setBufferSize(int buffsz=1024);
|
---|
29 | inline int getBufferSize() { return Buff_Sz; }
|
---|
30 |
|
---|
31 | virtual void addFile(string fn);
|
---|
32 |
|
---|
33 | // Methode rajoutee pour gerer les fichiers de flag de LevelS
|
---|
34 | // Reza 18/6/2002
|
---|
35 | // fn : Nom du fichier FITS,
|
---|
36 | // flags: Indique le nombre de colonne et la correspondence avec les
|
---|
37 | // flags d'ArchTOIPipe flags[0..N-1] ---> 1ere...Neme colonnes
|
---|
38 | virtual void setFlagFile(string fn, vector<FlagToiDef> flags);
|
---|
39 |
|
---|
40 | virtual void init();
|
---|
41 | virtual void run();
|
---|
42 |
|
---|
43 | inline int_8 ProcessedSampleCount() const { return totnscount; }
|
---|
44 | virtual void printLimits();
|
---|
45 |
|
---|
46 | protected:
|
---|
47 | virtual int calcMinOut();
|
---|
48 | virtual int calcMaxOut();
|
---|
49 |
|
---|
50 | // ajout vf 31/07/2002
|
---|
51 | virtual bool checkSampleLimits(long& min, long& max, int pass);
|
---|
52 | virtual void calcSampleLimits(long& min, long& max);
|
---|
53 |
|
---|
54 | virtual void run1();
|
---|
55 | virtual void run2();
|
---|
56 | virtual void openFile(string fn);
|
---|
57 |
|
---|
58 | private:
|
---|
59 | fitsfile* fptr;
|
---|
60 | int fstatus;
|
---|
61 | string fname; // current file
|
---|
62 | long nrows; // current file
|
---|
63 | int firstSn; // current file
|
---|
64 | int Buff_Sz; // buffer size
|
---|
65 |
|
---|
66 | int ncols; // including flags. getNOut() is # of tois.
|
---|
67 |
|
---|
68 | // supression de la redefinition vf 23/08/2002
|
---|
69 | //int snBegin; // first file
|
---|
70 | //int snEnd; // last file
|
---|
71 |
|
---|
72 | bool implicitSN;
|
---|
73 | long implicitSNStart;
|
---|
74 |
|
---|
75 | vector<string> allfn;
|
---|
76 | map<int,pair<int, bool> > colsinput; // iTOI -> (colonne, hasflag)
|
---|
77 | // le flag est alors en colonne+1
|
---|
78 |
|
---|
79 | int_8 totnscount; // Nombre total d'echantillon processe
|
---|
80 |
|
---|
81 | // Variables rajoutee pour gerer les fichiers de flag de LevelS (Reza 18/6/2002)
|
---|
82 | bool sepFlagfile;
|
---|
83 | string sepFlagFileName;
|
---|
84 | vector<FlagToiDef> sepFlagCols;
|
---|
85 | fitsfile* fptrflg;
|
---|
86 |
|
---|
87 | };
|
---|
88 |
|
---|
89 | #endif
|
---|