HOPS
HOPS class reference
MHO_MK4CorelInterfaceReversed.hh
Go to the documentation of this file.
1 #ifndef MHO_MK4CorelInterfaceReversed_HH__
2 #define MHO_MK4CorelInterfaceReversed_HH__
3 
4 #include <cstdlib>
5 #include <cstring>
6 #include <string>
7 #include <vector>
8 
10 #include "MHO_Message.hh"
11 
12 //forward declaration of mk4_corel structs
13 //we do this to keep the mk4 structures from 'leaking' into the new code via includes,
14 //We want to make sure any interface to the old mk4 IO libraries is kept only
15 //within the MK4Interface library implementation (.cc) files
16 #ifndef HOPS3_USE_CXX
17 extern "C"
18 {
19 #endif
20 
21  struct mk4_corel;
22 
23 #ifndef HOPS3_USE_CXX
24 }
25 #endif
26 
27 namespace hops
28 {
29 
38 {
39  public:
42 
43  void SetRootFileName(std::string root_filename);
44  void SetOutputDirectory(const std::string& output_dir);
45 
46  void SetVisibilityData(visibility_store_type* vis_data) { fVisibilityData = vis_data; }
47 
48  void SetWeightData(weight_store_type* weight_data) { fWeightData = weight_data; }
49 
51 
52  int WriteCorelFile();
53 
54  struct mk4_corel* GetCorelStructure() { return fGeneratedCorel; }
55 
56  void FreeAllocated();
57 
58  private:
59  std::string ConstructMK4ChannelID(std::string fgroup, int index, std::string sideband, char pol);
60 
61  void GenerateType000();
62  void GenerateType100();
63  void GenerateType101Records();
64  void GenerateType120Records();
65  void InitializeCorelStructure();
66 
67  void CreateType101Record(int count, std::size_t ch, char ref_pol, char rem_pol);
68 
69  std::string ConstructType000FileName();
70 
71  void setstr(const std::string& str, char* char_array, std::size_t max_size);
72 
73  visibility_store_type* fVisibilityData;
74  weight_store_type* fWeightData;
75  struct mk4_corel* fGeneratedCorel;
76 
77  std::string fOutputDir;
78  std::string fOutputFile;
79 
80  //not read, but used to construct meta-data info in type_000 and type_100
81  std::string fRootFilename;
82  std::string fRootFileBasename;
83 
84  // Container dimensions
85  std::size_t fNPPs;
86  std::size_t fNAPs;
87  std::size_t fNChannels;
88  std::size_t fNSpectral;
89 
90  //keep track of allocated memory (outside of mark4 mechanism)
91  std::vector< void* > fAllocated;
92 };
93 
94 } // namespace hops
95 
96 #endif
MHO_MK4CorelInterfaceReversed - Converts HOPS4 visibility and weight containers back to mk4_corel for...
Definition: MHO_MK4CorelInterfaceReversed.hh:38
void SetVisibilityData(visibility_store_type *vis_data)
Definition: MHO_MK4CorelInterfaceReversed.hh:46
void GenerateCorelStructure()
Definition: MHO_MK4CorelInterfaceReversed.cc:74
int WriteCorelFile()
Definition: MHO_MK4CorelInterfaceReversed.cc:397
void SetWeightData(weight_store_type *weight_data)
Definition: MHO_MK4CorelInterfaceReversed.hh:48
void SetOutputDirectory(const std::string &output_dir)
Definition: MHO_MK4CorelInterfaceReversed.cc:69
virtual ~MHO_MK4CorelInterfaceReversed()
Definition: MHO_MK4CorelInterfaceReversed.cc:42
void SetRootFileName(std::string root_filename)
Definition: MHO_MK4CorelInterfaceReversed.cc:63
struct mk4_corel * GetCorelStructure()
Definition: MHO_MK4CorelInterfaceReversed.hh:54
MHO_MK4CorelInterfaceReversed()
Definition: MHO_MK4CorelInterfaceReversed.cc:32
void FreeAllocated()
Definition: MHO_MK4CorelInterfaceReversed.cc:53
Class MHO_TableContainer.
Definition: MHO_TableContainer.hh:36
struct index_tag * index
Definition: mk4_data.h:78
Definition: mk4_data.h:71
Definition: MHO_AdhocFlagging.hh:18