CARMA C++
TrialProjectData.h
Go to the documentation of this file.
1 
11 #ifndef CARMA_SDP_TRIALPROJECTDATA_H
12 #define CARMA_SDP_TRIALPROJECTDATA_H
13 
14 // Carma includes
15 
16 // Carma tools includes
17 #include <xercesc/sax2/Attributes.hpp>
18 
19 // C++ standard library includes
20 #include <vector>
21 #include <map>
22 
23 // Namespace using directives
24 using namespace XERCES_CPP_NAMESPACE;
25 
26 // Class definitions
27 namespace carma {
28  namespace sdp {
29 
33  {
34  int setupNumber;
35  int numberOfWindows;
36  std::vector<int> windowNumber;
37  std::vector<double> resolution;
38  std::vector<int> numberOfChannels;
39  std::vector<double> minfreq;
40  };
41 
45  {
46  std::string sourceName;
47  double ra;
48  double dec;
49  std::string file;
50  double vsource;
51  std::string veltype;
52  int selfcalabratable;
53  double observationLength;
54  std::vector<int> correlatorSetup;
55  };
56 
60  {
61  std::string calibratorName;
62  double ra;
63  double dec;
64  std::string type;
65  std::string file;
66  double observationLength;
67  std::vector<int> correlatorSetup;
68  };
69 
73  {
74  std::string molecule;
75  std::string transition;
76  };
77 
85  {
86  public:
90 
93  TrialProjectData(const std::string& obsBlockId);
94 
98 
101  void resetIntegrationData();
102 
105  bool addAstroHdrElement(const Attributes& attr);
106 
109  bool addFreqInfo(const std::vector<double>& sfreq,
110  const std::vector<double>& sdf,
111  const std::vector<int>& nschan);
112 
115  bool processIntegration();
116 
119  bool updateProjectDatabase();
120 
121  void addScriptToMiriad(std::string miriadFile);
122 
123  private:
127  std::string obsBlockId_p, astroHdrFile_p;
128 
132  std::vector<std::string> obsBlockIdComponents_p;
133 
138  std::vector<int> antennas_p;
139  double time_p, lst_p, ra_p, dec_p, veldop_p;
140  float inttime_p, dra_p, ddec_p, vsource_p;
141  int fswitch_p, selfcal_p;
142  std::string source_p, veltype_p, purpose_p, obsline_p;
143  std::map<std::string, bool> astroHdrValidity_p;
144 
149  std::vector<double> sfreq_p, sdf_p;
150  std::vector<int> nschan_p;
151  int numspw_p;
152 
155  std::map<int, ProjectCorrelatorSetup> correlatorSetup_p;
156  std::vector<ProjectSourceData> sources_p;
157  std::vector<ProjectCalibratorData> calibrators_p;
158  std::vector<ProjectTargetData> targets_p;
159  std::vector<double> trialObservedLST_p;
160  std::vector<float> pointingOffsets_p;
161  std::vector<double> trialObservationDate_p;
162  int currentCorrelatorSetup_p, fastSwitch_p, numberOfAntennas_p;
163  bool correlatorValid_p;
164  bool firstTime;
165  bool processIntegrationCalled_;
168  void processCorrelatorSetupInfo();
169 
172  void processSourceInfo();
173 
176  void processCalibratorInfo();
177 
180  void processTargetInfo();
181 
184  void processPointingOffsetInfo();
185 
188  void processAntennaInfo();
189 
192  void processSwitchingInfo();
193 
196  void processTimeInfo();
197 
200  bool valid(const std::string& names);
201 
204  double rdiff(const double& a, const double& b);
205 
208  void compareType(const std::string& str1, std::string& str2);
209  };
210  };
211 };
212 
213 #endif
214 
Project data target information.
Project data source information.
A class to accumulate project data for an obsblock trial.
Project data correlator setup.
Project data calibrator information.