General Purpose Geodetic Library
SgPartial.cpp
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 
24 #include <SgPartial.h>
25 
26 
27 
28 
29 /*=======================================================================================================
30 *
31 * METHODS:
32 *
33 *======================================================================================================*/
34 //
35 // static first:
36 const QString SgPartial::className()
37 {
38  return "SgPartial";
39 };
40 
41 
42 
43 //
45 {
47  setName(p.getName());
49  setD(p.getD());
50  setNumObs (p.getNumObs());
51  setNumSes (p.getNumSes());
52  setTStart (p.getTStart());
53  setTFinis (p.getTFinis());
54  twSum_ = p.twSum_;
55  wSum_ = p.wSum_;
56  return *this;
57 };
58 
59 
60 
61 // sets partial and update statistcis:
62 void SgPartial::updateStatistics(const SgMJD& t, double weight)
63 {
64  if (isAttr(Attr_IS_PARTIAL_SET) && tZero<t && t<tInf)
65  {
66  if (numObs_ == 0)
67  tStart_ = t;
68  numObs_++;
69  tFinis_ = t;
70  twSum_ += t.toDouble()*weight;
71  wSum_ += weight;
72  };
73 };
74 /*=======================================================================================================
75 *
76 * FRIENDS:
77 *
78 *======================================================================================================*/
79 //
80 
81 
82 
83 /*=====================================================================================================*/
84 //
85 // aux functions:
86 //
87 
88 
89 
90 // i/o:
91 
92 
93 
94 /*=====================================================================================================*/
95 //
96 // constants:
97 //
98 
99 
100 /*=====================================================================================================*/
const SgMJD tZero(1957, 10, 4)
const SgMJD tInf(2100, 1, 1)
bool isAttr(uint a) const
Definition: SgAttribute.h:226
SgAttribute & operator=(const SgAttribute &a)
Definition: SgAttribute.h:174
Definition: SgMJD.h:59
double toDouble() const
Definition: SgMJD.h:533
SgMJD tStart_
MJD of the first measurement;.
Definition: SgPartial.h:195
void updateStatistics(const SgMJD &t, double weight)
Definition: SgPartial.cpp:62
void setTFinis(const SgMJD &t)
Definition: SgPartial.h:380
void setD(double d)
Definition: SgPartial.h:347
void setDataDomain(DataDomain domain)
Definition: SgPartial.h:133
SgMJD tFinis_
MJD of the last measurement;.
Definition: SgPartial.h:196
double twSum_
the weighted sum of epochs of observation;
Definition: SgPartial.h:197
void setName(const QString &name)
Definition: SgPartial.h:339
int getNumObs() const
Definition: SgPartial.h:299
const SgMJD & getTStart() const
Definition: SgPartial.h:315
int numObs_
number of points per derivation;
Definition: SgPartial.h:193
double wSum_
the sum of weights of observations;
Definition: SgPartial.h:198
void setTStart(const SgMJD &t)
Definition: SgPartial.h:372
void setNumSes(int n)
Definition: SgPartial.h:364
SgPartial & operator=(const SgPartial &a)
Definition: SgPartial.cpp:44
const QString & getName() const
Definition: SgPartial.h:283
double getD() const
Definition: SgPartial.h:291
void setNumObs(int n)
Definition: SgPartial.h:356
int getNumSes() const
Definition: SgPartial.h:307
static const QString className()
Definition: SgPartial.cpp:36
DataDomain getDataDomain() const
Definition: SgPartial.h:97
@ Attr_IS_PARTIAL_SET
rise this bit on when the partial is assigned
Definition: SgPartial.h:53
const SgMJD & getTFinis() const
Definition: SgPartial.h:323