General Purpose Geodetic Library
SgVlbiBaselineInfo.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 <QtCore/QDataStream>
28 
29 
30 #include <SgVlbiBaselineInfo.h>
31 #include <SgVlbiObservation.h>
32 #include <SgVlbiObservable.h>
33 
34 #include <SgLogger.h>
35 
36 
37 
38 /*=======================================================================================================
39 *
40 * METHODS:
41 *
42 *======================================================================================================*/
43 //
44 // static first:
46 {
47  return "SgVlbiBaselineInfo";
48 };
49 
50 
51 
52 //
54 {
55  QString prefix = "Bln: " + getKey() + ": ";
57  pClock_ = new SgParameter(prefix + "Clock_0");
58  pBx_ = new SgParameter(prefix + "coord-X");
59  pBy_ = new SgParameter(prefix + "coord-Y");
60  pBz_ = new SgParameter(prefix + "coord-Z");
61  dClock_ = 0.0;
62  dClockSigma_ = 0.0;
63 };
64 
65 
66 
67 //
69 {
70  if (pClock_)
71  {
73  {
76  };
77  delete pClock_;
78  pClock_ = NULL;
79  };
80  if (pBx_)
81  {
82  delete pBx_;
83  pBx_ = NULL;
84  };
85  if (pBy_)
86  {
87  delete pBy_;
88  pBy_ = NULL;
89  };
90  if (pBz_)
91  {
92  delete pBz_;
93  pBz_ = NULL;
94  };
95 };
96 
97 
98 
99 //
101 {
102  bool isOk=true;
103  int num=0, count=0;
104  numOfChanByCount_.clear();
105  grdAmbigsBySpacing_.clear();
106  phdAmbigsBySpacing_.clear();
107  //
108  // set up "typical" group delay ambiguity spacing for the band:
109  for (int i=0; i<observables_.size(); i++)
110  {
111  grdAmbigsBySpacing_[observables_.at(i)->grDelay().getAmbiguitySpacing()]++;
112  phdAmbigsBySpacing_[observables_.at(i)->phDelay().getAmbiguitySpacing()]++;
113  numOfChanByCount_[observables_.at(i)->getNumOfChannels()]++;
114  };
115  // group delay:
116  if (grdAmbigsBySpacing_.size() == 1)
117  {
119  strGrdAmbigsStat_.sprintf("%.1f", typicalGrdAmbigSpacing_*1.0e9);
120  }
121  else
122  {
123  strGrdAmbigsStat_ = "";
124  num = observables_.size();
125  count = 0;
126  for (QMap<double, int>::iterator it=grdAmbigsBySpacing_.begin(); it!=grdAmbigsBySpacing_.end(); ++it)
127  {
128  strGrdAmbigsStat_ += QString("").sprintf("%.1f (%.1f%%), ", it.key()*1.0e9, it.value()*100.0/num);
129  if (count < it.value())
130  {
131  count = it.value();
132  typicalGrdAmbigSpacing_ = it.key();
133  };
134  };
136  };
137  // phase dleay:
138  if (phdAmbigsBySpacing_.size() == 1)
139  {
141  strPhdAmbigsStat_.sprintf("%.3f", typicalPhdAmbigSpacing_*1.0e9);
142  }
143  else
144  {
145  strPhdAmbigsStat_ = "";
146  num = observables_.size();
147  count = 0;
148  for (QMap<double, int>::iterator it=phdAmbigsBySpacing_.begin(); it!=phdAmbigsBySpacing_.end(); ++it)
149  {
150  strPhdAmbigsStat_ += QString("").sprintf("%.3f (%.1f%%), ", it.key()*1.0e9, it.value()*100.0/num);
151  if (count < it.value())
152  {
153  count = it.value();
154  typicalPhdAmbigSpacing_ = it.key();
155  };
156  };
158  };
159  //
160  // num of channels:
161  if (numOfChanByCount_.size() == 1)
162  typicalNumOfCannels_ = numOfChanByCount_.begin().key();
163  else
164  {
165  count = 0;
166  for (QMap<int, int>::iterator it=numOfChanByCount_.begin(); it!=numOfChanByCount_.end(); ++it)
167  if (count < it.value())
168  {
169  count = it.value();
170  typicalNumOfCannels_ = it.key();
171  };
172  };
173  //
174  return isOk;
175 };
176 
177 
178 
179 //
181 {
182  const int M0=3;
183  const double dS=0.2E-9; // 0.2ns
184  QList<SgVlbiObservable*> obsList;
185  SgVlbiObservable *obs=NULL;
186  double x0, s;
187 
188  // first, clear the flag, then, pick up processed observations:
189  for (int i=0; i<observables_.size(); i++)
190  {
191  SgVlbiObservable *obs = observables_.at(i);
194  obsList.append(obs);
195  };
196 
197  if (obsList.size()<2*M0)
198  return;
199 
200  x0 = observables_.at(0)->epoch().toDouble();
201 
202  double x, y, w;
203  double A_l, B_l, C_l, P_l, Q_l, R_l;
204  double a_l, b_l, wrms_l;
205  double A_r, B_r, C_r, P_r, Q_r, R_r;
206  double a_r, b_r, wrms_r;
207  x = y = w = 0.0;
208  A_l = B_l = C_l = P_l = Q_l = R_l = 0.0;
209  a_l = b_l = wrms_l = 0.0;
210  A_r = B_r = C_r = P_r = Q_r = R_r = 0.0;
211  a_r = b_r = wrms_r = 0.0;
212 
213  // calc whole wrms residuals:
214  for (int i=0; i<obsList.size(); i++)
215  {
216  obs = obsList.at(i);
217  x = obs->epoch().toDouble() - x0;
218  y = obs->activeDelay()->getResidual();
219  s = fabs(obs->activeDelay()->getSigma()) + dS;
220  w = 1.0/s/s;
221  A_l += w;
222  B_l += w*x;
223  C_l += w*x*x;
224  P_l += w*y;
225  Q_l += w*x*y;
226  R_l += w*y*y;
227  };
228  b_l = (P_l*B_l - A_l*Q_l)/(B_l*B_l - A_l*C_l);
229  a_l = (Q_l - C_l*b_l)/B_l;
230  cbd_total_wrms_ = sqrt(fabs((R_l + a_l*a_l*A_l + b_l*b_l*C_l +
231  2.0*(a_l*b_l*B_l - a_l*P_l - b_l*Q_l))/A_l));
232  //
233  //
234  for (int i=0; i<observables_.size(); i++)
235  {
236  SgVlbiObservable *obs = observables_.at(i);
238  obs->setTest(obs->owner()->getBaselineClock_F1());
239  };
240  //std::cout << " >> cbd_total_wrms_= " << cbd_total_wrms_*1.0e9 << " ns\n";
241  //
242  //
243  A_l = B_l = C_l = P_l = Q_l = R_l = 0.0;
244  a_l = b_l = 0.0;
245  // initial evaluating:
246  for (int i=0; i<M0; i++)
247  {
248  obs = obsList.at(i);
249  x = obs->epoch().toDouble() - x0;
250  y = obs->activeDelay()->getResidual();
251  s = fabs(obs->activeDelay()->getSigma()) + dS;
252  w = 1.0/s/s;
253 
254  A_l += w;
255  B_l += w*x;
256  C_l += w*x*x;
257  P_l += w*y;
258  Q_l += w*x*y;
259  R_l += w*y*y;
260  };
261  for (int i=M0; i<obsList.size(); i++)
262  {
263  obs = obsList.at(i);
264  x = obs->epoch().toDouble() - x0;
265  y = obs->activeDelay()->getResidual();
266  s = fabs(obs->activeDelay()->getSigma()) + dS;
267  w = 1.0/s/s;
268 
269  A_r += w;
270  B_r += w*x;
271  C_r += w*x*x;
272  P_r += w*y;
273  Q_r += w*x*y;
274  R_r += w*y*y;
275  };
276 
277  b_l = (P_l*B_l - A_l*Q_l)/(B_l*B_l - A_l*C_l);
278  a_l = (Q_l - C_l*b_l)/B_l;
279  wrms_l = (R_l + a_l*a_l*A_l + b_l*b_l*C_l + 2.0*(a_l*b_l*B_l - a_l*P_l - b_l*Q_l))/A_l;
280  b_r = (P_r*B_r - A_r*Q_r)/(B_r*B_r - A_r*C_r);
281  a_r = (Q_r - C_r*b_r)/B_r;
282  wrms_r = (R_r + a_r*a_r*A_r + b_r*b_r*C_r + 2.0*(a_r*b_r*B_r - a_r*P_r - b_r*Q_r))/A_r;
283 
284 // obsList.at(M0-1)->setBaselineClock_F1 ((sqrt(fabs(wrms_l)) + sqrt(fabs(wrms_r)))/cbd_total_wrms_);
285  //obsList.at(M0-1)->owner()->setBaselineClock_F1 (sqrt(fabs(wrms_l)) + sqrt(fabs(wrms_r)));
286  obsList.at(M0-1)->owner()->setBaselineClock_F1 (sqrt(fabs(wrms_l) + fabs(wrms_r)));
287  obsList.at(M0-1)->owner()->setBaselineClock_F1l(sqrt(fabs(wrms_l)));
288  obsList.at(M0-1)->owner()->setBaselineClock_F1r(sqrt(fabs(wrms_r)));
289 // obsList.at(M0-1)->setBaselineClock_F1(sqrt(fabs(wrms_l + wrms_r)));
290  obsList.at(M0-1)->owner()->addAttr(SgVlbiObservation::Attr_PASSED_CL_FN1);
291 
292  for (int i=M0; i<obsList.size()-M0; i++)
293  {
294  obs = obsList.at(i);
295  x = obs->epoch().toDouble() - x0;
296  y = obs->activeDelay()->getResidual();
297  s = fabs(obs->activeDelay()->getSigma()) + dS;
298  w = 1.0/s/s;
299 
300  A_l += w;
301  B_l += w*x;
302  C_l += w*x*x;
303  P_l += w*y;
304  Q_l += w*x*y;
305  R_l += w*y*y;
306 
307  A_r -= w;
308  B_r -= w*x;
309  C_r -= w*x*x;
310  P_r -= w*y;
311  Q_r -= w*x*y;
312  R_r -= w*y*y;
313 
314  b_l = (P_l*B_l - A_l*Q_l)/(B_l*B_l - A_l*C_l);
315  a_l = (Q_l - C_l*b_l)/B_l;
316  wrms_l = (R_l + a_l*a_l*A_l + b_l*b_l*C_l + 2.0*(a_l*b_l*B_l - a_l*P_l - b_l*Q_l))/A_l;
317  b_r = (P_r*B_r - A_r*Q_r)/(B_r*B_r - A_r*C_r);
318  a_r = (Q_r - C_r*b_r)/B_r;
319  wrms_r = (R_r + a_r*a_r*A_r + b_r*b_r*C_r + 2.0*(a_r*b_r*B_r - a_r*P_r - b_r*Q_r))/A_r;
320  obs->owner()->setBaselineClock_F1 (sqrt(fabs(wrms_l) + fabs(wrms_r)));
321  obs->owner()->setBaselineClock_F1l(sqrt(fabs(wrms_l)));
322  obs->owner()->setBaselineClock_F1r(sqrt(fabs(wrms_r)));
324  obs->setTest(obs->owner()->getBaselineClock_F1());
325  };
326 
327  obsList.clear();
328 };
329 
330 
331 
332 //
334 {
335  QList<SgVlbiObservable*> obsList;
336  SgVlbiObservable *obs=NULL;
337  int iM0=3;
338 
339  if (!cbIndicator_)
342 
343  // first, clear the flag, then, pick up processed observations:
344  for (int i=0; i<observables_.size(); i++)
345  {
346  obs = observables_.at(i);
348 // &&
349 // obs->owner()->isAttr(SgVlbiObservation::Attr_PASSED_CL_FN1)
350  )
351  obsList.append(obs);
352  };
353  if (obsList.size()<4)
354  {
355  delete cbIndicator_;
356  cbIndicator_ = NULL;
357  return;
358  };
359  //
360  double minWrms, maxWrms;
361  int minIdx=-1;
362 // minWrms = maxWrms = obsList.at(0)->owner()->getBaselineClock_F1();
363  minWrms = maxWrms = obsList.at(iM0)->owner()->getBaselineClock_F1();
364 
365 /*
366 std::cout
367 << " >> minWrms= " << minWrms << " "
368 << " >> maxWrms= " << maxWrms << " "
369 << " >> obsList.size()= " << obsList.size() << " "
370 << "\n";
371 */
372 // for (int i=0; i<obsList.size(); i++)
373  for (int i=iM0; i<obsList.size()-iM0; i++)
374  {
375  obs = obsList.at(i);
376 
377 /*
378 std::cout
379 << " >> i= " << i << " "
380 << " epoch: " << qPrintable(obs->epoch().toString()) << " "
381 << " minWrms= " << minWrms << " "
382 << " obs->owner()->getBaselineClock_F1()= " << obs->owner()->getBaselineClock_F1() << " "
383 
384 << "\n";
385 */
386  if (minWrms > obs->owner()->getBaselineClock_F1())
387  {
388  minWrms = obs->owner()->getBaselineClock_F1();
389  minIdx = i;
390  };
391  if (maxWrms < obs->owner()->getBaselineClock_F1())
392  maxWrms = obs->owner()->getBaselineClock_F1();
393  };
394  if (maxWrms == minWrms)
395  {
396  delete cbIndicator_;
397  cbIndicator_ = NULL;
398  return;
399  };
400  if (minIdx == -1)
401  {
402  delete cbIndicator_;
403  cbIndicator_ = NULL;
404  return;
405  };
406  if (minIdx < iM0)
407  {
408  delete cbIndicator_;
409  cbIndicator_ = NULL;
410  return;
411  };
412  if (obsList.size()-iM0 < minIdx)
413  {
414  delete cbIndicator_;
415  cbIndicator_ = NULL;
416  return;
417  };
418  //
419  // ok:
420  cbIndicator_->epoch_ = obsList.at(minIdx)->epoch();
421  cbIndicator_->minWrms_ = minWrms;
422 
423 /*
424 std::cout << " >> minIdx= " << minIdx << " "
425 << " epoch: " << qPrintable(obsList.at(minIdx)->epoch().toString())
426 
427 << "\n";
428 */
429 
430  int i, n;
431  // right wing:
432  n = 0;
433  i = minIdx + 1;
434  while (i<obsList.size()-iM0 &&
435  obsList.at(i-1)->owner()->getBaselineClock_F1() <= obsList.at(i)->owner()->getBaselineClock_F1())
436  {
437  n++;
438  i++;
439  };
441  cbIndicator_->tOnRight_ = obsList.at(minIdx+n)->epoch();
442  // left wing:
443  n = 0;
444  i = minIdx;
445  while (i>0 &&
446  obsList.at(i)->owner()->getBaselineClock_F1() <= obsList.at(i-1)->owner()->getBaselineClock_F1())
447  {
448  n++;
449  i--;
450  };
452  cbIndicator_->tOnLeft_ = obsList.at(minIdx-n)->epoch();
453  obsList.clear();
454 };
455 
456 
457 
458 //
460 {
462 // scan4Ambiguities_m2();
463 };
464 
465 
466 
467 //
469 {
471  SgVlbiObservable *o=NULL;
472 
473  // first, clear the flag, then, pick up processed observations:
474  for (int i=0; i<observables_.size(); i++)
475  {
476  o = observables_.at(i);
478  oList.append(o);
479  };
480  if (!oList.size())
481  {
483  ": scan4Ambiguities(): the number of processed observations at the baseline [" +
484  getKey() + "] is zero; skipping");
485  oList.clear();
486  return;
487  };
488  //
489  int num=oList.size(), numUp=0, numDn=0;
490  for (int i=0; i<num; i++)
491  {
492  o = oList.at(i);
494  if (o->activeDelay()->getResidual() > 0.0)
495  numUp++;
496  if (o->activeDelay()->getResidual() < 0.0)
497  numDn++;
498  };
499  bool isUp=numUp>numDn;
500  int n=std::max(numUp, numDn);
501  if (n<4)
502  {
504  ": scan4Ambiguities(): the number of observations in the good stratum at the baseline [" +
505  getKey() + "] less than 4; applying simple correction");
506  for (int i=0; i<oList.size()-1; i++)
507  {
508  double closestResidual=oList.at(i)->activeDelay()->getResidual();
509  o = oList.at(i+1);
510  o->activeDelay()->adjustAmbiguity(closestResidual);
511  };
512  oList.clear();
513  return;
514  };
515  SgVector x(n), y(n), e(n);
516  SgMJD t0 = (*oList.at(oList.size()-1)->owner() - *oList.at(0)->owner())/2.0;
517  int j=0;
518  for (int i=0; i<num; i++)
519  {
520  o = oList.at(i);
521  if ((isUp && o->activeDelay()->getResidual()>0.0) ||
522  (!isUp && o->activeDelay()->getResidual()<0.0) )
523  {
524  x(j) = *o->owner() - t0;
525  y(j) = o->activeDelay()->getResidual();
526  e(j) = o->activeDelay()->getSigma() + 10.0E-12;
527  j++;
528  };
529  };
530  // determine mean shift:
531  double sA=0.0, sB=0.0, sC=0.0, closestResidual, d;
532  for (int i=0; i<n; i++)
533  {
534  sA += 1.0/e.getElement(i)/e.getElement(i);
535  sB += (d=y.getElement(i)/e.getElement(i))/e.getElement(i);
536  sC += d*d;
537  };
538  closestResidual = sB/sA;
539 
540  oList.clear();
541  // reprocess residuals:
542  //
543  for (int i=0; i<observables_.size(); i++)
544  {
545  o = observables_.at(i);
546  o->activeDelay()->adjustAmbiguity(closestResidual);
547  };
548 };
549 
550 
551 
552 //
554 {
555  QList<SgVlbiObservable*> obsList;
556  SgVlbiObservable *o=NULL;
557 
558  // first, clear the flag, then, pick up processed observations:
559  for (int i=0; i<observables_.size(); i++)
560  {
561  o = observables_.at(i);
563  obsList.append(o);
564  };
565  if (!obsList.size())
566  {
568  ": scan4Ambiguities(): the number of processed observations at the baseline [" +
569  getKey() + "] is zero; skipping");
570  obsList.clear();
571  return;
572  };
573  //
574  int nAvg=5;
575  double closestResidual;
576  if (obsList.size() <= nAvg)
577  {
578  obsList.at(0)->activeDelay()->adjustAmbiguity();
579  closestResidual = obsList.at(0)->activeDelay()->getResidual();
580  for (int i=0; i<obsList.size()-1; i++)
581  {
582  obsList.at(i+1)->activeDelay()->adjustAmbiguity(closestResidual);
583  closestResidual = obsList.at(i+1)->activeDelay()->getResidual();
584  };
585  }
586  else
587  {
588  closestResidual = 0.0;
589  for (int i=0; i<nAvg; i++)
590  closestResidual += obsList.at(i)->activeDelay()->getResidual();
591  closestResidual /= nAvg;
592  for (int i=0; i<nAvg; i++)
593  obsList.at(i)->activeDelay()->adjustAmbiguity(closestResidual);
594  for (int i=nAvg; i<obsList.size(); i++)
595  {
596  closestResidual = 0.0;
597  for (int j=0; j<nAvg; j++)
598  closestResidual += obsList.at(i + j - nAvg)->activeDelay()->getResidual();
599  closestResidual /= nAvg;
600 
601  obsList.at(i)->activeDelay()->adjustAmbiguity(closestResidual);
602  };
603  };
604  return;
605 
606 
607 
608  int crIdx=0;
609  closestResidual = fabs(obsList.at(crIdx)->activeDelay()->getResidual());
610  for (int i=0; i<obsList.size(); i++)
611  {
612  o = obsList.at(i);
613  if (fabs(o->activeDelay()->getResidual()) < closestResidual)
614  {
615  closestResidual = fabs(o->activeDelay()->getResidual());
616  crIdx = i;
617  };
618  };
619  closestResidual = obsList.at(crIdx)->activeDelay()->getResidual();
620  // adjust the closest residual:
621  obsList.at(crIdx)->activeDelay()->adjustAmbiguity(closestResidual);
622  closestResidual = obsList.at(crIdx)->activeDelay()->getResidual();
623  // process other residuals:
624  for (int i=crIdx; i>0; i--)
625  {
626  closestResidual = obsList.at(i)->activeDelay()->getResidual();
627  obsList.at(i-1)->activeDelay()->adjustAmbiguity(closestResidual);
628  };
629  for (int i=crIdx; i<obsList.size()-1; i++)
630  {
631  closestResidual = obsList.at(i)->activeDelay()->getResidual();
632  o = obsList.at(i + 1);
633  obsList.at(i+1)->activeDelay()->adjustAmbiguity(closestResidual);
634  };
635  obsList.clear();
636 };
637 
638 
639 
640 //
642 {
644  SgVlbiObservable *o=NULL;
645  //
646  // first, clear the flag, then, pick up processed observations:
647  for (int i=0; i<observables_.size(); i++)
648  {
649  o = observables_.at(i);
651  oList.append(o);
652  };
653  if (oList.size() == 0)
654  {
656  ": evaluateMeanGrDelResiduals(): the number of processed observations at the baseline [" +
657  getKey() + "] is zero; skipping");
658  oList.clear();
659  return;
660  };
661  //
662  double sA=0.0, sB=0.0, sC=0.0;
663  double y, w;
664  for (int i=0; i<oList.size(); i++)
665  {
666  o = oList.at(i);
667  y = o->activeDelay()->getResidual();
668  w = o->activeDelay()->getSigma() + 5.0E-12;
669  w = 1.0/w/w;
670  sA += w;
671  sB += w*y;
672  sC += w*y*y;
673  };
674  meanGrDelResiduals_ = sB/sA;
675  meanGrDelResidualsSigma_= (sC - sB)/sA;
676  //
677  oList.clear();
678 };
679 
680 
681 
682 //
684 {
685  if (deltaN==0 || observables_.size()==0)
686  return; // nothing to do
687 
689  double ambigSpacing=typicalGrdAmbigSpacing_, shift;
691  ambigSpacing = typicalPhdAmbigSpacing_;
692  shift = deltaN*ambigSpacing;
693  int n;
694  for (int i=0; i<observables_.size(); i++)
695  {
696  o = observables_.at(i);
697  n = rint(shift/o->activeDelay()->getAmbiguitySpacing());
699  n*o->activeDelay()->getAmbiguitySpacing());
701  };
702 };
703 
704 
705 
706 //
707 SgVlbiStationInfo* SgVlbiBaselineInfo::stn_1(QMap<QString, SgVlbiStationInfo*> stations) const
708 {
709  SgVlbiStationInfo *stn=NULL;
710  QString name(getKey().left(8));
711  if (stations.contains(name))
712  stn = stations.value(name);
713  return stn;
714 };
715 
716 
717 
718 //
719 SgVlbiStationInfo* SgVlbiBaselineInfo::stn_2(QMap<QString, SgVlbiStationInfo*> stations) const
720 {
721  SgVlbiStationInfo *stn=NULL;
722  QString name(getKey().right(8));
723  if (stations.contains(name))
724  stn = stations.value(name);
725  return stn;
726 };
727 
728 
729 
730 //
732 {
734  SgVlbiObservable *o=NULL;
735 
736  // first, clear the flag, then, pick up processed observations:
737  for (int i=0; i<observables_.size(); i++)
738  {
739  o = observables_.at(i);
741  oList.append(o);
742  };
743  if (!oList.size())
744  {
746  ": setAmbiguities2min(): the number of processed observations at the baseline [" +
747  getKey() + "] is zero; skipping");
748  oList.clear();
749  return;
750  };
751  //
752  int num=oList.size(), meanAmbig;
753  double sum=0.0;
754  for (int i=0; i<num; i++)
755  sum += oList.at(i)->activeDelay()->getNumOfAmbiguities();
756  meanAmbig = round(sum/num);
757  if (meanAmbig != 0)
758  for (int i=0; i<observables_.size(); i++)
759  {
760  o = observables_.at(i);
762  - meanAmbig);
763  };
764 };
765 
766 
767 
768 //
770 {
772  //
773  s << dClock_ << dClockSigma_;
774  //
775  if (s.status() != QDataStream::Ok)
776  {
778  ": saveIntermediateResults(): error writting data");
779  return false;
780  };
781  return s.status() == QDataStream::Ok;
782 };
783 
784 
785 
786 //
788 {
789  double dClock, dClockSigma;
790  //
792  //
793  s >> dClock >> dClockSigma;
794  //
795  if (s.status() != QDataStream::Ok)
796  {
798  ": loadIntermediateResults(): error reading data: " +
799  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
800  return false;
801  };
802  dClock_ = dClock;
804  //
805  return s.status()==QDataStream::Ok;
806 };
807 /*=====================================================================================================*/
808 
809 
810 
811 
812 /*=====================================================================================================*/
813 //
814 // FRIENDS:
815 //
816 /*=====================================================================================================*/
817 //
818 
819 /*=====================================================================================================*/
820 //
821 // aux functions:
822 //
823 
824 /*=====================================================================================================*/
825 //
826 // constants:
827 //
828 
829 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
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
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_BIN
Definition: SgLogger.h:64
Definition: SgMJD.h:59
double toDouble() const
Definition: SgMJD.h:531
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
double getSolution() const
Definition: SgParameter.h:435
double getSigma() const
Definition: SgParameter.h:443
@ Attr_IS_IN_RUN
Definition: SgPartial.h:52
double getElement(unsigned int i) const
Definition: SgVector.h:362
SgVlbiStationInfo * stn_2(QMap< QString, SgVlbiStationInfo * >) const
QList< SgVlbiObservable * > observables_
QMap< int, int > numOfChanByCount_
QMap< double, int > grdAmbigsBySpacing_
SgVlbiStationInfo * stn_1(QMap< QString, SgVlbiStationInfo * >) const
SgClockBreakIndicator * cbIndicator_
double dClockSigma() const
bool loadIntermediateResults(QDataStream &)
void calculateClockF1(SgTaskConfig *)
static const QString className()
bool saveIntermediateResults(QDataStream &) const
QMap< double, int > phdAmbigsBySpacing_
void shiftAmbiguities(int deltaN)
double getAmbiguitySpacing() const
void setResidual(double)
void adjustAmbiguity(double closestResidual=0.0)
void setNumOfAmbiguities(int)
int getNumOfAmbiguities() const
double getSigma() const
SgTaskConfig::VlbiDelayType getDelayType() const
double getResidual() const
void setTest(double d)
const SgMJD & epoch() const
SgVlbiObservation * owner()
SgVlbiMeasurement * activeDelay()
@ Attr_PASSED_CL_FN1
the observation participated in the procedure "calc clc fn#1"
void setBaselineClock_F1l(double f)
double getBaselineClock_F1() const
void setBaselineClock_F1(double f)
void setBaselineClock_F1r(double f)