General Purpose Geodetic Library
SgObservation.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef SG_OBSERVATION_H
24 #define SG_OBSERVATION_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <math.h>
33 #include <QtCore/QString>
34 
35 
36 
37 #include <SgMJD.h>
38 #include <SgAttribute.h>
39 #include <SgVector.h>
40 
41 
42 class SgTaskConfig;
43 class SgTaskManager;
44 class SgVlbiBand;
45 
47 {
59  TECH_ANY
60 };
61 
62 
63 
64 
65 
66 
67 /***===================================================================================================*/
73 class SgObservation : public SgMJD, public SgAttribute
74 {
75 public:
77  {
78  Attr_NOT_VALID = 1<<0,
79  Attr_PROCESSED = 1<<1,
81  };
82 
83  // Statics:
84 
85 
86 
87  //
88  // constructors/destructors:
89  //
93  inline SgObservation();
94 
99  inline SgObservation(const SgObservation& obs);
100 
104  inline virtual ~SgObservation();
105 
106 
107 
108  //
109  // Interfaces:
110  //
113  inline SgObservation& operator=(const SgObservation& obs);
114 
117  inline virtual TechniqueID getTechniqueID() const;
118 
121  inline virtual int getMediaIdx() const;
122 
126  inline virtual void setTechniqueID(TechniqueID id);
127 
131  inline virtual void setMediaIdx(int idx);
132 
135  inline virtual const SgMJD& getMJD() const;
136 
139  inline virtual void setMJD(const SgMJD&);
140 
141  //
142  // Functions:
143  //
146  inline virtual const QString className() const;
147 
150  virtual bool selfCheck() =0;
151 
154  inline virtual bool isEligible(const SgTaskConfig*);
155 
159 
162  virtual void prepare4Analysis(SgTaskManager*) =0;
163 
166 // virtual void evaluateResiduals(SgTaskManager*, SgVlbiBand*, bool) =0;
167 
170  virtual void evaluateResiduals(SgTaskManager*) =0;
171 
174  virtual const SgVector& o_c() =0;
175 
178  virtual const SgVector& sigma() =0;
179 
182  inline virtual bool operator==(const SgObservation& obs) const;
183 
186  inline virtual bool operator!=(const SgObservation& obs) const;
187 
190  inline virtual bool operator<(const SgObservation& obs) const;
191 
192 
193 
194  //
195  // Friends:
196  //
197 
198  //
199  // I/O:
200  //
201  // ...
202 
203 protected:
206 };
207 /*=====================================================================================================*/
208 
209 
210 
211 
212 
213 /*=====================================================================================================*/
214 /* */
215 /* SgObservation inline members: */
216 /* */
217 /*=====================================================================================================*/
218 //
219 //
220 // CONSTRUCTORS:
221 //
222 // An empty constructor:
224  SgMJD(tZero),
225  SgAttribute()
226 {
228  mediaIdx_ = -1;
229 };
230 
231 
232 
233 // A regular constructor:
235  SgMJD(obs),
236  SgAttribute(obs)
237 {
239  setMediaIdx(obs.getMediaIdx());
240 };
241 
242 
243 
244 // A destructor:
246 {
247  // nothing to do
248 };
249 
250 
251 
252 //
253 // INTERFACES:
254 //
255 // returns Tech. ID
257 {
258  return techniqueID_;
259 };
260 
261 
262 
263 // returns current index
264 inline int SgObservation::getMediaIdx() const
265 {
266  return mediaIdx_;
267 };
268 
269 
270 
271 //
273 {
274  techniqueID_ = id;
275 };
276 
277 
278 
279 //
280 inline void SgObservation::setMediaIdx(int idx)
281 {
282  mediaIdx_ = idx;
283 };
284 
285 
286 
287 //
288 inline const SgMJD& SgObservation::getMJD() const
289 {
290  return *this;
291 };
292 
293 
294 
295 //
296 inline void SgObservation::setMJD(const SgMJD& t)
297 {
298  SgMJD::operator=(t);
299 };
300 
301 
302 
303 //
304 // FUNCTIONS:
305 //
306 //
307 //
308 inline const QString SgObservation::className() const
309 {
310  return "SgObservation";
311 };
312 
313 
314 
315 //
317 {
318  // clear attribute:
320 };
321 
322 
323 
324 //
325 inline bool SgObservation::operator==(const SgObservation& obs) const
326 {
327  return SgMJD::operator==(obs) &&
328  getMediaIdx() == obs.getMediaIdx() &&
329  getTechniqueID() == obs.getTechniqueID();
330 };
331 
332 
333 
334 //
335 inline bool SgObservation::operator!=(const SgObservation& obs) const
336 {
337  return !(obs==*this);
338 };
339 
340 
341 
342 //
343 inline bool SgObservation::operator<(const SgObservation& obs) const
344 {
345 // return *(SgMJD*)this < (const SgMJD&)obs ? true :
346  return *this < (const SgMJD&)obs ? true :
347  (SgMJD::operator==(obs) ?
348  (getMediaIdx()<obs.getMediaIdx() ? true :
349  (getMediaIdx()==obs.getMediaIdx() ? getTechniqueID()<obs.getTechniqueID() : false) ) : false);
350 };
351 
352 
353 
354 
355 
356 //
357 // FRIENDS:
358 //
359 //
360 //
361 
362 
363 /*=====================================================================================================*/
364 
365 
366 
367 
368 
369 /*=====================================================================================================*/
370 //
371 // aux functions:
372 //
373 
374 
375 
376 /*=====================================================================================================*/
377 //
378 // variables:
379 //
380 
381 
382 
383 /*=====================================================================================================*/
384 #endif // SG_OBSERVATION_H
const SgMJD tZero(1957, 10, 4)
TechniqueID
Definition: SgObservation.h:47
@ TECH_DORIS
D: satellite Doppler tracking;.
Definition: SgObservation.h:53
@ TECH_VLBI
R: Radio interferometry;.
Definition: SgObservation.h:48
@ TECH_LLR
M: Lunar laser ranging;.
Definition: SgObservation.h:50
@ TECH_CG
G: conventional geodesy (for SSC)
Definition: SgObservation.h:55
@ TECH_SLR
L: satellite laser ranging;.
Definition: SgObservation.h:52
@ TECH_TIE
T: ties;.
Definition: SgObservation.h:57
@ TECH_AD
*: atmospheric data
Definition: SgObservation.h:56
@ TECH_OA
A: optical astrometry;.
Definition: SgObservation.h:49
@ TECH_ANY
_: any above
Definition: SgObservation.h:59
@ TECH_GPS
P: Global Positioning System;.
Definition: SgObservation.h:51
@ TECH_COMBINED
C: combined data;.
Definition: SgObservation.h:54
@ TECH_UNKN
?: uknown.
Definition: SgObservation.h:58
bool isAttr(uint a) const
Definition: SgAttribute.h:226
Definition: SgMJD.h:59
SgMJD & operator=(const SgMJD &T)
Definition: SgMJD.h:473
bool operator==(const SgMJD &T) const
Definition: SgMJD.h:517
virtual bool operator!=(const SgObservation &obs) const
virtual ~SgObservation()
virtual void prepare4Analysis(SgTaskManager *)=0
virtual int getMediaIdx() const
virtual void evaluateResiduals(SgTaskManager *)=0
virtual const SgVector & o_c()=0
virtual bool operator==(const SgObservation &obs) const
virtual void setTechniqueID(TechniqueID id)
virtual TechniqueID getTechniqueID() const
virtual const QString className() const
virtual const SgVector & sigma()=0
virtual bool operator<(const SgObservation &obs) const
virtual bool isEligible(const SgTaskConfig *)
SgObservation & operator=(const SgObservation &obs)
virtual void setMediaIdx(int idx)
TechniqueID techniqueID_
virtual void setMJD(const SgMJD &)
virtual bool selfCheck()=0
virtual void evaluateTheoreticalValues(SgTaskManager *)=0
@ Attr_FORCE_2_PROCESS
include the observation in data analysis in any condition;
Definition: SgObservation.h:80
@ Attr_NOT_VALID
omit the observation;
Definition: SgObservation.h:78
@ Attr_PROCESSED
the observation has been processed;
Definition: SgObservation.h:79
virtual const SgMJD & getMJD() const