CARMA C++
VisBrickReader.h
1 // $Id: VisBrickReader.h,v 1.6 2011/08/18 23:25:48 abeard Exp $
2 
3 #ifndef SZA_ANTENNA_CORBA_VISBRICKREADER_H
4 #define SZA_ANTENNA_CORBA_VISBRICKREADER_H
5 
15 #include "carma/szautil/Complex.h"
16 #include "carma/szautil/RegDate.h"
17 
18 #include <map>
19 #include <vector>
20 
21 #include "carma/antenna/sza/antenna/corba/Corba.h"
23 #include "carma/pipeline/VisBrickReader.h"
24 
25 namespace sza {
26  namespace util {
27  class ArrayDataFrameManager;
28  }
29 };
30 
31 namespace carma {
32  namespace pipeline {
33  class CorrelatorVisBrickReader;
34  }
35 };
36 
37 namespace sza {
38  namespace antenna {
39  namespace corba {
40 
41  class VisBrickReader {
42  public:
43 
47  VisBrickReader(std::string confFile);
48 
52  virtual ~VisBrickReader();
53 
54  bool atEnd();
55  void loadFile(std::string fileName);
56  void readFile(std::string fileName);
57  void packNextRecord(sza::util::ArrayDataFrameManager* fm);
58  void packBand(const carma::correlator::lib::CorrelatorBand& corrBand, sza::util::ArrayDataFrameManager* fm);
59  void packBaseline(const carma::correlator::lib::CorrelatorBaseline& baseline);
60  void packSideBand(const carma::correlator::lib::CorrelatorSideband & sideBand,
61  int iAnt1, int iAnt2);
62 
63  void setCrossBaselineReceived(unsigned iBase, bool received);
64  void setBaselinesUnreceived();
65 
66  std::string bandName(carma::correlator::lib::CorrelatorBand& corrBand);
67  std::string bandName(int iBand);
68 
69  void initialize();
70 
71  void closeFile();
72 
73  unsigned int getCurrentFrameCount();
74 
75  sza::util::RegDate mjd_;
76 
77  private:
78 
80 
81  unsigned nAnt_;
82  unsigned nBase_;
83  unsigned nBand_;
84  unsigned nChan_;
85 
86  std::string fileName_;
87  std::string confFile_;
88 
89  // Statistics about correlator sources
90 
91  bool isRf_;
92  bool isNoise_;
93 
98  std::map<unsigned int, std::map<unsigned int, unsigned int> >
99  crossBaselineIndex_;
100 
101  // Arrays in which visibilities will be stored until ready to write
102 
103  std::vector<sza::util::Complex<float>::Data> usbAvg_;
104  std::vector<sza::util::Complex<float>::Data> lsbAvg_;
105  std::vector<sza::util::Complex<float>::Data> usbVar_;
106  std::vector<sza::util::Complex<float>::Data> lsbVar_;
107 
108  std::vector<float> usbAmplitude_;
109  std::vector<float> lsbAmplitude_;
110 
111  std::vector<float> usbAvgAmplitude_;
112  std::vector<float> lsbAvgAmplitude_;
113 
114  std::vector<sza::util::Complex<float>::Data> usb_;
115  std::vector<sza::util::Complex<float>::Data> lsb_;
116 
117  std::vector<float> autoAvg_;
118  std::vector<float> autoVar_;
119  std::vector<float> auto_;
120 
121  std::vector<int> autoValid_;
122  std::vector<int> lsbValid_;
123  std::vector<int> usbValid_;
124 
125  std::vector<unsigned char> baselineReceived_;
126 
127  unsigned lsbNSample_;
128  unsigned usbNSample_;
129  unsigned autoNSample_;
130 
131  float lsbTint_;
132  float usbTint_;
133  float autoTint_;
134 
135  carma::pipeline::RecordsByFrameMap recs_;
136  carma::pipeline::RecordsByFrameMap::iterator recIter_;
137 
138  }; // End class VisBrickReader
139 
140  } // End namespace corba
141  } // End namespace antenna
142 } // End namespace sza
143 
144 
145 
146 #endif // End #ifndef SZA_ANTENNA_CORBA_VISBRICKREADER_H
Class to hold a Band of Correlator Data.
Tagged: Tue Oct 12 09:13:47 PDT 2004.
Reads Correlator Data from a specifiec file.
Class to hold Correlator Baseline data.
Tagged: Tue Oct 12 10:25:49 PDT 2004.
Base class for Correlator Sideband data.