General Purpose Geodetic Library
SgObjectInfo.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_OBJECT_INFO_H
24 #define SG_OBJECT_INFO_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <math.h>
33 
34 #include <QtCore/QMap>
35 #include <QtCore/QString>
36 
37 #include <SgAttribute.h>
38 #include <SgMJD.h>
39 #include <SgWrmsable.h>
40 
41 
42 
43 
44 class QDataStream;
45 
47 
48 
49 /***===================================================================================================*/
55 class SgObjectInfo : public SgAttribute
56 {
57  friend class SgVlbiBaselineInfo;
58 public:
59  // Statics:
62  static const QString className();
63 
64  //
65  // constructors/destructors:
66  //
70  inline SgObjectInfo(int idx=-1, const QString& key="Unknown", const QString& aka="");
71 
72  inline SgObjectInfo(const SgObjectInfo&);
73 
77  inline ~SgObjectInfo();
78 
79 
80 
81  //
82  // Interfaces:
83  //
86  inline const QString& getKey() const;
87 
90  inline const QString& getAka() const;
91 
94  inline int getIdx() const;
95 
98  inline int numTotal(DataType dType) const;
99 
102  inline int numProcessed(DataType dType) const;
103 
106  inline int numUsable(DataType) const;
107 
108  inline double getSigma2add(DataType) const;
109 
112  inline const SgMJD& tFirst(DataType) const;
113 
116  inline const SgMJD& tLast(DataType) const;
117 
120  inline double normedResid(DataType) const;
121 
124  inline double getSFF_NrmRes(DataType) const;
125 
128  inline double getSFF_NrmRes_plus_15(DataType) const;
129 
132  inline double chi2(DataType) const;
133 
136  inline double reducedChi2(DataType) const;
137 
140  inline double weightScaleCoefficient(DataType) const;
141 
144  inline double dispersion(DataType, bool=false) const;
145 
149  inline void setKey(const QString& key);
150 
154  inline void setAka(const QString& aka);
155 
159  inline void setIdx(int idx);
160 
164  inline void setNumUsable(DataType dType, int n);
165 
169  inline void setNormedResid(DataType dType, double d);
170 
171  inline void setSigma2add(DataType dType, double d);
172 
176  inline void setSFF_NrmRes(DataType dType, double d);
177 
181  inline void setSFF_NrmRes_plus_15(DataType dType, double d);
182 
183 
184 
185  //
186  // Functions:
187  //
190  inline void incNumTotal(DataType, int=1);
191 
194  inline void decNumTotal(DataType, int=1);
195 
196  inline void incNumUsable(DataType, int=1);
197  inline void decNumUsable(DataType, int=1);
198 
199 
205  inline void addWrms(DataType, const SgMJD& t, double o_c, double w, double auxSum);
206 
209  inline double wrms(DataType) const;
210 
211  inline double dof(DataType) const;
212 
215  inline void clearWrms();
216 
219  inline void copyStatistics(SgObjectInfo*);
220 
221  inline void copySigmas2add(SgObjectInfo*);
222 
223  inline void resetAllEditings();
224 
225  void recalcSigma2add(const SgTaskConfig* cfg);
226 
228  const SgTaskConfig* cfg);
229 
230  //
231  // Friends:
232  //
233 
234  //
235  // I/O:
236  //
238 
240 
241 
242 
243 private:
244  // identifications:
245  QString key_;
246  QString aka_;
247  int idx_;
250  //
252  QMap<DataType, int> dType2Idx_;
253 };
254 /*=====================================================================================================*/
255 
256 
257 
258 
259 
260 /*=====================================================================================================*/
261 /* */
262 /* SgObjectInfo inline members: */
263 /* */
264 /*=====================================================================================================*/
265 //
266 //
267 // CONSTRUCTORS:
268 //
269 // An empty constructor:
270 inline SgObjectInfo::SgObjectInfo(int idx, const QString& key, const QString& aka) :
271  SgAttribute(),
272  key_(key),
273  aka_(aka),
276  dType2Idx_()
277 {
278  idx_ = idx;
279  dType2Idx_[DT_DELAY] = 0;
280  dType2Idx_[DT_RATE ] = 1;
283 };
284 
285 
286 
287 // A copy constructor:
289  SgAttribute(obj),
290  key_(obj.getKey()),
291  aka_(obj.getAka()),
294  dType2Idx_()
295 {
296  idx_ = obj.getIdx();
297  dType2Idx_[DT_DELAY] = 0;
298  dType2Idx_[DT_RATE ] = 1;
301 };
302 
303 
304 
305 
306 
307 // A destructor:
309 {
310  // nothing to do
311 };
312 
313 
314 
315 //
316 // INTERFACES:
317 //
318 //
319 inline const QString& SgObjectInfo::getKey() const
320 {
321  return key_;
322 };
323 
324 
325 
326 //
327 inline const QString& SgObjectInfo::getAka() const
328 {
329  return aka_;
330 };
331 
332 
333 
334 //
335 inline int SgObjectInfo::getIdx() const
336 {
337  return idx_;
338 };
339 
340 
341 
342 //
343 inline int SgObjectInfo::numTotal(DataType dType) const
344 {
345  return wrmss[dType2Idx_[dType]]->getNumTotal();
346 };
347 
348 
349 
350 //
351 inline int SgObjectInfo::numProcessed(DataType dType) const
352 {
353  return wrmss[dType2Idx_[dType]]->getNumProcessed();
354 };
355 
356 
357 
358 //
359 inline int SgObjectInfo::numUsable(DataType dType) const
360 {
361  return wrmss[dType2Idx_[dType]]->getNumUsable();
362 };
363 
364 
365 
366 //
367 inline double SgObjectInfo::getSigma2add(DataType dType) const
368 {
369  return wrmss[dType2Idx_[dType]]->getSigma2add();
370 };
371 
372 
373 
374 //
375 inline const SgMJD& SgObjectInfo::tFirst(DataType dType) const
376 {
377  return wrmss[dType2Idx_[dType]]->tFirst();
378 };
379 
380 
381 
382 //
383 inline const SgMJD& SgObjectInfo::tLast(DataType dType) const
384 {
385  return wrmss[dType2Idx_[dType]]->tLast();
386 };
387 
388 
389 
390 //
391 inline double SgObjectInfo::normedResid(DataType dType) const
392 {
393  return wrmss[dType2Idx_[dType]]->getNormedResid();
394 };
395 
396 
397 
398 //
399 inline double SgObjectInfo::getSFF_NrmRes(DataType dType) const
400 {
401  return wrmss[dType2Idx_[dType]]->getSFF_NrmRes();
402 };
403 
404 
405 
406 //
408 {
409  return wrmss[dType2Idx_[dType]]->getSFF_NrmRes_plus_15();
410 };
411 
412 
413 
414 //
415 inline double SgObjectInfo::chi2(DataType dType) const
416 {
417  return wrmss[dType2Idx_[dType]]->chi2();
418 };
419 
420 
421 
422 //
423 inline double SgObjectInfo::reducedChi2(DataType dType) const
424 {
425  return wrmss[dType2Idx_[dType]]->reducedChi2();
426 };
427 
428 
429 
430 //
432 {
433  return wrmss[dType2Idx_[dType]]->weightScaleCoefficient();
434 };
435 
436 
437 
438 //
439 inline double SgObjectInfo::dispersion(DataType dType, bool isSolveCompatible) const
440 {
441  return wrmss[dType2Idx_[dType]]->dispersion(isSolveCompatible);
442 };
443 
444 
445 
446 //
447 inline void SgObjectInfo::setKey(const QString& key)
448 {
449  key_ = key;
450 };
451 
452 
453 
454 //
455 inline void SgObjectInfo::setAka(const QString& aka)
456 {
457  aka_ = aka;
458 };
459 
460 
461 
462 //
463 inline void SgObjectInfo::setIdx(int idx)
464 {
465  idx_ = idx;
466 };
467 
468 
469 
470 //
471 inline void SgObjectInfo::setSigma2add(DataType dType, double s)
472 {
473  return wrmss[dType2Idx_[dType]]->setSigma2add(s);
474 };
475 
476 
477 
478 //
479 inline void SgObjectInfo::setNumUsable(DataType dType, int n)
480 {
481  wrmss[dType2Idx_[dType]]->setNumUsable(n);
482 };
483 
484 
485 
486 //
487 inline void SgObjectInfo::setNormedResid(DataType dType, double d)
488 {
489  wrmss[dType2Idx_[dType]]->setNormedResid(d);
490 };
491 
492 
493 
494 //
495 inline void SgObjectInfo::setSFF_NrmRes(DataType dType, double d)
496 {
497  wrmss[dType2Idx_[dType]]->setSFF_NrmRes(d);
498 };
499 
500 
501 
502 //
503 inline void SgObjectInfo::setSFF_NrmRes_plus_15(DataType dType, double d)
504 {
506 };
507 
508 
509 
510 
511 
512 
513 
514 //
515 // FUNCTIONS:
516 //
517 //
518 //
519 inline void SgObjectInfo::incNumTotal(DataType dType, int n)
520 {
521  wrmss[dType2Idx_[dType]]->incNumTotal(n);
522 };
523 
524 
525 
526 //
527 inline void SgObjectInfo::decNumTotal(DataType dType, int n)
528 {
529  wrmss[dType2Idx_[dType]]->decNumTotal(n);
530 };
531 
532 
533 //
534 inline void SgObjectInfo::incNumUsable(DataType dType, int n)
535 {
536  wrmss[dType2Idx_[dType]]->incNumUsable(n);
537 };
538 
539 
540 
541 //
542 inline void SgObjectInfo::decNumUsable(DataType dType, int n)
543 {
544  wrmss[dType2Idx_[dType]]->decNumUsable(n);
545 };
546 
547 
548 
549 //
551 {
553  rateWrms_ .clearWrms();
554 };
555 
556 
557 
558 //
559 inline void SgObjectInfo::addWrms(DataType dType, const SgMJD &t, double o_c, double w, double auxSum)
560 {
561  wrmss[dType2Idx_[dType]]->addWrms(t, o_c, w, auxSum);
562 };
563 
564 
565 
566 //
567 inline double SgObjectInfo::wrms(DataType dType) const
568 {
569  return wrmss[dType2Idx_[dType]]->wrms();
570 };
571 
572 
573 
574 //
575 inline double SgObjectInfo::dof(DataType dType) const
576 {
577  return wrmss[dType2Idx_[dType]]->dof();
578 };
579 
580 
581 
582 //
584 {
585  if (info)
586  {
589  };
590 };
591 
592 
593 
594 //
596 {
599 };
600 
601 
602 
603 //
605 {
606  if (info)
607  {
610  };
611 };
612 
613 
614 
615 //
616 #include <SgTaskConfig.h>
617 
619  const SgTaskConfig* cfg)
620 {
623 };
624 
625 
626 
627 
628 //
629 // FRIENDS:
630 //
631 //
632 //
633 
634 
635 /*=====================================================================================================*/
636 
637 
638 
639 
640 
641 /*=====================================================================================================*/
642 //
643 // aux functions:
644 //
645 
646 
647 /*=====================================================================================================*/
648 #endif //SG_OBJECT_INFO_H
SgObjectBrowseMode
Definition: SgObjectInfo.h:46
@ OBM_BAND
Definition: SgObjectInfo.h:46
@ OBM_PROJECT
Definition: SgObjectInfo.h:46
@ OBM_SESSION
Definition: SgObjectInfo.h:46
DataType
Definition: SgWrmsable.h:43
@ DT_DELAY
Definition: SgWrmsable.h:44
@ DT_RATE
Definition: SgWrmsable.h:45
Definition: SgMJD.h:59
void setKey(const QString &key)
Definition: SgObjectInfo.h:447
void calcNormalizedResiduals(const QList< SgVlbiObservable * > &observables, const SgTaskConfig *cfg)
Definition: SgObjectInfo.h:618
SgObjectInfo(int idx=-1, const QString &key="Unknown", const QString &aka="")
Definition: SgObjectInfo.h:270
void setNumUsable(DataType dType, int n)
Definition: SgObjectInfo.h:479
bool loadIntermediateResults(QDataStream &)
int getIdx() const
Definition: SgObjectInfo.h:335
void clearWrms()
Definition: SgObjectInfo.h:550
double getSFF_NrmRes_plus_15(DataType) const
Definition: SgObjectInfo.h:407
void incNumTotal(DataType, int=1)
Definition: SgObjectInfo.h:519
void decNumTotal(DataType, int=1)
Definition: SgObjectInfo.h:527
double dispersion(DataType, bool=false) const
Definition: SgObjectInfo.h:439
void copySigmas2add(SgObjectInfo *)
Definition: SgObjectInfo.h:604
SgWrmsable delayWrms_
local (session) index;
Definition: SgObjectInfo.h:248
void resetAllEditings()
Definition: SgObjectInfo.h:595
SgWrmsable rateWrms_
Definition: SgObjectInfo.h:249
QString key_
Definition: SgObjectInfo.h:245
QMap< DataType, int > dType2Idx_
Definition: SgObjectInfo.h:252
double getSigma2add(DataType) const
Definition: SgObjectInfo.h:367
void decNumUsable(DataType, int=1)
Definition: SgObjectInfo.h:542
const QString & getKey() const
Definition: SgObjectInfo.h:319
int numProcessed(DataType dType) const
Definition: SgObjectInfo.h:351
int idx_
"also known as", a second name or an alias;
Definition: SgObjectInfo.h:247
const QString & getAka() const
Definition: SgObjectInfo.h:327
double getSFF_NrmRes(DataType) const
Definition: SgObjectInfo.h:399
void setSFF_NrmRes_plus_15(DataType dType, double d)
Definition: SgObjectInfo.h:503
const SgMJD & tFirst(DataType) const
Definition: SgObjectInfo.h:375
void recalcSigma2add(const SgTaskConfig *cfg)
void setIdx(int idx)
Definition: SgObjectInfo.h:463
SgWrmsable * wrmss[2]
Definition: SgObjectInfo.h:251
void setSFF_NrmRes(DataType dType, double d)
Definition: SgObjectInfo.h:495
int numUsable(DataType) const
Definition: SgObjectInfo.h:359
double weightScaleCoefficient(DataType) const
Definition: SgObjectInfo.h:431
double normedResid(DataType) const
Definition: SgObjectInfo.h:391
void setAka(const QString &aka)
Definition: SgObjectInfo.h:455
void incNumUsable(DataType, int=1)
Definition: SgObjectInfo.h:534
void setSigma2add(DataType dType, double d)
Definition: SgObjectInfo.h:471
const SgMJD & tLast(DataType) const
Definition: SgObjectInfo.h:383
double dof(DataType) const
Definition: SgObjectInfo.h:575
void setNormedResid(DataType dType, double d)
Definition: SgObjectInfo.h:487
double chi2(DataType) const
Definition: SgObjectInfo.h:415
void copyStatistics(SgObjectInfo *)
Definition: SgObjectInfo.h:583
void addWrms(DataType, const SgMJD &t, double o_c, double w, double auxSum)
Definition: SgObjectInfo.h:559
bool saveIntermediateResults(QDataStream &) const
double wrms(DataType) const
Definition: SgObjectInfo.h:567
QString aka_
a key – a string of chars that identifies an object;
Definition: SgObjectInfo.h:246
int numTotal(DataType dType) const
Definition: SgObjectInfo.h:343
static const QString className()
double reducedChi2(DataType) const
Definition: SgObjectInfo.h:423
QList< SgVlbiObservable * > & observables()
void setNormedResid(double d)
Definition: SgWrmsable.h:162
void setSigma2add(double s)
Definition: SgWrmsable.h:157
double weightScaleCoefficient() const
Definition: SgWrmsable.h:188
const SgMJD & tFirst() const
Definition: SgWrmsable.h:113
void addWrms(const SgMJD &t, double o_c, double w, double auxSum)
Definition: SgWrmsable.cpp:53
void calcNormalizedResiduals(const QList< SgVlbiObservable * > &observables, const SgTaskConfig *cfg)
Definition: SgWrmsable.cpp:141
double dispersion(bool isSolveCompatible) const
Definition: SgWrmsable.h:340
const SgMJD & tLast() const
Definition: SgWrmsable.h:117
double reducedChi2() const
Definition: SgWrmsable.h:184
double getNormedResid() const
Definition: SgWrmsable.h:121
double wrms() const
Definition: SgWrmsable.h:367
void clearWrms()
Definition: SgWrmsable.h:355
int getNumUsable() const
Definition: SgWrmsable.h:101
void copyStatistics(SgWrmsable *wrms)
Definition: SgWrmsable.cpp:71
double getSFF_NrmRes_plus_15() const
Definition: SgWrmsable.h:129
int getNumTotal() const
Definition: SgWrmsable.h:97
void setSFF_NrmRes(double d)
Definition: SgWrmsable.h:167
void incNumTotal(int inc=1)
Definition: SgWrmsable.h:192
double getSigma2add() const
Definition: SgWrmsable.h:109
int getNumProcessed() const
Definition: SgWrmsable.h:105
double getSFF_NrmRes() const
Definition: SgWrmsable.h:125
void decNumUsable(int inc=1)
Definition: SgWrmsable.h:199
void resetAllEditings()
Definition: SgWrmsable.h:383
void incNumUsable(int inc=1)
Definition: SgWrmsable.h:198
void setSFF_NrmRes_plus_15(double d)
Definition: SgWrmsable.h:172
double dof() const
Definition: SgWrmsable.h:375
double chi2() const
Definition: SgWrmsable.h:180
void decNumTotal(int inc=1)
Definition: SgWrmsable.h:196
void setNumUsable(int n)
Definition: SgWrmsable.h:140