General Purpose Geodetic Library
SgVlbiBand.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_VLBI_BAND_H
24 #define SG_VLBI_BAND_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <math.h>
33 
34 #include <QtCore/QList>
35 #include <QtCore/QMap>
36 
37 class QDataStream;
38 
39 #include <SgVlbiBaselineInfo.h>
40 #include <SgVlbiHistory.h>
41 #include <SgVlbiStationInfo.h>
42 #include <SgVlbiSourceInfo.h>
43 
44 
45 
46 class SgVlbiObservable;
47 
48 /***===================================================================================================*/
54 class SgVlbiBand : public SgObjectInfo
55 {
56 public:
58  {
59  Attr_NOT_VALID = 1<<0,
60  Attr_PRIMARY = 1<<1,
62  Attr_HAS_AMBIGS = 1<<3,
64  = 1<<4,
65  };
66 
67  //
68  // constructors/destructors:
69  //
73  SgVlbiBand();
74 
78  ~SgVlbiBand();
79 
80 
81 
82  //
83  // Interfaces:
84  //
85  // direct access:
89 
92  inline QMap<int, SgVlbiStationInfo*>& stationsByIdx();
93 
96  inline QMap<int, SgVlbiBaselineInfo*>& baselinesByIdx();
97 
100  inline QMap<int, SgVlbiSourceInfo*>& sourcesByIdx();
101 
102  inline QMap<QString, SgVector*>& phCalOffset_1ByBln() {return phCalOffset_1ByBln_;};
103  inline QMap<QString, SgVector*>& phCalOffset_2ByBln() {return phCalOffset_2ByBln_;};
104 
105 
106  // gets:
109  inline double getFrequency() const;
110 
113  inline const SgMJD& getTCreation() const;
114 
117  inline const QString& getInputFileName() const;
118 
121  inline int getInputFileVersion() const;
122 
125  inline const QString& getCorrelatorType() const;
126 
129  inline SgVlbiHistory& history();
130  inline const SgVlbiHistory& history() const {return history_;};
131 
134  inline QMap<QString, SgVlbiStationInfo*>& stationsByName();
135 
138  inline QMap<QString, SgVlbiBaselineInfo*>& baselinesByName();
139 
142  inline QMap<QString, SgVlbiSourceInfo*>& sourcesByName();
143 
146  inline int getMaxNumOfChannels() const;
147  inline double sampleRate() const {return sampleRate_;};
148  inline int bitsPerSample() const {return bitsPerSample_;};
149  inline const QMap<double, int>& sampleRateByCount() const {return sampleRateByCount_;};
150  inline const QMap<int, int>& bitsPerSampleByCount() const {return bitsPerSampleByCount_;};
151  inline const QString& recordMode() const {return recordMode_;};
152 
153 
156  inline int getNumOfConstraints() const;
157 
158  inline const QMap<double, int>& grdAmbigsBySpacing() const {return grdAmbigsBySpacing_;};
159  inline double typicalGrdAmbigSpacing() const {return typicalGrdAmbigSpacing_;};
160  inline const QString& strGrdAmbigsStat() const {return strGrdAmbigsStat_;};
161 
162  inline const QMap<double, int>& phdAmbigsBySpacing() const {return phdAmbigsBySpacing_;};
163  inline double typicalPhdAmbigSpacing() const {return typicalPhdAmbigSpacing_;};
164  inline const QString& strPhdAmbigsStat() const {return strPhdAmbigsStat_;};
165 
166 
167  // sets:
171  inline void setFrequency(double f);
172 
175  inline void setTCreation(const SgMJD& t);
176 
180  inline void setInputFileName(const QString& fileName);
181 
185  inline void setInputFileVersion(int version);
186 
189  inline void setCorrelatorType(const QString& name);
190 
194  inline void setMaxNumOfChannels(int num);
195 
196 
197  //
198  // Functions:
199  //
202  inline const QString className() const;
203 
204  inline bool operator<(const SgVlbiBand& band) const;
205 
209 
212  inline SgVlbiSourceInfo* lookupSourceByIdx(int);
213 
217 
218  void resetAllEditings();
219 
220  bool selfCheck();
221 
222  //
223  // I/O:
224  //
226 
228  //
229 
230 private:
231  //
232  double frequency_; // a reference frequency of the band
233  // links to observations (not an owner):
235  // statistics & info:
236  SgMJD tCreation_; // each band could has its own creation time
237  QString inputFileName_; // the same for file name
238  int inputFileVersion_; // version of the DBH file
239  QString correlatorType_; // Correlator type
241  QMap<QString, SgVlbiStationInfo*> stationsByName_;
242  QMap<QString, SgVlbiBaselineInfo*> baselinesByName_;
243  QMap<QString, SgVlbiSourceInfo*> sourcesByName_;
244  // just for quick look-ups, not the owners:
245  QMap<int, SgVlbiStationInfo*> stationsByIdx_;
246  QMap<int, SgVlbiBaselineInfo*> baselinesByIdx_;
247  QMap<int, SgVlbiSourceInfo*> sourcesByIdx_;
248  //
250  double sampleRate_;
252  QMap<double, int> sampleRateByCount_;
253  QMap<int, int> bitsPerSampleByCount_;
254  QString recordMode_;
255 
256  //
257  // 4group delay:
258  QMap<double, int> grdAmbigsBySpacing_;
261  // 4phase delay:
262  QMap<double, int> phdAmbigsBySpacing_;
265  // support stuff:
266  QMap<QString, SgVector*> phCalOffset_1ByBln_;
267  QMap<QString, SgVector*> phCalOffset_2ByBln_;
268 };
269 /*=====================================================================================================*/
270 
271 
272 
273 
274 /*=====================================================================================================*/
275 /* */
276 /* SgVlbiBand inline members: */
277 /* */
278 /*=====================================================================================================*/
279 //
280 //
281 // CONSTRUCTORS:
282 //
283 
284 //
285 // INTERFACES:
286 //
287 //
289 {
290  return observables_;
291 };
292 
293 
294 
295 //
296 inline QMap<int, SgVlbiStationInfo*>& SgVlbiBand::stationsByIdx()
297 {
298  return stationsByIdx_;
299 };
300 
301 
302 
303 //
304 inline QMap<int, SgVlbiBaselineInfo*>& SgVlbiBand::baselinesByIdx()
305 {
306  return baselinesByIdx_;
307 };
308 
309 
310 
311 //
312 inline QMap<int, SgVlbiSourceInfo*>& SgVlbiBand::sourcesByIdx()
313 {
314  return sourcesByIdx_;
315 };
316 
317 
318 
319 //
320 inline double SgVlbiBand::getFrequency() const
321 {
322  return frequency_;
323 };
324 
325 
326 
327 //
328 inline const SgMJD& SgVlbiBand::getTCreation() const
329 {
330  return tCreation_;
331 };
332 
333 
334 
335 //
336 inline const QString& SgVlbiBand::getInputFileName() const
337 {
338  return inputFileName_;
339 };
340 
341 
342 
343 //
345 {
346  return inputFileVersion_;
347 };
348 
349 
350 
351 //
352 inline const QString& SgVlbiBand::getCorrelatorType() const
353 {
354  return correlatorType_;
355 };
356 
357 
358 
359 //
361 {
362  return history_;
363 };
364 
365 
366 
367 //
368 inline QMap<QString, SgVlbiStationInfo*>& SgVlbiBand::stationsByName()
369 {
370  return stationsByName_;
371 };
372 
373 
374 
375 //
376 inline QMap<QString, SgVlbiBaselineInfo*>& SgVlbiBand::baselinesByName()
377 {
378  return baselinesByName_;
379 };
380 
381 
382 
383 //
384 inline QMap<QString, SgVlbiSourceInfo*>& SgVlbiBand::sourcesByName()
385 {
386  return sourcesByName_;
387 };
388 
389 
390 
391 //
393 {
394  return maxNumOfChannels_;
395 };
396 
397 
398 
399 // sets:
400 
401 //
402 inline void SgVlbiBand::setFrequency(double f)
403 {
404  frequency_ = f;
405 };
406 
407 
408 
409 //
410 inline void SgVlbiBand::setTCreation(const SgMJD& t)
411 {
412  tCreation_ = t;
413 };
414 
415 
416 
417 //
418 inline void SgVlbiBand::setInputFileName(const QString& fileName)
419 {
420  inputFileName_ = fileName;
421 };
422 
423 
424 
425 //
426 inline void SgVlbiBand::setInputFileVersion(int version)
427 {
428  inputFileVersion_ = version;
429 };
430 
431 
432 
433 //
434 inline void SgVlbiBand::setCorrelatorType(const QString& name)
435 {
436  correlatorType_ = name;
437 };
438 
439 
440 
441 //
443 {
444  maxNumOfChannels_ = num;
445 };
446 
447 
448 
449 //
450 // FUNCTIONS:
451 //
452 //
453 inline const QString SgVlbiBand::className() const
454 {
455  return "SgVlbiBand";
456 };
457 
458 
459 
460 //
461 inline bool SgVlbiBand::operator<(const SgVlbiBand& band) const
462 {
463  return frequency_ > band.getFrequency();
464 };
465 
466 
467 
468 //
470 {
471  if (stationsByIdx_.contains(idx))
472  return stationsByIdx_.value(idx);
473  else
474  return NULL;
475 };
476 
477 
478 
479 //
481 {
482  if (sourcesByIdx_.contains(idx))
483  return sourcesByIdx_.value(idx);
484  else
485  return NULL;
486 };
487 
488 
489 
490 //
492 {
493  if (baselinesByIdx_.contains(idx))
494  return baselinesByIdx_.value(idx);
495  else
496  return NULL;
497 };
498 /*=====================================================================================================*/
499 #endif // SG_VLBI_BAND_H
Definition: SgMJD.h:59
QString strPhdAmbigsStat_
Definition: SgVlbiBand.h:264
QMap< int, SgVlbiBaselineInfo * > baselinesByIdx_
Definition: SgVlbiBand.h:246
int bitsPerSample() const
Definition: SgVlbiBand.h:148
void setFrequency(double f)
Definition: SgVlbiBand.h:402
QMap< QString, SgVector * > & phCalOffset_1ByBln()
Definition: SgVlbiBand.h:102
int maxNumOfChannels_
Definition: SgVlbiBand.h:249
void setTCreation(const SgMJD &t)
Definition: SgVlbiBand.h:410
void setCorrelatorType(const QString &name)
Definition: SgVlbiBand.h:434
void resetAllEditings()
Definition: SgVlbiBand.cpp:114
int bitsPerSample_
Definition: SgVlbiBand.h:251
QMap< int, SgVlbiStationInfo * > stationsByIdx_
Definition: SgVlbiBand.h:245
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
Definition: SgVlbiBand.h:376
QMap< QString, SgVlbiStationInfo * > & stationsByName()
Definition: SgVlbiBand.h:368
QMap< QString, SgVector * > phCalOffset_2ByBln_
Definition: SgVlbiBand.h:267
int getInputFileVersion() const
Definition: SgVlbiBand.h:344
double sampleRate_
Definition: SgVlbiBand.h:250
const SgMJD & getTCreation() const
Definition: SgVlbiBand.h:328
bool selfCheck()
Definition: SgVlbiBand.cpp:228
double frequency_
Definition: SgVlbiBand.h:232
QMap< int, int > bitsPerSampleByCount_
Definition: SgVlbiBand.h:253
void setInputFileName(const QString &fileName)
Definition: SgVlbiBand.h:418
const QString & getInputFileName() const
Definition: SgVlbiBand.h:336
bool saveIntermediateResults(QDataStream &) const
Definition: SgVlbiBand.cpp:135
void setInputFileVersion(int version)
Definition: SgVlbiBand.h:426
QString strGrdAmbigsStat_
Definition: SgVlbiBand.h:260
QList< SgVlbiObservable * > & observables()
Definition: SgVlbiBand.h:288
const QString & strGrdAmbigsStat() const
Definition: SgVlbiBand.h:160
double typicalGrdAmbigSpacing_
Definition: SgVlbiBand.h:259
QMap< int, SgVlbiBaselineInfo * > & baselinesByIdx()
Definition: SgVlbiBand.h:304
QMap< QString, SgVlbiBaselineInfo * > baselinesByName_
Definition: SgVlbiBand.h:242
QMap< QString, SgVlbiStationInfo * > stationsByName_
Definition: SgVlbiBand.h:241
SgVlbiHistory history_
Definition: SgVlbiBand.h:240
int getMaxNumOfChannels() const
Definition: SgVlbiBand.h:392
QString recordMode_
Definition: SgVlbiBand.h:254
QMap< QString, SgVector * > phCalOffset_1ByBln_
Definition: SgVlbiBand.h:266
QMap< double, int > sampleRateByCount_
Definition: SgVlbiBand.h:252
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
Definition: SgVlbiBand.h:384
void setMaxNumOfChannels(int num)
Definition: SgVlbiBand.h:442
QList< SgVlbiObservable * > observables_
Definition: SgVlbiBand.h:234
double typicalPhdAmbigSpacing() const
Definition: SgVlbiBand.h:163
double typicalGrdAmbigSpacing() const
Definition: SgVlbiBand.h:159
int inputFileVersion_
Definition: SgVlbiBand.h:238
const QString & recordMode() const
Definition: SgVlbiBand.h:151
SgMJD tCreation_
Definition: SgVlbiBand.h:236
QMap< int, SgVlbiSourceInfo * > & sourcesByIdx()
Definition: SgVlbiBand.h:312
double getFrequency() const
Definition: SgVlbiBand.h:320
QString inputFileName_
Definition: SgVlbiBand.h:237
SgVlbiBaselineInfo * lookupBaselineByIdx(int)
Definition: SgVlbiBand.h:491
bool operator<(const SgVlbiBand &band) const
Definition: SgVlbiBand.h:461
SgVlbiSourceInfo * lookupSourceByIdx(int)
Definition: SgVlbiBand.h:480
QMap< int, SgVlbiSourceInfo * > sourcesByIdx_
Definition: SgVlbiBand.h:247
QMap< double, int > grdAmbigsBySpacing_
Definition: SgVlbiBand.h:258
const SgVlbiHistory & history() const
Definition: SgVlbiBand.h:130
QMap< double, int > phdAmbigsBySpacing_
Definition: SgVlbiBand.h:262
QMap< QString, SgVector * > & phCalOffset_2ByBln()
Definition: SgVlbiBand.h:103
int getNumOfConstraints() const
SgVlbiHistory & history()
Definition: SgVlbiBand.h:360
const QMap< double, int > & sampleRateByCount() const
Definition: SgVlbiBand.h:149
SgVlbiStationInfo * lookupStationByIdx(int)
Definition: SgVlbiBand.h:469
QMap< int, SgVlbiStationInfo * > & stationsByIdx()
Definition: SgVlbiBand.h:296
double sampleRate() const
Definition: SgVlbiBand.h:147
bool loadIntermediateResults(QDataStream &)
Definition: SgVlbiBand.cpp:171
const QString & strPhdAmbigsStat() const
Definition: SgVlbiBand.h:164
const QString & getCorrelatorType() const
Definition: SgVlbiBand.h:352
const QMap< double, int > & grdAmbigsBySpacing() const
Definition: SgVlbiBand.h:158
const QString className() const
Definition: SgVlbiBand.h:453
QString correlatorType_
Definition: SgVlbiBand.h:239
const QMap< double, int > & phdAmbigsBySpacing() const
Definition: SgVlbiBand.h:162
@ Attr_HAS_IONO_SOLUTION
the band contains ionospheric corrections;
Definition: SgVlbiBand.h:61
@ Attr_MISSING_CHANNEL_INFO
the band lacks info on channel setup;
Definition: SgVlbiBand.h:63
@ Attr_PRIMARY
the band is a primary band;
Definition: SgVlbiBand.h:60
@ Attr_HAS_AMBIGS
the band contains group delays and ambiguities;
Definition: SgVlbiBand.h:62
@ Attr_NOT_VALID
omit these data;
Definition: SgVlbiBand.h:59
QMap< QString, SgVlbiSourceInfo * > sourcesByName_
Definition: SgVlbiBand.h:243
double typicalPhdAmbigSpacing_
Definition: SgVlbiBand.h:263
const QMap< int, int > & bitsPerSampleByCount() const
Definition: SgVlbiBand.h:150