General Purpose Geodetic Library
SgVlbiStationInfo.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 #include <math.h>
26 
27 
28 #include <QtCore/QDataStream>
29 #include <QtCore/QDir>
30 #include <QtCore/QFile>
31 #include <QtCore/QRegExp>
32 #include <QtCore/QStringList>
33 #include <QtCore/QTextStream>
34 
35 
36 #include <Sg3dMatrixR.h>
37 #include <SgEccRec.h>
38 #include <SgLogger.h>
39 #include <SgVlbiStationInfo.h>
40 #include <SgVlbiObservation.h>
41 
42 
43 
45 
46 
47 /*=======================================================================================================
48 *
49 * METHODS:
50 *
51 *======================================================================================================*/
52 //
53 // static first:
55 {
56  return "SgVlbiStationInfo";
57 };
58 
59 
60 
61 //
63 {
64  int mnt=0;
65  switch (mType)
66  {
67  case MT_EQUA:
68  mnt = 1;
69  break;
70  case MT_X_YN:
71  mnt = 2;
72  break;
73  case MT_AZEL:
74  mnt = 3;
75  break;
76  case MT_RICHMOND:
77  mnt = 4;
78  break;
79  case MT_X_YE:
80  mnt = 5;
81  break;
82  case MT_UNKN:
83  default:
84  mnt = 0;
85  break;
86  };
87  return mnt;
88 };
89 
90 
91 
92 //
94 {
96  switch (iMnt)
97  {
98  case 1:
99  mnt = MT_EQUA;
100  break;
101  case 2:
102  mnt = MT_X_YN;
103  break;
104  case 3:
105  mnt = MT_AZEL;
106  break;
107  case 4:
108  mnt = MT_RICHMOND;
109  break;
110  case 5:
111  mnt = MT_X_YE;
112  break;
113  default:
115  "::int2mntType(): got unknown value of the axis type (" + QString("").setNum(iMnt) + ")");
116  break;
117  };
118  return mnt;
119 };
120 
121 
122 
123 
124 #pragma GCC push_options
125 #pragma GCC optimize ("O0")
126 
127 //
128 /*
129 void SgVlbiStationInfo::calcRLF(double &latitude, double& longitude, double& height,
130  const Sg3dVector& r, bool useOldEllipsoid)
131 {
132  // double dA(6378137.0), dF(0.00335281068118);
133  useOldEllipsoid = false;
134  useOldEllipsoid = true;
135 
136  double dA, dF;
137  dA = 6378137.0;
138  dF = 0.00335281068118;
139 
140  if (useOldEllipsoid)
141  {
142  dA = 6378136.3;
143  dF = 0.0033528918690;
144  };
145 
146  double dAEPS2, dE2, dE4T, dEP2, dEP, dAEP;
147  double dP2;
148  dAEPS2 = dE2 = dE4T = dEP2 = dEP = dAEP = 0.0;
149  dP2 = 0.0;
150 
151  dAEPS2 = dA*dA*1.0e-32;
152  dE2 = (2.0 - dF)*dF;
153  dE4T = dE2*dE2*1.5;
154  dEP2 = 1.0 - dE2;
155  dEP = sqrt(dEP2);
156  dAEP = dA*dEP;
157 
158  dP2 = r.at(X_AXIS)*r.at(X_AXIS) + r.at(Y_AXIS)*r.at(Y_AXIS);
159 
160  if (dP2 != 0.0)
161  {
162  longitude = atan2(r.at(Y_AXIS), r.at(X_AXIS));
163  if (longitude<0.0)
164  longitude += M_PI*2.0;
165  }
166  else
167  longitude = 0.0;
168 
169 
170  double dABSZ, dP, dS0, dPN, dZP, dC0, dC02, dC03, dS02, dS03, dA02;
171  double dA0, dA03, dD0, dF0, dB0, dS1, dCP, dS12, dCP2;
172 
173  dABSZ = dP = dS0 = dPN = dZP = dC0 = dC02 = dC03 = dS02 = dS03 = dA02 = 0.0;
174  dA0 = dA03 = dD0 = dF0 = dB0 = dS1 = dCP = dS12 = dCP2 = 0.0;
175 
176  dABSZ = fabs(r.at(Z_AXIS));
177  if (dP2 > dAEPS2)
178  {
179  dP = sqrt(dP2);
180  dS0 = dABSZ/dA;
181  dPN = dP/dA;
182  dZP = dEP*dS0;
183  dC0 = dEP*dPN;
184  dC02 = dC0*dC0;
185  dC03 = dC02*dC0;
186  dS02 = dS0*dS0;
187  dS03 = dS02*dS0;
188  dA02 = dC02 + dS02;
189  dA0 = sqrt(dA02);
190  dA03 = dA02*dA0;
191  dD0 = dZP*dA03 + dE2*dS03;
192  dF0 = dPN*dA03 - dE2*dC03;
193  dB0 = dE4T*dS02*dC02*dPN*(dA0 - dEP);
194  dS1 = dD0*dF0 - dB0*dS0;
195  dCP = dEP*(dF0*dF0 - dB0*dC0);
196  latitude = atan(dS1/dCP);
197  dS12 = dS1*dS1;
198  dCP2 = dCP*dCP;
199  height = (dP*dCP + dABSZ*dS1 - dA*sqrt(dEP2*dS12 + dCP2))/sqrt(dS12 + dCP2);
200  }
201  else
202  {
203  latitude = M_PI_2;
204  height = dABSZ - dAEP;
205  };
206 
207  if (r.at(Z_AXIS) < 0.0)
208  latitude = -latitude;
209 };
210 */
211 
212 
213 //
214 //void SgVlbiStationInfo::calcRLF_bis(double &latitude, double& longitude, double& height,
215 // const Sg3dVector& r, bool useOldEllipsoid)
216 //{
217  /*
218  IERS TECHNICAL NOTE 21
219  IERS Conventions (1996)
220  page 12:
221 
222  Once the Cartesian coordinates (x,y,z) are known, they can be transformed to "datum" or
223  curvilinear geodetic coordinates (lambda, fi, h) reffered to an ellipsoid of semi-major
224  axis a and flattening f, using the following code (Borkowski, 1989). First compute
225  lambda=tan^(-1)(y/x) properly determining the quadrant from x and y (0<=lamda<=2pi)
226  */
227 //
228 // longitude = atan2(r.at(Y_AXIS), r.at(X_AXIS));
229 // if (longitude<0.0)
230 // longitude += M_PI*2.0;
231 //
232 // /*
233 // and r=sqrt(x^2+y^2).
234 // */
235 //
236 // double rho = hypot(r.at(X_AXIS), r.at(Y_AXIS));
237 //
238  /*
239  subroutine GEOD(r,z,fi,h)
240  c Program to transform Cartesian to geodetic coordinates
241  c based on the exact solution (Borkowski, 1989)
242  c Input : r, z = equatorial [m] and polar [m] components
243  c Output: fi, h = geodetic coord's (latitude [rad], height [m])
244  implicit real*8(a-h,o-z)
245 // */
246 //
247 // double b,E,F,P,Q,D,s,v,G,t;
248 //
249  /*
250  c GRS80 ellipsoid: semimajor axis (a) and inverse flattening (fr)
251  data a,fr /6378137.d0,298.257222101d0/
252  */
255 // double a = 6378137.0;
256 // double fr = 298.257222101;
257 //
258 // if (useOldEllipsoid)
259 // {
260 // a = 6378136.3;
261 // fr = 1.0/0.0033528918690;
262 // };
263 //
264  /*
265  b = dsign(a - a/fr,z)
266  E = ((z + b)*b/a - a)/r
267  F = ((z - b)*b/a + a)/r
268  */
269 // b = sign(a - a/fr, r.at(Z_AXIS));
270 // E = ((r.at(Z_AXIS) + b)*b/a - a)/rho;
271 // F = ((r.at(Z_AXIS) - b)*b/a + a)/rho;
272 //
273  /*
274  c Find solution to: t**4 + 2*E*t**3 + 2*F*t - 1 = 0
275  P = (E*F + 1.)*4.d0/3.d0
276  Q = (E*E - F*F)*2.d0
277  D = P*P*P + Q*Q
278  if(D.ge.0d0) then
279  s = dsqrt(D) + Q
280  s = dsign(dexp(dlog(dabs(s))/3.d0),s)
281  v = P/s - s
282  c Improve the accuracy of numeric values of v
283  v = -(Q + Q + v*v*v)/(3.d0*P)
284  else
285  v = 2.d0*dsqrt(-P)*dcos(dacos(Q/P/dsqrt(-P))/3.d0)
286  endif
287  G = .5d0*(E + dsqrt(E*E + v))
288  t = dsqrt(G*G + (F - v*G)/(G + G - E)) - G
289  */
290 //
291 // P = (E*F + 1.0)*4.0/3.0;
292 // Q = (E*E - F*F)*2.0;
293 // D = P*P*P + Q*Q;
294 // if (D>=0.0)
295 // {
296 // s = sqrt(D) + Q;
297 // s = sign(exp(log(fabs(s))/3.0), s);
298 // v = P/s - s;
299 // v = -(Q + Q + v*v*v)/(3.0*P);
300 // }
301 // else
302 // v = 2.0*sqrt(-P)*cos(acos(Q/P/sqrt(-P))/3.0);
303 //
304 // G = 0.5*(E + sqrt(E*E + v));
305 // t = sqrt(G*G + (F - v*G)/(G + G - E)) - G;
306 //
307  /*
308  fi = datan((1.d0 - t*t)*a/(2.d0*b*t))
309  h = (r - a*t)*dcos(fi) + (z - b)*dsin(fi)
310  return
311  end
312  */
313 // latitude = atan((1.0 - t*t)*a/(2.0*b*t));
314 // height = (rho - a*t)*cos(latitude) + (r.at(Z_AXIS) - b)*sin(latitude);
315 // return;
316 //};
317 #pragma GCC pop_options
318 
319 
320 
321 
322 
323 
324 // An empty constructor:
325 SgVlbiStationInfo::SgVlbiStationInfo(int idx, const QString& key, const QString& aka) :
326  SgObjectInfo(idx, key, aka),
327  clockBreaks_(),
328  auxObservationByScan_(),
329  cableCalsOriginTxt_(""),
330  meteoDataOriginTxt_(""),
331  r_(v3Zero),
332  r_ea_(v3Zero),
333  v_ea_(v3Zero),
334  v3Ecc_(v3Zero),
335  tsysIfFreqs_(),
336  tsysIfIds_(),
337  tsysIfSideBands_(),
338  tsysIfPolarizations_(),
339  pcClocks_(),
340  pcZenith_()
341 {
342  clocksModelOrder_ = 2;
343  cableCalMultiplier_ = 1.0;
346 
349 
350  axisOffset_ = 0.0;
351  axisOffset_ea_ = 0.0;
352  //
353  gradNorth_ = 0.0;
354  gradEast_ = 0.0;
355  tilt_[0] = tilt_[1] = 0.0;
356  //
357  mntType_ = MT_UNKN;
358  latitude_= longitude_= height_ = 0.0;
359  tectonicPlateName_ = "NONE";
360  cdpNumber_ = -1;
361 
362  for (int i=0; i<maxNumOfPolynomials_; i++)
363  {
364  estClockModel_[i] = 0.0;
365  estClockModelSigmas_[i] = 0.0;
366  pClocks_[i] = NULL;
367  };
368  aPrioriClockTerm_0_ = 0.0;
369  aPrioriClockTerm_1_ = 0.0;
370  need2useAPrioriClocks_ = false;
371  //
372  estWetZenithDelay_ = 0.0;
374  gradientDelay_ = 0.0;
375 
376  for (int iWave=0; iWave<11; iWave++)
377  for (int iCoord=0; iCoord<3; iCoord++)
378  {
379  oLoadAmplitudes_[iWave][iCoord] = 0.0;
380  oLoadPhases_[iWave][iCoord] = 0.0;
381  };
382  for (int i=0; i<6; i++)
383  optLoadCoeffs_[i] = 0.0;
384  cId_ = ' ';
385  sId_[0] = ' ';
386  sId_[1] = ' ';
387  sId_[2] = '\0';
388  //
389  // parameters:
390  pZenithDelay_ = NULL;
391  pAtmGradN_ = NULL;
392  pAtmGradE_ = NULL;
393  pRx_ = NULL;
394  pRy_ = NULL;
395  pRz_ = NULL;
396  pAxisOffset_ = NULL;
399  eccRec_ = NULL;
400  isEccNonZero_ = false;
402 };
403 
404 
405 
406 //
407 // A destructor:
409 {
411 
412  QMap<QString, SgVlbiAuxObservation*>::iterator it;
413  for (it=auxObservationByScan_.begin(); it!=auxObservationByScan_.end(); ++it)
414  delete it.value();
415  auxObservationByScan_.clear();
416 
417  if (eccRec_)
418  {
419  delete eccRec_;
420  eccRec_ = NULL;
421  };
422 
423  tsysIfFreqs_.clear();
424  tsysIfIds_.clear();
425  tsysIfSideBands_.clear();
426  tsysIfPolarizations_.clear();
427 };
428 
429 
430 
431 //
433 {
434  QString prefix = "Stn " + getKey().leftJustified(8, ' ') + ": ";
436  for (int i=0; i<maxNumOfPolynomials_; i++)
437  pClocks_[i] = new SgParameter(prefix + QString("").sprintf("Clock_%02d", i));
438  pZenithDelay_ = new SgParameter(prefix + "Zenith");
439  pAtmGradN_ = new SgParameter(prefix + "Grad_N");
440  pAtmGradE_ = new SgParameter(prefix + "Grad_E");
441  pRx_ = new SgParameter(prefix + "coord-X");
442  pRy_ = new SgParameter(prefix + "coord-Y");
443  pRz_ = new SgParameter(prefix + "coord-Z");
444  pAxisOffset_ = new SgParameter(prefix + "Axis Offset");
445  clockBreaks_.createParameters(prefix + "CBr");
446 };
447 
448 
449 
450 //
452 {
453  for (int i=0; i<maxNumOfPolynomials_; i++)
454  if (pClocks_[i])
455  {
456  delete pClocks_[i];
457  pClocks_[i] = NULL;
458  };
459  if (pZenithDelay_)
460  {
461  delete pZenithDelay_;
462  pZenithDelay_ = NULL;
463  };
464  if (pAtmGradN_)
465  {
466  delete pAtmGradN_;
467  pAtmGradN_ = NULL;
468  };
469  if (pAtmGradE_)
470  {
471  delete pAtmGradE_;
472  pAtmGradE_ = NULL;
473  };
474  if (pRx_)
475  {
476  delete pRx_;
477  pRx_ = NULL;
478  };
479  if (pRy_)
480  {
481  delete pRy_;
482  pRy_ = NULL;
483  };
484  if (pRz_)
485  {
486  delete pRz_;
487  pRz_ = NULL;
488  };
489  if (pAxisOffset_)
490  {
491  delete pAxisOffset_;
492  pAxisOffset_ = NULL;
493  };
495 };
496 
497 
498 
499 //
500 void SgVlbiStationInfo::calcCBEpochs4Export(const QMap<QString, SgVlbiAuxObservation*>& auxObsByScan)
501 {
502  if (!auxObsByScan.size())
503  {
505  ": calcCBEpochs4Export(): cannot determine the epoch, the size of auxObs map is zero");
506  return;
507  };
508  for (int i=0; i<clockBreaks_.size(); i++)
509  {
510  SgParameterBreak* pb=clockBreaks_.at(i);
511  SgMJD tLeft(tZero), tRight(tInf);
512  QMap<QString, SgVlbiAuxObservation*>::const_iterator it;
513  for (it=auxObsByScan.begin(); it!=auxObsByScan.end(); ++it)
514  {
515  SgVlbiAuxObservation* obs=it.value();
516 // if (false || obs->isAttr(SgVlbiAuxObservation::Attr_PROCESSED))//ok, right now we use only good obs
517  if (true || obs->isAttr(SgVlbiAuxObservation::Attr_PROCESSED)) // use all obs
518  {
519  if (*obs<*pb && tLeft<*obs)
520  tLeft = *obs;
521  if (*pb<*obs && *obs<tRight)
522  tRight = *obs;
523  };
524  };
525  if (tZero<tLeft && tRight<tInf)
526  {
527  // calculating mean epoch:
528  SgMJD exportEpoch(tLeft);
529  exportEpoch += 0.5*(tRight - tLeft);
530  // round it to minutes:
531  double d=exportEpoch.getTime();
532  d = round(d*24.0*60.0)/24.0/60.0;
533  exportEpoch.setTime(d);
534  // setup epoch for export:
535  pb->setEpoch4Export(exportEpoch);
537  ": calcCBEpochs4Export(): station " + name() + ": set up clock break epoch for export: " +
538  exportEpoch.toString());
539  }
540  else
541  {
542  pb->setEpoch4Export(*pb);
544  ": calcCBEpochs4Export(): cannot determine clock break epoch for export: tLeft: " +
545  tLeft.toString(SgMJD::F_YYYYMMDDHHMMSSSS) + ", tRight: " +
547  };
548  };
549 };
550 
551 /*
552 Sg3dVector SgVlbiStationInfo::r(const SgMJD& t, SgTaskConfig* cfg)
553 {
554  Sg3dVector r(r_);
555  if (cfg->getUseExtAPrioriSitesPositions())
556  r = r_ea_ + v_ea_*(t - t0_);
557  return r;
558 };
559 */
560 
561 
562 
563 //
565 {
566  isEccNonZero_ = true;
568  v3Ecc_ = eccRec_->getDR();
569  else if (eccRec_->getEccType()==SgEccRec::ET_NEU)
570  {
571  Sg3dMatrixR R_e(EAST), R_n(NORTH);
572  Sg3dMatrix m3M=R_n(-longitude_)*R_e(latitude_);
573  v3Ecc_ = m3M*eccRec_->getDR();
574  };
575 };
576 
577 
578 
579 //
580 void SgVlbiStationInfo::checkAuxObs(const QMap<QString, QString>& scanNameById)
581 {
582  if (!auxObservationByScan_.size())
583  {
585  ": checkAuxObs(): station " + name() + ": the size of aux.obs's container is zero");
586  return;
587  };
588  QMap<SgMJD, QString> scanByTime;
589  QMap<QString, SgVlbiAuxObservation*>::iterator
590  it=auxObservationByScan_.begin();
591  //
592  while (it != auxObservationByScan_.end())
593  {
594  // check for the "same epoch" case:
595  SgVlbiAuxObservation *auxObs=it.value();
596  if (!scanByTime.contains(*auxObs))
597  scanByTime.insert(*auxObs, it.key());
598  else
599  {
600  QString scanName=scanByTime.value(*auxObs);
602  ": WARNING: the station " + name() + ": contains different observations at the same epoch: " +
603  auxObs->toString() + "; the scans: " + scanName + " and " + it.key(), true);
604  };
605  // remove unused data:
606  if (!scanNameById.contains(it.key()))
607  {
609  ": the scan " + it.key() + " was removed from the list of known scans of the station " +
610  name());
611  it = auxObservationByScan_.erase(it);
612  }
613  else
614  ++it;
615  };
616 /*
617  for (; it!=auxObservationByScan_.end(); ++it)
618  {
619  SgVlbiAuxObservation *auxObs=it.value();
620  if (!scanByTime.contains(*auxObs))
621  scanByTime.insert(*auxObs, it.key());
622  else
623  {
624  QString scanName=scanByTime.value(*auxObs);
625  logger->write(SgLogger::WRN, SgLogger::STATION, className() +
626  ": WARNING: the station " + getKey() + ": contains different observations at the same epoch: " +
627  auxObs->toString() + "; the scans: " + scanName + " and " + it.key(), true);
628  };
629  };
630 */
631 };
632 
633 
634 
635 //
637 {
639 
642  << (unsigned int)flybyCableCalSource_;
643 
644  if (s.status() != QDataStream::Ok)
645  {
647  ": saveIntermediateResults(): error writting data");
648  return false;
649  };
650  //
651  for (int i=0; i<clocksModelOrder_; i++)
652  if (s.status() == QDataStream::Ok)
653  s << estClockModel_[i] << estClockModelSigmas_[i];
654  else
655  {
657  ": saveIntermediateResults(): error writting data idx#" + QString("").setNum(i));
658  return false;
659  };
660  //
661  if (s.status() == QDataStream::Ok)
663 
665  {
667  ": saveIntermediateResults(): error writting data for the local clock parameter setup");
668  return false;
669  };
671  {
673  ": saveIntermediateResults(): error writting data for the local zenith parameter setup");
674  return false;
675  };
676  //
677  return s.status() == QDataStream::Ok;
678 };
679 
680 
681 
682 //
684 {
685  int n;
686  double v, e, a_0, a_1;
687  bool is;
688  unsigned int ccs;
689 
691 
692  s >> n >> v >> e >> a_0 >> a_1 >> is >> ccs;
693 
694  if (s.status() != QDataStream::Ok)
695  {
697  ": loadIntermediateResults(): error reading data: " +
698  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
699  return false;
700  };
701  clocksModelOrder_ = n;
702  estWetZenithDelay_ = v;
704 
705  aPrioriClockTerm_0_ = a_0;
706  aPrioriClockTerm_1_ = a_1;
709  //
710  //
711  for (int i=0; i<clocksModelOrder_; i++)
712  {
713  s >> v >> e;
714  if (s.status() == QDataStream::Ok)
715  {
716  estClockModel_[i] = v;
717  estClockModelSigmas_[i] = e;
718  }
719  else
720  {
722  ": loadIntermediateResults(): error reading data idx#" + QString("").setNum(i) + ": " +
723  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
724  return false;
725  };
726  };
727  //
729  if (s.status() != QDataStream::Ok)
730  {
732  ": loadIntermediateResults(): error reading clock breaks data: " +
733  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
734  return false;
735  };
736  //
738  if (s.status() != QDataStream::Ok)
739  {
741  ": loadIntermediateResults(): error reading local clock parameter setup: " +
742  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
743  return false;
744  };
745  //
747  if (s.status() != QDataStream::Ok)
748  {
750  ": loadIntermediateResults(): error reading local zenith parameter setup: " +
751  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
752  return false;
753  };
754  //
755  return s.status()==QDataStream::Ok;
756 };
757 
758 
759 
760 //
762 {
763  for (QMap<QString, SgVlbiAuxObservation*>::iterator it=auxObservationByScan_.begin();
764  it!=auxObservationByScan_.end(); ++it)
765  it.value()->resetCable();
766  // clear the attributes too:
768 };
769 
770 
771 
772 //
774 {
775  for (QMap<QString, SgVlbiAuxObservation*>::iterator it=auxObservationByScan_.begin();
776  it!=auxObservationByScan_.end(); ++it)
777  it.value()->resetMeteo();
778  // clear the attributes too:
780 };
781 
782 
783 
784 //
786 {
787  for (QMap<QString, SgVlbiAuxObservation*>::iterator it=auxObservationByScan_.begin();
788  it!=auxObservationByScan_.end(); ++it)
789  it.value()->resetTsys();
790  // clear the attributes too:
792 };
793 
794 
795 
796 //
798 {
802  bool hasFslg, hasCdms, hasPcmt;
803  hasFslg = hasCdms = hasPcmt = false;
804  //
805  for (QMap<QString, SgVlbiAuxObservation*>::iterator it=auxObservationByScan_.begin();
806  it!=auxObservationByScan_.end(); ++it)
807  {
808  SgVlbiAuxObservation* aux=it.value();
809  if (!hasFslg && aux->cableCorrections().getElement(SgVlbiAuxObservation::CCT_FSLG) != 0.0)
810  hasFslg = true;
811  if (!hasCdms && aux->cableCorrections().getElement(SgVlbiAuxObservation::CCT_CDMS) != 0.0)
812  hasCdms = true;
813  if (!hasPcmt && aux->cableCorrections().getElement(SgVlbiAuxObservation::CCT_PCMT) != 0.0)
814  hasPcmt = true;
815  };
816  //
817  if (hasFslg)
819  if (hasCdms)
821  if (hasPcmt)
823 };
824 
825 
826 
827 //
829 {
831  src = flybyCableCalSource_;
832  switch (src)
833  {
836  break;
839  break;
842  break;
844  default:
846  };
848  ": prepare2Run(): station " + name() + ": ccc index of cable calibration corrections is set to " +
849  QString("").setNum(cccIdx_));
850 };
851 /*=====================================================================================================*/
852 
853 
854 
855 
856 /*=====================================================================================================*/
857 //
858 // FRIENDS:
859 //
860 /*=====================================================================================================*/
861 //
862 
863 
864 
865 
866 /*=====================================================================================================*/
867 //
868 // aux functions:
869 //
870 
871 
872 
873 /*=====================================================================================================*/
874 //
875 // constants:
876 //
877 
878 
879 
880 
881 
882 
883 
884 
885 
886 
887 
888 
889 /*=====================================================================================================*/
const Sg3dVector v3Zero(0.0, 0.0, 0.0)
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
const SgMJD tInf(2100, 1, 1)
@ EAST
Definition: SgMathSupport.h:81
@ NORTH
Definition: SgMathSupport.h:81
#define MAX_NUMBER_OF_POLYNOMIALS
bool isAttr(uint a) const
Definition: SgAttribute.h:226
void delAttr(uint a)
Definition: SgAttribute.h:210
void addAttr(uint a)
Definition: SgAttribute.h:202
void createParameters(const QString &prefix)
bool loadIntermediateResults(QDataStream &)
void releaseParameters()
bool saveIntermediateResults(QDataStream &) const
@ ET_NEU
Definition: SgEccRec.h:51
@ ET_XYZ
Definition: SgEccRec.h:52
EccType getEccType() const
Definition: SgEccRec.h:251
const Sg3dVector & getDR() const
Definition: SgEccRec.h:243
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_NCDF
Definition: SgLogger.h:66
@ IO_BIN
Definition: SgLogger.h:64
@ STATION
Definition: SgLogger.h:75
Definition: SgMJD.h:59
double getTime() const
Definition: SgMJD.h:455
void setTime(double dTime)
Definition: SgMJD.cpp:166
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
Definition: SgMJD.h:67
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1008
bool loadIntermediateResults(QDataStream &)
const QString & getKey() const
Definition: SgObjectInfo.h:319
bool saveIntermediateResults(QDataStream &) const
@ Attr_PROCESSED
the observation has been processed;
Definition: SgObservation.h:79
void setEpoch4Export(const SgMJD &)
Definition: SgBreakModel.h:467
bool saveIntermediateResults(QDataStream &) const
bool loadIntermediateResults(QDataStream &)
double getElement(unsigned int i) const
Definition: SgVector.h:362
const SgVector & cableCorrections() const
static const QString className()
void calcCBEpochs4Export(const QMap< QString, SgVlbiAuxObservation * > &)
SgParameter * pAtmGradE_
static const int maxNumOfPolynomials_
SgParameter * pAtmGradN_
void prepare2Run(SgTaskConfig::CableCalSource src)
bool saveIntermediateResults(QDataStream &) const
SgParameterCfg pcClocks_
SgParameter * pAxisOffset_
SgBreakModel clockBreaks_
QString name() const
QVector< QString > tsysIfIds_
SgTaskConfig::CableCalSource flybyCableCalSource_
double oLoadAmplitudes_[11][3]
CableCalsOrigin cableCalsOrigin_
@ Attr_ESTIMATE_AXO
estimate axis offset;
@ Attr_HAS_CCC_FSLG
a station has cable calibrations from FS log file
@ Attr_HAS_CABLE_CAL
a station has cable calibration readings;
@ Attr_ESTIMATE_COO
estimate station position;
@ Attr_HAS_METEO
a station has meteo parameters;
@ Attr_HAS_CCC_CDMS
a station has cable calibrations from CDMS
@ Attr_HAS_CCC_PCMT
a station has cable calibrations from PCMT
SgParameter * pClocks_[MAX_NUMBER_OF_POLYNOMIALS]
MeteoDataOrigin meteoDataOrigin_
static int mntType2int(MountingType)
QVector< double > tsysIfFreqs_
double estClockModel_[MAX_NUMBER_OF_POLYNOMIALS]
bool loadIntermediateResults(QDataStream &)
QVector< QString > tsysIfSideBands_
static MountingType int2mntType(int)
double estClockModelSigmas_[MAX_NUMBER_OF_POLYNOMIALS]
SgParameter * pZenithDelay_
void checkAuxObs(const QMap< QString, QString > &scanNameById)
QVector< QString > tsysIfPolarizations_
SgParameterCfg pcZenith_
SgVlbiAuxObservation::CableCorrectionType cccIdx_
void checkPresenceOfCableCalibratioCorrections()
double oLoadPhases_[11][3]
SgVlbiStationInfo(int idx=-1, const QString &key="Unknown", const QString &aka="Unknown too")
QMap< QString, SgVlbiAuxObservation * > auxObservationByScan_