casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BDF2AsdmStManIndex.h
Go to the documentation of this file.
1 #ifndef BDF2ASDMSTMANINDEX
2 #define BDF2ASDMSTMANINDEX
5 #include <asdmstman/AsdmIndex.h>
6 #include <casa/Arrays/Array.h>
7 #include <casa/Arrays/ArrayIO.h>
10 #include <casa/IO/AipsIO.h>
12 #include <map>
13 
14 #include <stdint.h>
15 #include <algorithm>
16 
17 /*
18 ** A simplistic tracing toolbox.
19 */
20 extern bool debug;
21 extern std::vector<char> logIndent;
22 #define LOGENTER(name) if (debug) { std::for_each(logIndent.begin(), logIndent.end(), [](char v) { cout << v; }); logIndent.push_back('\t'); cout << #name ": entering" << endl; }
23 #define LOGEXIT(name) if (debug) { logIndent.pop_back(); std::for_each(logIndent.begin(), logIndent.end(), [](char v) { cout << v; } ); cout << #name ": exiting" << endl; }
24 #define LOG(msg) if (debug) { std::for_each(logIndent.begin(), logIndent.end(), [](char v) { cout << v; } ); cout << msg << endl; }
25 
27 public:
29  BDF2AsdmStManIndex(const std::vector<std::string>& bdfNames, bool isBigEndian, const string& fname);
30  virtual ~BDF2AsdmStManIndex();
31  void init (const std::vector<std::string>& bdfNames, bool isBigEndian, const string& fname);
33  void done();
34  void clearIndexes();
35  void clearAutoIndexes();
36  void clearCrossIndexes();
37  void appendAutoIndex(unsigned int iDD,
38  const string& bdfName,
39  unsigned int nBl,
40  unsigned int nSpw,
41  unsigned int nChan,
42  unsigned int nPol,
43  unsigned int stepBl,
44  unsigned int stepSpw,
45  const std::vector<double>& scaleFactors,
46  uint64_t fileOffset,
47  uint32_t spwOffset);
48 
49  void appendWVRIndex(unsigned int iDD,
50  const string& bdfName,
51  unsigned int nBl,
52  unsigned int nSpw,
53  unsigned int nChan,
54  unsigned int nPol,
55  unsigned int stepBl,
56  unsigned int stepSpw,
57  const std::vector<double>& scaleFactors,
58  uint64_t fileOffset,
59  uint32_t spwOffset);
60 
61  void appendCrossIndex(unsigned int iDD,
62  const string& bdfName,
63  unsigned int nBl,
64  unsigned int nSpw,
65  unsigned int nChan,
66  unsigned int nPol,
67  unsigned int stepBl,
68  unsigned int stepSpw,
69  const std::vector<double>& scaleFactors,
70  uint64_t fileOffset,
71  uint32_t spwOffset,
72  PrimitiveDataTypeMod::PrimitiveDataType dataType);
73 
74  void dumpAutoCross();
75  void dumpCrossAuto();
76 
77  static int version();
78 
79 private:
83  std::map<std::string, int> s2i_m;
84  std::vector<std::vector<casa::AsdmIndex> > autoIndexes_vv;
85  std::vector<std::vector<casa::AsdmIndex> > crossIndexes_vv;
86  std::vector<casa::AsdmIndex> allIndexes_v;
89  uint64_t MSMainRowNumber;
90 };
91 #endif
std::vector< char > logIndent
void appendCrossIndex(unsigned int iDD, const string &bdfName, unsigned int nBl, unsigned int nSpw, unsigned int nChan, unsigned int nPol, unsigned int stepBl, unsigned int stepSpw, const std::vector< double > &scaleFactors, uint64_t fileOffset, uint32_t spwOffset, PrimitiveDataTypeMod::PrimitiveDataType dataType)
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
std::map< std::string, int > s2i_m
std::vector< casa::AsdmIndex > allIndexes_v
void init(const std::vector< std::string > &bdfNames, bool isBigEndian, const string &fname)
std::vector< std::vector< casa::AsdmIndex > > crossIndexes_vv
static int version()
casacore::String fname
virtual ~BDF2AsdmStManIndex()
void appendAutoIndex(unsigned int iDD, const string &bdfName, unsigned int nBl, unsigned int nSpw, unsigned int nChan, unsigned int nPol, unsigned int stepBl, unsigned int stepSpw, const std::vector< double > &scaleFactors, uint64_t fileOffset, uint32_t spwOffset)
std::vector< std::vector< casa::AsdmIndex > > autoIndexes_vv
void appendWVRIndex(unsigned int iDD, const string &bdfName, unsigned int nBl, unsigned int nSpw, unsigned int nChan, unsigned int nPol, unsigned int stepBl, unsigned int stepSpw, const std::vector< double > &scaleFactors, uint64_t fileOffset, uint32_t spwOffset)
bool debug
uint32_t numberOfDataDescriptions
casacore::AipsIO aio
casacore::Block< casacore::String > bdfNames
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setNumberOfDataDescriptions(unsigned int numberOfDataDescriptions)