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