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  networkID_("UNKN"),
62  description_("an empty entry"),
63  userFlag_("H"),
64  officialName_("noname"),
65  correlatorName_(""),
66  correlatorType_("UNKN"),
67  submitterName_("UNKN"),
68  schedulerName_("UNKN"),
69  piAgencyName_("UNKN"),
70  recordingMode_("N/A")
71 {
73 
75  numOfStations_ = 0;
76  numOfBaselines_ = 0;
77  numOfSources_ = 0;
80 
81  delaySumRMS2_ = 0.0;
82  rateSumRMS2_ = 0.0;
83  delaySumW_ = 0.0;
84  rateSumW_ = 0.0;
85 };
86 
87 
88 
89 //
91  SgAttribute(si)
92 {
93  *this = si;
94 };
95 
96 
97 
98 // A destructor:
100 {
101  // nothing to do more yet...
102 };
103 
104 
105 
106 //
108 {
110 
112  tCreation_ = si.tCreation_;
113  tStart_ = si.tStart_;
114  tFinis_ = si.tFinis_;
115  tMean_ = si.tMean_;
116 
117  name_ = si.name_;
120  networkID_ = si.networkID_;
122  userFlag_ = si.userFlag_;
131 
136 
139  delaySumW_ = si.delaySumW_;
140  rateSumW_ = si.rateSumW_;
141 
142  return *this;
143 };
144 
145 
146 
147 // FUNCTIONS:
148 //
149 //
151 {
152  QMap<int, const SgVlbiNetworkId*> idByCount;
153  int count;
154 
155  for (int i=0; i<networks.count(); i++)
156  {
157  if ((count=networks.at(i).countMatches(getOfficialName())) > 0)
158  {
159  if (idByCount.contains(count))
161  "::guessNetworkId(): got multiple matches for the key [" + getOfficialName() +
162  "] (count=" + QString("").setNum(count) +
163  ") for " + idByCount.value(count)->getName() + " and " + networks.at(i).getName() +
164  " networks; the last one will be used");
165  idByCount[count] = &(networks.at(i));
166  };
167  };
168  if (idByCount.size())
169  {
170  const SgVlbiNetworkId *nid;
171  nid = idByCount.values().last();
172  if (nid)
173  {
174  setNetworkID(nid->getName());
176  "::guessNetworkId(): the network ID was set to: " + getNetworkID());
177  }
178  else
180  "::guessNetworkId(): nid is NULL");
181  }
182  else
184  "::guessNetworkId(): unable to guess the network ID, nothing to match");
185 };
186 
187 /*=====================================================================================================*/
188 //
189 // FRIENDS:
190 //
191 /*=====================================================================================================*/
192 //
193 
194 /*=====================================================================================================*/
195 //
196 // aux functions:
197 //
198 // sorts in chronological order:
200 {
201  return si1->getTStart() > si2->getTStart();
202 };
203 
204 /*=====================================================================================================*/
205 //
206 // constants:
207 //
208 /*=====================================================================================================*/
209 
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 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;