[1365] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 |
|
---|
[1738] | 3 | // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
|
---|
| 4 | // Eric Aubourg
|
---|
| 5 | // Christophe Magneville
|
---|
| 6 | // Reza Ansari
|
---|
[2058] | 7 | // $Id: fitstoirdr.h,v 1.12 2002-06-18 12:21:08 ansari Exp $
|
---|
[1738] | 8 |
|
---|
| 9 |
|
---|
[1365] | 10 | #ifndef FITSTOIRDR_H
|
---|
| 11 | #define FITSTOIRDR_H
|
---|
| 12 |
|
---|
[1793] | 13 | #include "config.h"
|
---|
[1365] | 14 | #include "toiprocessor.h"
|
---|
| 15 | #include <string>
|
---|
[1793] | 16 | #include <vector>
|
---|
[1765] | 17 | #include <map>
|
---|
[1365] | 18 | #include "fitsio.h"
|
---|
[2058] | 19 | #include "flagtoidef.h"
|
---|
[1365] | 20 |
|
---|
| 21 | class FITSTOIReader : public TOIProcessor {
|
---|
| 22 | public:
|
---|
[1994] | 23 | FITSTOIReader(string fn,int buff_sz=1024);
|
---|
[1365] | 24 | ~FITSTOIReader();
|
---|
[1480] | 25 |
|
---|
[1994] | 26 | void setImplicitSN(long snStart=0);
|
---|
[1725] | 27 |
|
---|
[1994] | 28 | void setBufferSize(int buffsz=1024);
|
---|
| 29 | inline int getBufferSize() { return Buff_Sz; }
|
---|
| 30 |
|
---|
[1480] | 31 | virtual void addFile(string fn);
|
---|
| 32 |
|
---|
[2058] | 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 |
|
---|
[1365] | 40 | virtual void init();
|
---|
[1629] | 41 | virtual void run();
|
---|
| 42 |
|
---|
| 43 | inline int_8 ProcessedSampleCount() const { return totnscount; }
|
---|
[1365] | 44 |
|
---|
| 45 | protected:
|
---|
| 46 | virtual int calcMinOut();
|
---|
| 47 | virtual int calcMaxOut();
|
---|
| 48 |
|
---|
[1480] | 49 | virtual void run1();
|
---|
[1717] | 50 | virtual void run2();
|
---|
[1480] | 51 | virtual void openFile(string fn);
|
---|
| 52 |
|
---|
[1365] | 53 | private:
|
---|
[1480] | 54 | fitsfile* fptr;
|
---|
| 55 | int fstatus;
|
---|
| 56 | string fname; // current file
|
---|
| 57 | long nrows; // current file
|
---|
| 58 | int firstSn; // current file
|
---|
[1717] | 59 | int Buff_Sz; // buffer size
|
---|
[1480] | 60 |
|
---|
[1527] | 61 | int ncols; // including flags. getNOut() is # of tois.
|
---|
[1480] | 62 | int snBegin; // first file
|
---|
| 63 | int snEnd; // last file
|
---|
[1725] | 64 |
|
---|
| 65 | bool implicitSN;
|
---|
[1994] | 66 | long implicitSNStart;
|
---|
[1480] | 67 |
|
---|
| 68 | vector<string> allfn;
|
---|
[1527] | 69 | map<int,pair<int, bool> > colsinput; // iTOI -> (colonne, hasflag)
|
---|
| 70 | // le flag est alors en colonne+1
|
---|
[1480] | 71 |
|
---|
[1629] | 72 | int_8 totnscount; // Nombre total d'echantillon processe
|
---|
| 73 |
|
---|
[2058] | 74 | // Variables rajoutee pour gerer les fichiers de flag de LevelS (Reza 18/6/2002)
|
---|
| 75 | bool sepFlagfile;
|
---|
| 76 | string sepFlagFileName;
|
---|
| 77 | vector<FlagToiDef> sepFlagCols;
|
---|
| 78 | fitsfile* fptrflg;
|
---|
| 79 |
|
---|
[1365] | 80 | };
|
---|
| 81 |
|
---|
| 82 | #endif
|
---|