General Purpose Geodetic Library
SgVlbiSessionInfo.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 #include <iostream>
24 #include <stdlib.h>
25 
26 
27 #include <SgVlbiSessionInfo.h>
28 
29 
30 #include <SgVlbiNetworkId.h>
31 #include <SgLogger.h>
32 
33 
34 
35 /*=======================================================================================================
36 *
37 * METHODS:
38 *
39 *======================================================================================================*/
40 //
41 // static first:
43 {
44  return "SgVlbiSessionInfo";
45 };
46 
47 
48 
49 // CONSTRUCTORS:
50 //
51 // A constructor:
53  SgAttribute(),
54  tCreation_(tZero),
55  tStart_(tZero),
56  tFinis_(tZero),
57  tMean_(tZero),
58  name_("unnamed"),
59  networkSuffix_("Z"),
60  sessionCode_("UNKN"),
61  sessionType_(""),
62  networkID_("UNKN"),
63  description_("an empty entry"),
64  userFlag_("H"),
65  officialName_("noname"),
66  correlatorName_(""),
67  correlatorType_("UNKN"),
68  submitterName_("UNKN"),
69  schedulerName_("UNKN"),
70  piAgencyName_("UNKN"),
71  recordingMode_("N/A")
72 {
74 
76  numOfStations_ = 0;
77  numOfBaselines_ = 0;
78  numOfSources_ = 0;
81 
82  delaySumRMS2_ = 0.0;
83  rateSumRMS2_ = 0.0;
84  delaySumW_ = 0.0;
85  rateSumW_ = 0.0;
86 };
87 
88 
89 
90 //
92  SgAttribute(si)
93 {
94  *this = si;
95 };
96 
97 
98 
99 // A destructor:
101 {
102  // nothing to do more yet...
103 };
104 
105 
106 
107 //
109 {
111 
113  tCreation_ = si.tCreation_;
114  tStart_ = si.tStart_;
115  tFinis_ = si.tFinis_;
116  tMean_ = si.tMean_;
117 
118  name_ = si.name_;
122  networkID_ = si.networkID_;
124  userFlag_ = si.userFlag_;
133 
138 
141  delaySumW_ = si.delaySumW_;
142  rateSumW_ = si.rateSumW_;
143 
144  return *this;
145 };
146 
147 
148 
149 // FUNCTIONS:
150 //
151 //
153 {
154  QMap<int, const SgVlbiNetworkId*> idByCount;
155  int count;
156 
157  for (int i=0; i<networks.count(); i++)
158  {
159  if ((count=networks.at(i).countMatches(getOfficialName())) > 0)
160  {
161  if (idByCount.contains(count))
163  "::guessNetworkId(): got multiple matches for the key [" + getOfficialName() +
164  "] (count=" + QString("").setNum(count) +
165  ") for " + idByCount.value(count)->getName() + " and " + networks.at(i).getName() +
166  " networks; the last one will be used");
167  idByCount[count] = &(networks.at(i));
168  };
169  };
170  if (idByCount.size())
171  {
172  const SgVlbiNetworkId *nid;
173  nid = idByCount.values().last();
174  if (nid)
175  {
176  setNetworkID(nid->getName());
178  "::guessNetworkId(): the network ID was set to: " + getNetworkID());
179  }
180  else
182  "::guessNetworkId(): nid is NULL");
183  }
184  else
186  "::guessNetworkId(): unable to guess the network ID, nothing to match");
187 };
188 
189 /*=====================================================================================================*/
190 //
191 // FRIENDS:
192 //
193 /*=====================================================================================================*/
194 //
195 
196 /*=====================================================================================================*/
197 //
198 // aux functions:
199 //
200 // sorts in chronological order:
202 {
203  return si1->getTStart() > si2->getTStart();
204 };
205 
206 /*=====================================================================================================*/
207 //
208 // constants:
209 //
210 /*=====================================================================================================*/
211 
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
QList< SgVlbiNetworkId > networks
bool lessThan4_FirstEpochSortingOrder(SgVlbiSessionInfo *si1, SgVlbiSessionInfo *si2)
SgAttribute & operator=(const SgAttribute &a)
Definition: SgAttribute.h:174
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
const QString & getName() const
const QString & getNetworkID() const
const SgMJD & getTStart() const
void setNetworkID(const QString &netID)
QString userFlag_
A flag assigned by user;.
SgVlbiSessionInfo & operator=(const SgVlbiSessionInfo &)
@ OT_UNKNOWN
unknown (=all others) source of import;
QString officialName_
Official Name (from MasterFile)
CorrelatorPostProcSoftware cppsSoft_
SgMJD tFinis_
last epoch of the observations;
const QString & getOfficialName() const
QString networkID_
Network ID (a key);.
@ CPPS_UNKNOWN
unknown (=all others);
QString correlatorType_
Type of the correlator;.
QString sessionType_
official session type (from Masterfile);
QString networkSuffix_
a char that specifies network (e.g., A, E, U, etc.);
QString sessionCode_
official session code (from Masterfile);
SgMJD tMean_
mean epoch of the observations;
QString piAgencyName_
Name of P.I. organization.
QString description_
Experiment description;.
QString schedulerName_
Name of resposible organization (from MasterFile)
QString correlatorName_
Correlator Name (from MasterFile)
OriginType originType_
type of origin of the imported file(s);
SgMJD tCreation_
date of creation of imported file(s);
static QString className()
QString submitterName_
Name of resposible organization (from MasterFile)
QString name_
name of the session (e.g., 10JUL22XE);
SgMJD tStart_
first epoch of the observations;