HOPS
HOPS class reference
MHO_DiFXStationCoordBuilder.hh
Go to the documentation of this file.
1 #ifndef MHO_DiFXStationCoordBuilder_HH__
2 #define MHO_DiFXStationCoordBuilder_HH__
3 
4 #include <cstddef>
5 #include <map>
6 #include <string>
7 
10 
11 namespace hops
12 {
13 
30 {
31  public:
32  MHO_DiFXStationCoordBuilder(): fInput(nullptr), fScanIndex(0) {}
33 
35 
36  void SetDiFXInputData(const mho_json* input) { fInput = input; }
37 
38  void SetScanIndex(std::size_t idx) { fScanIndex = idx; }
39 
40  //build station_coord_type entries for every antenna in the current scan
41  void Extract(std::map< std::string, station_coord_type* >& out);
42 
43  private:
44  //add the clock polynomial (shifted to the model interval start) into the delay
45  //row of st_coord. Matches difx2mark4 createType3s.c behavior.
46  void ApplyDelayClockCorrection(const mho_json& ant, const mho_json& ant_poly, station_coord_type* st_coord);
47 
48  //evaluate the (possibly higher-order) clock polynomial at offset dt and write
49  //the shifted polynomial into clockOut. Returns clockorder+1 on success, negative
50  //on error (-1 missing fields, -2 buffer too small). Lifted from difxio
51  //difx_antenna.c to avoid an extra link dependency.
52  int GetDifxAntennaShiftedClock(const mho_json& da, double dt, int outputClockSize, double* clockOut);
53 
54  //fill the constant term of the parallactic-angle row using the (d2m4) previous formula
55  //(geocentric -> geodetic latitude, az/el midpoint of the spline interval).
56  //all higher-order coefficients are zeroed; CALC does not yet emit a parangle spline.
57  void ComputeZerothOrderParallacticAngle(station_coord_type* st_coord, double X, double Y, double Z, double src_dec,
58  double interval_sec);
59 
60  const mho_json* fInput;
61  std::size_t fScanIndex;
62 
63  static constexpr double MICROSEC_TO_SEC = 1e-6;
64 };
65 
66 } // namespace hops
67 
68 #endif
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
Responsible for building the per-station station_coord_type spline data (delay, az,...
Definition: MHO_DiFXStationCoordBuilder.hh:30
void SetScanIndex(std::size_t idx)
Definition: MHO_DiFXStationCoordBuilder.hh:38
void SetDiFXInputData(const mho_json *input)
Definition: MHO_DiFXStationCoordBuilder.hh:36
MHO_DiFXStationCoordBuilder()
Definition: MHO_DiFXStationCoordBuilder.hh:32
void Extract(std::map< std::string, station_coord_type * > &out)
Definition: MHO_DiFXStationCoordBuilder.cc:15
Class MHO_TableContainer.
Definition: MHO_TableContainer.hh:36
Definition: MHO_AdhocFlagging.hh:18