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 
37 {
38  public:
39  MHO_DiFXOvexPatcher(): fInput(nullptr), fStationCodeMap(nullptr), fZoomBandRebuilder(nullptr), fExperNum(0) {}
40 
41  void SetDiFXInputData(const mho_json* input) { fInput = input; }
42 
43  void SetStationCodeMap(MHO_StationCodeMap* m) { fStationCodeMap = m; }
44 
45  void SetExperimentNumber(int n) { fExperNum = n; }
46 
47  void SetZoomBandRebuilder(MHO_DiFXZoomBandRebuilder* zb) { fZoomBandRebuilder = zb; }
48 
49  //apply every OVEX patch in place. Caller must have already trimmed
50  //vex_root to a single scan + source (see MHO_DiFXScanProcessor::CreateRootFileObject).
51  void Patch(mho_json& vex_root, const std::string& mode_name);
52 
53  //populated by Patch() from $SITE iteration; consumed by MHO_DiFXScanProcessor
54  //and MHO_DiFXBaselineProcessor...we need these for later
55  const std::map< std::string, std::string >& GetDiFX2VexStationCodes() const { return fDiFX2VexStationCodes; }
56 
57  const std::map< std::string, std::string >& GetDiFX2VexStationNames() const { return fDiFX2VexStationNames; }
58 
59  //d2m4-style fourfit reference time for a scan: midpoint of latest start /
60  //earliest stop across stations, truncated to integer second, returned as a
61  //vex-format timestamp. Pure function -- no patcher state required.
62  static std::string ComputeFourfitReftime(const mho_json& scan_obj);
63 
64  private:
65  //rewrite chan_def.phase_cal_id entries so they reference a pcal_id actually
66  //defined in the station's $PHASE_CAL_DETECT block (otherwise fourfit3 aborts).
67  void NormalizePhaseCalIds(mho_json& vex_root, const std::string& mode_name);
68 
69  const mho_json* fInput;
70  MHO_StationCodeMap* fStationCodeMap;
71  MHO_DiFXZoomBandRebuilder* fZoomBandRebuilder;
72  int fExperNum;
73 
74  std::map< std::string, std::string > fDiFX2VexStationCodes;
75  std::map< std::string, std::string > fDiFX2VexStationNames;
76 };
77 
78 } // namespace hops
79 
80 #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:37
void SetDiFXInputData(const mho_json *input)
Definition: MHO_DiFXOvexPatcher.hh:41
const std::map< std::string, std::string > & GetDiFX2VexStationCodes() const
Definition: MHO_DiFXOvexPatcher.hh:55
MHO_DiFXOvexPatcher()
Definition: MHO_DiFXOvexPatcher.hh:39
void SetExperimentNumber(int n)
Definition: MHO_DiFXOvexPatcher.hh:45
static std::string ComputeFourfitReftime(const mho_json &scan_obj)
Definition: MHO_DiFXOvexPatcher.cc:220
void SetZoomBandRebuilder(MHO_DiFXZoomBandRebuilder *zb)
Definition: MHO_DiFXOvexPatcher.hh:47
const std::map< std::string, std::string > & GetDiFX2VexStationNames() const
Definition: MHO_DiFXOvexPatcher.hh:57
void Patch(mho_json &vex_root, const std::string &mode_name)
Definition: MHO_DiFXOvexPatcher.cc:16
void SetStationCodeMap(MHO_StationCodeMap *m)
Definition: MHO_DiFXOvexPatcher.hh:43
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