HOPS
HOPS class reference
MHO_DiFXOvexPatcher.hh
Go to the documentation of this file.
1 #ifndef MHO_DiFXOvexPatcher_HH__
2 #define MHO_DiFXOvexPatcher_HH__
3 
4 #include <map>
5 #include <string>
6 
9 #include "MHO_StationCodeMap.hh"
10 
11 namespace hops
12 {
13 
36 {
37  public:
38  MHO_DiFXOvexPatcher(): fInput(nullptr), fStationCodeMap(nullptr), fZoomBandRebuilder(nullptr), fExperNum(0) {}
39 
40  void SetDiFXInputData(const mho_json* input) { fInput = input; }
41 
42  void SetStationCodeMap(MHO_StationCodeMap* m) { fStationCodeMap = m; }
43 
44  void SetExperimentNumber(int n) { fExperNum = n; }
45 
46  void SetZoomBandRebuilder(MHO_DiFXZoomBandRebuilder* zb) { fZoomBandRebuilder = zb; }
47 
48  //apply every OVEX patch in place. Caller must have already trimmed
49  //vex_root to a single scan + source (see MHO_DiFXScanProcessor::CreateRootFileObject).
50  void Patch(mho_json& vex_root, const std::string& mode_name);
51 
52  //populated by Patch() from $SITE iteration; consumed by MHO_DiFXScanProcessor
53  //and MHO_DiFXBaselineProcessor...we need these for later
54  const std::map< std::string, std::string >& GetDiFX2VexStationCodes() const { return fDiFX2VexStationCodes; }
55 
56  const std::map< std::string, std::string >& GetDiFX2VexStationNames() const { return fDiFX2VexStationNames; }
57 
58  //d2m4-style fourfit reference time for a scan: midpoint of latest start /
59  //earliest stop across stations, truncated to integer second, returned as a
60  //vex-format timestamp. Pure function -- no patcher state required.
61  static std::string ComputeFourfitReftime(const mho_json& scan_obj);
62 
63  private:
64  void ApplyDiFXPhaseCalComb(mho_json& vex_root, const std::string& mode_name);
65 
66  const mho_json* fInput;
67  MHO_StationCodeMap* fStationCodeMap;
68  MHO_DiFXZoomBandRebuilder* fZoomBandRebuilder;
69  int fExperNum;
70 
71  std::map< std::string, std::string > fDiFX2VexStationCodes;
72  std::map< std::string, std::string > fDiFX2VexStationNames;
73 };
74 
75 } // namespace hops
76 
77 #endif
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
takes care of all the wierd structural fix-ups that turn a freshly-parsed VEX json into the special O...
Definition: MHO_DiFXOvexPatcher.hh:36
void SetDiFXInputData(const mho_json *input)
Definition: MHO_DiFXOvexPatcher.hh:40
const std::map< std::string, std::string > & GetDiFX2VexStationCodes() const
Definition: MHO_DiFXOvexPatcher.hh:54
MHO_DiFXOvexPatcher()
Definition: MHO_DiFXOvexPatcher.hh:38
void SetExperimentNumber(int n)
Definition: MHO_DiFXOvexPatcher.hh:44
static std::string ComputeFourfitReftime(const mho_json &scan_obj)
Definition: MHO_DiFXOvexPatcher.cc:221
void SetZoomBandRebuilder(MHO_DiFXZoomBandRebuilder *zb)
Definition: MHO_DiFXOvexPatcher.hh:46
const std::map< std::string, std::string > & GetDiFX2VexStationNames() const
Definition: MHO_DiFXOvexPatcher.hh:56
void Patch(mho_json &vex_root, const std::string &mode_name)
Definition: MHO_DiFXOvexPatcher.cc:18
void SetStationCodeMap(MHO_StationCodeMap *m)
Definition: MHO_DiFXOvexPatcher.hh:42
Creates new $FREQ/$BBC/$IF VEX sections for stations that DiFX correlated via zoom bands (zoomFreqId/...
Definition: MHO_DiFXZoomBandRebuilder.hh:33
Class MHO_StationCodeMap Handles the mapping of two character and one character station representatio...
Definition: MHO_StationCodeMap.hh:27
Definition: MHO_AdhocFlagging.hh:18