General Purpose Geodetic Library
NsSessionEditDialog.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of nuSolve. nuSolve is a part of CALC/SOLVE system
4  * and is designed to perform data analyis of a geodetic VLBI session.
5  * Copyright (C) 2010-2020 Sergei Bolotin.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #include "NsSessionEditDialog.h"
23 #include "NsMainWindow.h"
24 #include "nuSolve.h"
26 
27 #include <iostream>
28 #include <stdlib.h>
29 
30 
31 
32 
33 //#define DEMO 1
34 //#undef DEMO
35 
36 
37 #include <QtCore/QDataStream>
38 #include <QtCore/QDir>
39 #include <QtCore/QFile>
40 #include <QtCore/QFileInfo>
41 
42 
43 
44 #if QT_VERSION >= 0x050000
45 # include <QtWidgets/QApplication>
46 # include <QtWidgets/QBoxLayout>
47 # include <QtWidgets/QButtonGroup>
48 # include <QtWidgets/QCheckBox>
49 # include <QtWidgets/QComboBox>
50 # include <QtWidgets/QFrame>
51 # include <QtWidgets/QGroupBox>
52 # include <QtWidgets/QHeaderView>
53 # include <QtWidgets/QLabel>
54 # include <QtWidgets/QMessageBox>
55 # include <QtWidgets/QPushButton>
56 # include <QtWidgets/QRadioButton>
57 # include <QtWidgets/QShortcut>
58 # include <QtWidgets/QTabWidget>
59 #else
60 # include <QtGui/QApplication>
61 # include <QtGui/QBoxLayout>
62 # include <QtGui/QButtonGroup>
63 # include <QtGui/QCheckBox>
64 # include <QtGui/QComboBox>
65 # include <QtGui/QFrame>
66 # include <QtGui/QGroupBox>
67 # include <QtGui/QHeaderView>
68 # include <QtGui/QLabel>
69 # include <QtGui/QMessageBox>
70 # include <QtGui/QPushButton>
71 # include <QtGui/QRadioButton>
72 # include <QtGui/QShortcut>
73 # include <QtGui/QTabWidget>
74 #endif
75 
76 
77 #include <QtGui/QIcon>
78 
79 
80 #include <SgArcStorage.h>
81 #include <SgConstants.h>
82 #include <SgDbhImage.h>
83 #include <SgGuiPiaReport.h>
84 #include <SgGuiPlotter.h>
85 #include <SgGuiTaskConfig.h>
86 #include <SgLogger.h>
87 #include <SgMJD.h>
88 #include <SgParameterCfg.h>
89 #include <SgPwlStorage.h>
90 #include <SgPwlStorageBSplineL.h>
91 #include <SgPwlStorageBSplineQ.h>
92 #include <SgPwlStorageIncRates.h>
94 #include <SgSolutionReporter.h>
95 #include <SgTaskManager.h>
96 #include <SgVgosDb.h>
97 #include <SgVlbiBand.h>
98 #include <SgVlbiNetworkId.h>
99 #include <SgVlbiObservation.h>
100 
101 
102 
103 
104 
106 {
122  BPI_SNR = 15,
138 
139  // test purposes:
143  //
144  BPI_QF = 34,
145  BPI_FEC = 35, // fringe error code
146  // phasecals:
151  BPI_U = 40,
152  BPI_V = 41,
153  BPI_TAUS = 42,
154  BPI_TEST = 43,
155  //
156 };
157 
158 
159 
161 {
180  // test purposes:
183 };
184 
185 
186 
188 {
196 };
197 
198 
199 
200 /*=======================================================================================================
201 *
202 * METHODS:
203 *
204 *======================================================================================================*/
205 NsSessionEditDialog::NsSessionEditDialog(const QString& fileName, const QString& fileNameAux,
207  SgVlbiSessionInfo::OriginType oType, bool isLnfs, QWidget *parent, Qt::WindowFlags flags)
208  : QDialog(parent, flags),
209  NsSessionHandler(fileName, fileNameAux, config, parametersDescriptor, oType),
210  plotCarriers4Baselines_(),
211  plots4Baselines_(),
212  labelsPrc_(),
213  labelsPar_(),
214  labelsWRMS_(),
215  labelsSig0_(),
216  labelsChi2_()
217 {
218  stationsList_ = NULL;
219  baselinesList_ = NULL;
220  sourcesList_ = NULL;
221  generateReportAct_ = NULL;
222  plotCarrier4Stations_ = NULL;
223  plotCarrier4Session_ = NULL;
224  plot4Stations_ = NULL;
225  plot4Session_ = NULL;
226 
227  cableCalsOffset_ = 0;
228 
229  scale4Delay_ = 1.0e9; // this is ns
230  scale4Rate_ = 1.0e15; // fs
231  // scale4Delay_ = vLight*100.0; // this is cm
232  processHasBeenCalled_ = false;
233  isImpossibleUpdateCat_ = false;
234  isNeed2SaveSir_ = true;
235  //
236  // save some info:
252 
253  // add GUI:
260 
261  blockInput();
262  if (!importSession(true))
263  {
264  restoreInput();
265  deleteLater();
266  return;
267  };
268  restoreInput();
269  // warn a user:
271  {
272  QMessageBox::warning(this, "Warning", "A database with the next version "
273  "already exists in the catalog.\nThe 'Save' procedure will not work if you do not remove it "
274  "from the catalog first.");
276  };
277  // if nothing to load:
278  if (loadIntermediateResults(!isLnfs))
279  processHasBeenCalled_ = true;
280  else if (oType_ == SgVlbiSessionInfo::OT_AGV)
281  {
283  ": the automatic analysis is disabled for vgosDa input type");
284  }
286  {
288  ": the automatic analysis is disabled by the command line argument");
290  }
291  // unprocessed or foreign session:
293  {
295  generateReport();
296  processHasBeenCalled_ = true;
297  if (config_->apByNetId().contains(session_->getNetworkID()) &&
298  config_->apByNetId()[session_->getNetworkID()].doOutliers_ &&
299  config_->apByNetId()[session_->getNetworkID()].doWeights_ )
300  (new SgGuiPiaReport(config_, parametersDescriptor_, session_, this, Qt::Dialog))->show();
301  }
302  else
303  {
304  // the reference clock station(s) should be saved in a database
305  // have to set up a coordinate reference station and adjust clock's polynomial model order:
308  };
309  //
310  //
311  // set up the GUI stuff:
312  //
313  //
315  {
316  setWindowTitle(session_->getName() + " Session Editor " +
317  (setup.getHave2UpdateCatalog()?"(work through catalog":"(standalone mode") + " as " +
319  }
321  {
322  setWindowTitle("Session Editor: " + session_->getName() + " " +
323  QString("").sprintf("V%03d", vgosDb_->getCurrentVersion()) + " " +
324  session_->getCorrelatorName() + "|" +
326  " (as " + setup.identities().getUserDefaultInitials() + ")");
327  }
329  {
330  setWindowTitle(session_->getName() + " Session Editor " +
331  (setup.getHave2UpdateCatalog()?"(work through catalog":"(standalone mode") + " as " +
333  }
334  else
335  {
336  setWindowTitle(session_->getName() + " Session Editor " +
337  (setup.getHave2UpdateCatalog()?"(work through catalog":"(standalone mode") + " as " +
339  };
340 
341 
342  if (0<setup.getSeWinWidth() && 0<setup.getSeWinHeight())
344 
345  QBoxLayout *layout, *subLayout;
346  QSize btnSize;
347  if (setup.getIsShortScreen())
348  layout = new QHBoxLayout(this);
349  else
350  layout = new QVBoxLayout(this);
351  QTabWidget *sessionTabs=new QTabWidget(this);
352 
353  sessionTabs->addTab(tab4GeneralInfo(), "&General Info");
354  sessionTabs->addTab(tab4Options(), "&Options");
355  sessionTabs->addTab(tab4BaselinesPlot(), "&Bands");
356  sessionTabs->addTab(tab4StationsInfo(), "S&tations (List)");
357  sessionTabs->addTab(tab4SourcesInfo(), "Sou&rces (List)");
358  sessionTabs->addTab(tab4BaselinesInfo(), "Base&lines (List)");
359  sessionTabs->addTab(tab4StationsPlot(), "&Stations (Plots)");
360  sessionTabs->addTab(tab4SessionPlot(), "S&ession (Plots)");
361  //
363  //
364  layout->addWidget(sessionTabs, 10);
365  // "too big, too small
366  if (setup.getIsShortScreen()) // size does matter after all."
367  subLayout = new QVBoxLayout();
368  else
369  subLayout = new QHBoxLayout();
370  layout->addLayout(subLayout);
371 
372 
373  QPushButton *ok, *process, *dapCB, *rmOut, *save, *s2add0, *reset;
374  ok = new QPushButton("Close", this);
375  ionoC_ = new QPushButton("&IonoC", this);
376  iono0_ = new QPushButton("Iono&0", this);
377  process= new QPushButton("&Process", this);
378  dapCB = new QPushButton("&CBreak", this);
379  rmOut = new QPushButton("O&utlr", this);
380  scanAmbigs_ = new QPushButton("&Ambig", this);
381  save = new QPushButton("Sa&ve", this);
382  s2add0 = new QPushButton("Au&xSig0", this);
383  reset = new QPushButton("Reset", this);
384  saveButton_ = save;
385  // QPushButton *rprt = new QPushButton("Report", this);
386  process->setDefault(true);
387 
388  process->setMinimumSize((btnSize=process->sizeHint()));
389  ionoC_ ->setMinimumSize( btnSize );
390  iono0_ ->setMinimumSize( btnSize );
391  // cancel ->setMinimumSize( btnSize );
392  ok ->setMinimumSize( btnSize );
393  dapCB ->setMinimumSize( btnSize );
394  rmOut ->setMinimumSize( btnSize );
395  scanAmbigs_->setMinimumSize( btnSize );
396  save ->setMinimumSize( btnSize );
397  // rprt ->setMinimumSize( btnSize );
398  s2add0 ->setMinimumSize( btnSize );
399  reset ->setMinimumSize( btnSize );
400  if (setup.getIsShortScreen())
401  subLayout->addSpacing(btnSize.height());
402  subLayout->addWidget(process);
403  subLayout->addWidget(ionoC_);
404  subLayout->addWidget(iono0_);
405  subLayout->addWidget(scanAmbigs_);
406  subLayout->addWidget(dapCB);
407  subLayout->addWidget(s2add0);
408  subLayout->addWidget(reset);
409  subLayout->addWidget(rmOut);
410 
411  subLayout->addStretch(1);
412  // subLayout->addWidget(rprt);
413  subLayout->addWidget(save);
414  subLayout->addWidget(ok);
415  // subLayout->addWidget(cancel);
416  if (setup.getIsShortScreen())
417  subLayout->addSpacing(btnSize.height());
418  setSizeGripEnabled(true);
419 
420 // stationsList_ ->setWrmsScale(scale4Delay_*1.0E3);
421 // sourcesList_ ->setWrmsScale(scale4Delay_*1.0E3);
422 // baselinesList_->setWrmsScale(scale4Delay_*1.0E3);
423 
424  connect(this, SIGNAL(dataChanged()), stationsList_, SLOT(updateContent()));
425  connect(this, SIGNAL(dataChanged()), sourcesList_, SLOT(updateContent()));
426  connect(this, SIGNAL(dataChanged()), baselinesList_, SLOT(updateContent()));
427 
428  connect(stationsList_, SIGNAL(refClockStationSelected (const QString&)),
429  baselinesList_,SLOT (addRefClockStation (const QString&)));
430  connect(stationsList_, SIGNAL(refClockStationDeselected(const QString&)),
431  baselinesList_,SLOT (delRefClockStation (const QString&)));
432  // set up ref clocks if exist:
433  QMap<QString, SgVlbiStationInfo*>::const_iterator it=session_->stationsByName().constBegin();
434  for (; it!=session_->stationsByName().constEnd(); ++it)
435  {
436  SgVlbiStationInfo* stInfo = it.value();
439  };
440  //
441  connect(process,SIGNAL(clicked()), SLOT(process()));
442  connect(ionoC_, SIGNAL(clicked()), SLOT(calcIono()));
443  connect(iono0_, SIGNAL(clicked()), SLOT(zeroIono()));
444  connect(dapCB, SIGNAL(clicked()), SLOT(detectAndProcessClockBreaks()));
445  connect(rmOut, SIGNAL(clicked()), SLOT(processRmOutButton()));
446  connect(scanAmbigs_, SIGNAL(clicked()), SLOT(scanAmbiguityMultipliers()));
447  connect(ok, SIGNAL(clicked()), SLOT(accept()));
448  connect(save, SIGNAL(clicked()), SLOT(saveData()));
449  connect(s2add0, SIGNAL(clicked()), SLOT(clearAuxSigmas()));
450  connect(reset, SIGNAL(clicked()), SLOT(clearAllEditings()));
451 
452 // if (session_->isAttr(SgVlbiSessionInfo::Attr_FF_ION_C_CALCULATED))
454  ionoC_->setEnabled(false);
455  else
456  iono0_->setEnabled(false);
457  //
459  //
460 // if (isImpossibleUpdateCat_)
461 // save->setEnabled(false);
462  isWidgetsBlocked_ = false;
463  widgets2Block_ << ok << process << ionoC_ << iono0_ << dapCB << rmOut << scanAmbigs_ << save
464  << s2add0;
465  // << cancel << clcF1 << rprt;
466  // set actual values:
467  setup.setLnfsFileName(fileName);
468  setup.setLnfsOriginType(oType);
470 
471  QShortcut *shCut;
472 
473  // These are still alt's:
474  shCut = new QShortcut(QKeySequence(tr("Alt+2")), this);
475  connect(shCut, SIGNAL(activated()), this, SLOT(process_2times()));
476  shCut = new QShortcut(QKeySequence(tr("Alt+3")), this);
477  connect(shCut, SIGNAL(activated()), this, SLOT(process_3times()));
478  shCut = new QShortcut(QKeySequence(tr("Alt+4")), this);
479  connect(shCut, SIGNAL(activated()), this, SLOT(process_4macro()));
480 
481  //
482  shCut = new QShortcut(QKeySequence(tr("Ctrl+a")), this);
483  connect(shCut, SIGNAL(activated()), this, SLOT(generateAposterioriFiles()));
484 
485  shCut = new QShortcut(QKeySequence(tr("Ctrl+g")), this);
486  connect(shCut, SIGNAL(activated()), this, SLOT(putDataToAgv()));
487 
488  shCut = new QShortcut(QKeySequence(tr("Ctrl+h")), this);
489  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport4StcPars()));
490 
491  shCut = new QShortcut(QKeySequence(tr("Ctrl+i")), this);
492  connect(shCut, SIGNAL(activated()), this, SLOT(displayExcludedObs()));
493 
494  shCut = new QShortcut(QKeySequence(tr("Ctrl+m")), this);
495  connect(shCut, SIGNAL(activated()), this, SLOT(makeMyAction()));
496 
497  shCut = new QShortcut(QKeySequence(tr("Ctrl+n")), this);
498  connect(shCut, SIGNAL(activated()), this, SLOT(exportDataToNgs()));
499 
500  shCut = new QShortcut(QKeySequence(tr("Ctrl+r")), this);
501  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport()));
502 
503  shCut = new QShortcut(QKeySequence(tr("Ctrl+Shift+r")), this); //
504  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport_Extended())); // mostly for tests
505 
506  shCut = new QShortcut(QKeySequence(tr("Ctrl+s")), this);
507  connect(shCut, SIGNAL(activated()), this, SLOT(saveIntermediateResults()));
508 
509  shCut = new QShortcut(QKeySequence(tr("Ctrl+t")), this);
510  connect(shCut, SIGNAL(activated()), this, SLOT(executeTestAction()));
511 
512  shCut = new QShortcut(QKeySequence(tr("Ctrl+z")), this);
513  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport4Tzds()));
514 };
515 
516 
517 
518 //
520 {
521  // restore overwritten configs:
523  {
539  };
540  //
541 
542 // while (!plotCarriers4Baselines_.isEmpty())
543 // delete plotCarriers4Baselines_.takeFirst();
544  for (int i=0; i<plotCarriers4Baselines_.size(); i++)
545  delete plotCarriers4Baselines_.at(i);
546  plotCarriers4Baselines_.clear();
547 
549  {
550  delete plotCarrier4Stations_;
551  plotCarrier4Stations_ = NULL;
552  };
553 
555  {
556  delete plotCarrier4Session_;
557  plotCarrier4Session_ = NULL;
558  };
559 
560  setup.setSeWinWidth(width());
561  setup.setSeWinHeight(height());
562 };
563 
564 
565 
566 
567 // non-GUI and NsSessionHandler's reloads:
568 //
569 //
570 //
572 {
574 };
575 
576 
577 
578 //
580 {
582 };
583 
584 
585 
586 //
588 {
590 };
591 
592 
593 
594 //
596 {
598 };
599 
600 
601 
602 //
604 {
606 };
607 
608 
609 
610 //
612 {
614 };
615 
616 
617 
618 //
620 {
621  blockInput();
623  restoreInput();
624 };
625 
626 
627 
628 //
630 {
631  blockInput();
633  restoreInput();
634 };
635 
636 
637 
638 //
640 {
641  bool isOk;
642 
643  blockInput();
645  if (isOk)
646  postSave();
647  restoreInput();
648 
649  if (!isOk && saveStatus_==SS_FILE_EXISTS)
650  QMessageBox::warning(this, "Warning", "The database with the new version "
651  "already exists in the catalog.\nRemove it from the catalog and try again.");
652 
653  return isOk;
654 };
655 
656 
657 
658 //
660 {
661  //
662  bool isOk;
663 
664  blockInput();
666  if (isOk)
667  postSave();
668  restoreInput();
669 
670  return isOk;
671 };
672 
673 
674 
675 //
677 {
678  if (config_->getIsNoviceUser() &&
679  QMessageBox::warning(this, "Novice User Warning", "Do you want to save data?",
680  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
681  return;
682 
683  bool isOk(false);
684  //
686  isOk = exportDataIntoDbh();
687  else if (oType_ == SgVlbiSessionInfo::OT_VDB)
688  isOk = exportDataIntoVgosDb();
689  else if (oType_ == SgVlbiSessionInfo::OT_AGV) // export data in vgosDb format:
690  isOk = exportDataIntoVgosDb();
691  else
692  {
694  "::saveData(): unrecognized type of data");
695  return;
696  };
697  //
698  if (isOk &&
700  {
701  generateReport();
704  };
705 };
706 
707 
708 
709 //
711 {
712  if (saveStatus_ == SS_OK) // was already saved:
713  {
714  if (QMessageBox::warning(this, "Warning",
715  "This session already has been saved. "
716  "Do you want to save the session as a new version?",
717  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
718  return false;
719  };
720  //
721  if (!config_->getIsNoviceUser())
722  return true;
723  //
724  // help to new user:
725 // if (!session_->isAttr(SgVlbiSessionInfo::Attr_FF_ION_C_CALCULATED))
727  {
728  if (QMessageBox::warning(this, "Novice User Warning",
729  "No ionosphere corrections evaluated for the session. "
730  "Do you want to save the session anyway?",
731  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
732  return false;
733  };
735  {
736  if (QMessageBox::warning(this, "Novice User Warning",
737  "No additional weights were calculated for the session. "
738  "Do you want to save the session anyway?",
739  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
740  return false;
741  };
742  return true;
743 };
744 
745 
746 
747 //
749 {
750  isNeed2SaveSir_ = false;
751  // remove the file with intermediate results:
752  QString dirName=setup.path2(setup.getPath2IntermediateResults());
753  QDir d(dirName);
754  if (!d.exists())
755  return;
756  if (dirName.size()>0)
757  dirName += "/";
758  QFile file(dirName + session_->name4SirFile(setup.getHave2UpdateCatalog()));
759  if (file.exists())
760  file.remove();
764 };
765 
766 
767 
768 
769 // sess edit dialog's and GUI stuff:
770 //
771 //
773 {
775  QMessageBox::warning(this, "Warning", "There are unsaved data. Are you sure to close the window?",
776  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
777  return;
778 
779  //
780  // save intermediate results:
783  //
784 
785  QDialog::accept();
787  ": accept selected");
788  deleteLater();
789 };
790 
791 
792 
793 //
795 {
797  QMessageBox::warning(this, "Warning", "There are unsaved data. Are you sure to close the window?",
798  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
799  return;
800  //
801  // save intermediate results:
804  //
805  QDialog::reject();
807  ": reject selected");
808  deleteLater();
809 };
810 
811 
812 
813 //
815 {
816  if (!isWidgetsBlocked_)
817  {
818  isWidgetsBlocked_ = true;
819  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
820  for (int i=0; i<widgets2Block_.size(); i++)
821  widgets2Block_.at(i)->blockSignals(isWidgetsBlocked_);
822  };
823 };
824 
825 
826 
827 //
829 {
830  if (isWidgetsBlocked_)
831  {
832  isWidgetsBlocked_ = false;
833  QApplication::restoreOverrideCursor();
834  for (int i=0; i<widgets2Block_.size(); i++)
835  widgets2Block_.at(i)->blockSignals(isWidgetsBlocked_);
836  };
837 };
838 
839 
840 
841 //
843 {
844  QString str;
845  QWidget *w = new QWidget(this);
846  QBoxLayout *layout = new QHBoxLayout(w);
847  QLabel *label;
848  QGridLayout *grid;
849  QGroupBox *gbox;
850  QBoxLayout *subLayout;
851 
852  subLayout = new QVBoxLayout;
853  layout->addLayout(subLayout);
854 
855  // attributes:
856  gbox = new QGroupBox("Attributes of the session", w);
857  grid = new QGridLayout(gbox);
858 
859  label = new QLabel("Type of import file(s):", gbox);
860  label->setMinimumSize(label->sizeHint());
861  grid->addWidget(label, 0,0);
862  switch(session_->getOriginType())
863  {
865  str = "Mk-III database";
866  break;
868  str = "NGS cards";
869  break;
871  str = "vgosDB tree";
872  break;
874  str = "Mk4 correlator files";
875  break;
877  str = "KOMB correlator files";
878  break;
880  str = "VDA file";
881  break;
883  str = "unknown";
884  break;
885  };
886  label = new QLabel(str, gbox);
887  label->setMinimumSize(label->sizeHint());
888  grid->addWidget(label, 0,1);
889 
890  if (session_->getOfficialName().size()) // v01:
891  {
892  label = new QLabel("Official Name/Code:", gbox);
893  label->setMinimumSize(label->sizeHint());
894  grid->addWidget(label, 1,0);
895  label = new QLabel(session_->getOfficialName() + "/" + session_->getSessionCode(), gbox);
896  label->setMinimumSize(label->sizeHint());
897  grid->addWidget(label, 1,1);
898  }
899  else //v02:
900  {
901  label = new QLabel("Network Type/Code:", gbox);
902  label->setMinimumSize(label->sizeHint());
903  grid->addWidget(label, 1,0);
904  label = new QLabel(session_->getSessionType() + "/" + session_->getSessionCode(), gbox);
905  label->setMinimumSize(label->sizeHint());
906  grid->addWidget(label, 1,1);
907  };
908 
909  label = new QLabel("Experiment description:", gbox);
910  label->setMinimumSize(label->sizeHint());
911  grid->addWidget(label, 2,0);
912  str = session_->getDescription().simplified();
913  label = new QLabel(str!=""?str:QString(" "), gbox);
914  label->setMinimumSize(label->sizeHint());
915  grid->addWidget(label, 2,1);
916 
917  label = new QLabel("The session was scheduled at:", gbox);
918  label->setMinimumSize(label->sizeHint());
919  grid->addWidget(label, 3,0);
920  label = new QLabel(session_->getSchedulerName(), gbox);
921  label->setMinimumSize(label->sizeHint());
922  grid->addWidget(label, 3,1);
923 
924  label = new QLabel("Correlated by:", gbox);
925  label->setMinimumSize(label->sizeHint());
926  grid->addWidget(label, 4,0);
927  label = new QLabel(session_->getCorrelatorName(), gbox);
928  label->setMinimumSize(label->sizeHint());
929  grid->addWidget(label, 4,1);
930 
931  label = new QLabel("Responsibility of:", gbox);
932  label->setMinimumSize(label->sizeHint());
933  grid->addWidget(label, 5,0);
934  label = new QLabel(session_->getSubmitterName(), gbox);
935  label->setMinimumSize(label->sizeHint());
936  grid->addWidget(label, 5,1);
937 
938  label = new QLabel("Latest version created on:", gbox);
939  label->setMinimumSize(label->sizeHint());
940  grid->addWidget(label, 6,0);
941  label = new QLabel(session_->getTCreation().toString(SgMJD::F_Verbose), gbox);
942  label->setMinimumSize(label->sizeHint());
943  grid->addWidget(label, 6,1);
944 
945  label = new QLabel("Network ID:", gbox);
946  label->setMinimumSize(label->sizeHint());
947  grid->addWidget(label, 7,0);
948  QComboBox *cbNetID=new QComboBox(gbox);
949  // cbNetID->setInsertPolicy(QComboBox::InsertAtBottom);
950  cbNetID->setInsertPolicy(QComboBox::InsertAlphabetically);
951 
952  bool isTmp(false);
953  for (int i=0; i<networks.size(); i++)
954  {
955  cbNetID->addItem(networks.at(i).getName());
956  if (networks.at(i).getName() == session_->getNetworkID())
957  {
958  cbNetID->setCurrentIndex(i);
959  isTmp = true;
960  };
961  };
962  if (!isTmp) // a net ID from the session (default):
963  {
964  cbNetID->addItem(session_->getNetworkID());
965  cbNetID->setCurrentIndex(cbNetID->count() - 1);
966  };
967  cbNetID->setMinimumSize(cbNetID->sizeHint());
968  grid->addWidget(cbNetID, 7,1);
969  connect(cbNetID,
970  SIGNAL(currentIndexChanged(const QString&)), SLOT(netIdCurrentIndexChanged(const QString&)));
971  //
972 
973 
974 
975  label = new QLabel("Epoch of the first observation:", gbox);
976  label->setMinimumSize(label->sizeHint());
977  grid->addWidget(label, 8,0);
978  label = new QLabel(session_->getTStart().toString(SgMJD::F_Verbose), gbox);
979  label->setMinimumSize(label->sizeHint());
980  grid->addWidget(label, 8,1);
981 
982  label = new QLabel("Epoch of the last observation:", gbox);
983  label->setMinimumSize(label->sizeHint());
984  grid->addWidget(label, 9,0);
985  label = new QLabel(session_->getTFinis().toString(SgMJD::F_Verbose), gbox);
986  label->setMinimumSize(label->sizeHint());
987  grid->addWidget(label, 9,1);
988 
989  label = new QLabel("Mean epoch of observations:", gbox);
990  label->setMinimumSize(label->sizeHint());
991  grid->addWidget(label, 10,0);
992  label = new QLabel(session_->getTMean().toString(SgMJD::F_Verbose), gbox);
993  label->setMinimumSize(label->sizeHint());
994  grid->addWidget(label, 10,1);
995 
996  label = new QLabel("Reference epoch:", gbox);
997  label->setMinimumSize(label->sizeHint());
998  grid->addWidget(label, 11,0);
999  label = new QLabel(session_->tRefer().toString(SgMJD::F_Verbose), gbox);
1000  label->setMinimumSize(label->sizeHint());
1001  grid->addWidget(label, 11,1);
1002 
1003  label = new QLabel("Interval of observations:", gbox);
1004  label->setMinimumSize(label->sizeHint());
1005  grid->addWidget(label, 12,0);
1006  label = new QLabel(interval2Str(session_->getTFinis() - session_->getTStart()), gbox);
1007  label->setMinimumSize(label->sizeHint());
1008  grid->addWidget(label, 12,1);
1009 
1010  label = new QLabel("Last modified on:", gbox);
1011  label->setMinimumSize(label->sizeHint());
1012  grid->addWidget(label, 13,0);
1013  label = new QLabel(session_->getLastProcessed().toString(SgMJD::F_Verbose), gbox);
1014  label->setMinimumSize(label->sizeHint());
1015  grid->addWidget(label, 13,1);
1016 
1017 
1018  subLayout->addWidget(gbox);
1019 
1020 
1021  // parameters:
1022  gbox = new QGroupBox("Parameters", w);
1023  grid = new QGridLayout(gbox);
1024 
1025  label = new QLabel("User Flag:", gbox);
1026  label->setMinimumSize(label->sizeHint());
1027  grid->addWidget(label, 0,0);
1028 
1029  QComboBox *userFlag = new QComboBox(gbox);
1030  userFlag->setInsertPolicy(QComboBox::InsertAtBottom);
1031 
1032  const char* sUFlags[] =
1033  {
1034  "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
1035  "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
1036  };
1037  for (int i=0; i<(int)(sizeof(sUFlags)/sizeof(const char*)); i++)
1038  {
1039  userFlag->addItem(sUFlags[i]);
1040  if (sUFlags[i] == session_->getUserFlag())
1041  userFlag->setCurrentIndex(i);
1042  };
1043  userFlag->setMinimumSize(userFlag->sizeHint());
1044  grid->addWidget(userFlag, 0,1);
1045  subLayout->addWidget(gbox);
1046 
1047  // bands:
1048  gbox = new QGroupBox("Bands", w);
1049  grid = new QGridLayout(gbox);
1050 
1051  label = new QLabel("<b>ID</b>", gbox);
1052  label->setAlignment(Qt::AlignCenter);
1053  grid->addWidget(label, 0, 0);
1054  //
1055  label = new QLabel("<b>Freq</b>", gbox);
1056  label->setAlignment(Qt::AlignCenter);
1057  grid->addWidget(label, 0, 1);
1058  //
1059 
1060 /*
1061  label = new QLabel("<b>Prime</b>", gbox);
1062  label->setAlignment(Qt::AlignCenter);
1063  grid->addWidget(label, 0, 2);
1064 */
1065 // label = new QLabel("<b>Omit</b>", gbox);
1066 // label->setAlignment(Qt::AlignCenter);
1067 // grid->addWidget(label, 0, 3);
1068 
1069  //
1070  label = new QLabel("<b>Ver</b>", gbox);
1071  label->setAlignment(Qt::AlignCenter);
1072  grid->addWidget(label, 0, 2);
1073  //
1074  label = new QLabel("<b>File</b>", gbox);
1075  label->setAlignment(Qt::AlignCenter);
1076  grid->addWidget(label, 0, 3);
1077  //
1078  label = new QLabel("<b>Created on</b>", gbox);
1079  label->setAlignment(Qt::AlignCenter);
1080  grid->addWidget(label, 0, 4);
1081  //
1082  label = new QLabel("<b>CALC ver</b>", gbox);
1083  label->setAlignment(Qt::AlignCenter);
1084  grid->addWidget(label, 0, 5);
1085  //
1086  label = new QLabel("<b>#Total/Used</b>", gbox);
1087  label->setAlignment(Qt::AlignCenter);
1088  grid->addWidget(label, 0, 6);
1089  //
1090 // label = new QLabel("<b>#Used</b>", gbox);
1091 // label->setAlignment(Qt::AlignCenter);
1092 // grid->addWidget(label, 0, 8);
1093 
1094  //
1095  label = new QLabel("<b>#Par/#C</b>", gbox);
1096  label->setAlignment(Qt::AlignCenter);
1097  grid->addWidget(label, 0, 7);
1098 
1099 
1100  //
1101  label = new QLabel("<b>WRMS</b>(ps)", gbox);
1102  label->setAlignment(Qt::AlignCenter);
1103  grid->addWidget(label, 0, 8);
1104  //
1105  label = new QLabel("<p><b>&sigma;<sub>0</sub><b></p>", gbox);
1106  label->setAlignment(Qt::AlignCenter);
1107  grid->addWidget(label, 0, 9);
1108  //
1109  label = new QLabel("<p><b>&chi;<sup>2</sup><b></p>", gbox);
1110  label->setAlignment(Qt::AlignCenter);
1111  grid->addWidget(label, 0, 10);
1112 
1113 /*
1114  QButtonGroup *bgPrimaryBands = new QButtonGroup(gbox);
1115  QRadioButton *rbPrimaryBand = NULL;
1116 */
1117 
1118 // QCheckBox *cbIgnore = NULL;
1119  for (int i=0; i<session_->numberOfBands(); i++)
1120  {
1121  SgVlbiBand* band=session_->bands().at(i);
1122 
1123  label = new QLabel(band->getKey(), gbox);
1124  label->setAlignment(Qt::AlignCenter);
1125  grid->addWidget(label, 1+i, 0);
1126  //
1127  label = new QLabel(str.sprintf("%6.1f", band->getFrequency()), gbox);
1128  label->setAlignment(Qt::AlignRight);
1129  grid->addWidget(label, 1+i, 1);
1130  //
1131 /*
1132  rbPrimaryBand = new QRadioButton(gbox);
1133  bgPrimaryBands->addButton(rbPrimaryBand, i);
1134  if (band->isAttr(SgVlbiBand::Attr_PRIMARY))
1135  rbPrimaryBand->setChecked(true);
1136  grid->addWidget(rbPrimaryBand, 1+i, 2);
1137 */
1138 
1139 
1140  //
1141 // cbIgnore = new QCheckBox(this);
1142 // if (band->isAttr(SgVlbiBand::Attr_NOT_VALID))
1143 // cbIgnore->setChecked(true);
1144 // grid->addWidget(cbIgnore, 1+i, 3);
1145  //
1146  label = new QLabel(str.sprintf("%3d", band->getInputFileVersion()), gbox);
1147  label->setAlignment(Qt::AlignCenter);
1148  grid->addWidget(label, 1+i, 2);
1149  //
1150  label = new QLabel(band->getInputFileName(), gbox);
1151  label->setAlignment(Qt::AlignCenter);
1152  grid->addWidget(label, 1+i, 3);
1153  //
1154  label = new QLabel(band->getTCreation().toString(SgMJD::F_Simple), gbox);
1155  label->setAlignment(Qt::AlignCenter);
1156  grid->addWidget(label, 1+i, 4);
1157  //
1158  label = new QLabel(str.sprintf("%g", session_->calcInfo().getDversion()), gbox);
1159  label->setAlignment(Qt::AlignCenter);
1160  grid->addWidget(label, 1+i, 5);
1161  //
1162  label = new QLabel(str.sprintf("%3d/%3d",
1163  band->observables().count(), band->numProcessed(DT_DELAY)), gbox);
1164  labelsPrc_.append(label);
1165  label->setAlignment(Qt::AlignCenter);
1166  grid->addWidget(label, 1+i, 6);
1167  //
1168 // label = new QLabel(str.sprintf("%3d", band->getNumOfProcessedObs()), gbox);
1169 // labelsPrc_.append(label);
1170 // label->setAlignment(Qt::AlignCenter);
1171 // grid->addWidget(label, 1+i, 8);
1172  //
1173  label = new QLabel(str.sprintf("%d/%d",
1175  labelsPar_.append(label);
1176  label->setAlignment(Qt::AlignCenter);
1177  grid->addWidget(label, 1+i, 7);
1178  //
1179  label = new QLabel(str.sprintf("%.1f", band->wrms(DT_DELAY)*scale4Delay_*1.0E3), gbox);
1180  labelsWRMS_.append(label);
1181  label->setAlignment(Qt::AlignCenter);
1182  grid->addWidget(label, 1+i, 8);
1183  //
1184  label = new QLabel(str.sprintf("%.1f", band->getSigma2add(DT_DELAY)*scale4Delay_*1.0E3), gbox);
1185  labelsSig0_.append(label);
1186  label->setAlignment(Qt::AlignCenter);
1187  grid->addWidget(label, 1+i, 9);
1188  //
1189  label = new QLabel(str.sprintf("%.2f",
1190  session_->getNumOfDOF()>0.0?band->chi2(DT_DELAY)/session_->getNumOfDOF():0.0), gbox);
1191  labelsChi2_.append(label);
1192  label->setAlignment(Qt::AlignCenter);
1193  grid->addWidget(label, 1+i, 10);
1194  };
1195  grid->setHorizontalSpacing(grid->horizontalSpacing() + 20);
1196  subLayout->addWidget(gbox);
1197  subLayout->addStretch(1);
1198  layout->addStretch(5);
1199  //
1200 
1201 /*
1202  connect(bgPrimaryBands, SIGNAL(buttonClicked(int)), SLOT(changePrimaryBand(int)));
1203 */
1204 
1205  //
1206  return w;
1207 };
1208 
1209 
1210 
1211 //
1213 {
1214  session_->setNetworkID(str);
1216  ": netIdCurrentIndexChanged(): the networkID of the session has been changed to `" + str + "'");
1217 };
1218 
1219 
1220 
1221 //
1223 {
1225  connect(this, SIGNAL(activeBandChanged(int)), configWidget_, SLOT(updateActiveBandSelection(int)));
1226  connect(this, SIGNAL(delayTypeChanged(int)), configWidget_, SLOT(updateDelayTypeSelection(int)));
1227  connect(configWidget_, SIGNAL(delayTypeModified(SgTaskConfig::VlbiDelayType)),
1229 
1230  connect(configWidget_, SIGNAL(clocksModelChanged(SgParameterCfg::PMode)),
1232  connect(configWidget_, SIGNAL(zenithModelChanged(SgParameterCfg::PMode)),
1234 
1235  return configWidget_;
1236 };
1237 
1238 
1239 
1240 //
1242 {
1243  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
1244  it!=session_->stationsByName().end(); ++it)
1245  {
1246  SgVlbiStationInfo *si=it.value();
1247  si->pcClocks()->setPMode(mode);
1248  };
1249 };
1250 
1251 
1252 
1253 //
1255 {
1256  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
1257  it!=session_->stationsByName().end(); ++it)
1258  {
1259  SgVlbiStationInfo *si=it.value();
1260  si->pcZenith()->setPMode(mode);
1261  };
1262 };
1263 
1264 
1265 
1266 //
1268 {
1269  QTabWidget *w = new QTabWidget(this);
1270 // w->setTabPosition(QTabWidget::South);
1271  w->setTabPosition(QTabWidget::East);
1272  for (int i=0; i<session_->numberOfBands(); i++)
1273  {
1274  w->addTab(tab4Band(session_->bands().at(i)), session_->bands().at(i)->getKey() + "-Band");
1275  };
1276  connect(w, SIGNAL(currentChanged(int)), this, SLOT(changeActiveBand(int)));
1277  connect(configWidget_, SIGNAL(activeBandModified(int)), w, SLOT(setCurrentIndex(int)));
1278  return w;
1279 };
1280 
1281 
1282 
1283 //
1285 {
1286  SgGuiVlbiStationList *stnInfoList;
1287  SgGuiVlbiSourceList *srcInfoList;
1288  SgGuiVlbiBaselineList *baselineInfoList;
1289 
1290  QTabWidget *w = new QTabWidget(this);
1291  w->setTabPosition(QTabWidget::South);
1292  w->addTab(tab4BandPlots(band), "Data");
1293  stnInfoList = new SgGuiVlbiStationList(OBM_BAND, band->getKey(), &band->stationsByName(),
1294  session_->getTStart(), this);
1295  srcInfoList = new SgGuiVlbiSourceList(OBM_BAND, band->getKey(), &band->sourcesByName(), this);
1296  baselineInfoList = new SgGuiVlbiBaselineList(session_, config_, OBM_BAND, &band->baselinesByName(),
1297  this);
1298  w->addTab(stnInfoList, "Stations");
1299  w->addTab(srcInfoList, "Sources");
1300  w->addTab(baselineInfoList, "Baselines");
1301  w->addTab(new SgGuiVlbiHistory(&band->history(), this), "History");
1302 // stnInfoList->setWrmsScale(scale4Delay_*1.0E3);
1303 // srcInfoList->setWrmsScale(scale4Delay_*1.0E3);
1304 // baselineInfoList->setWrmsScale(scale4Delay_*1.0E3);
1305  connect(this, SIGNAL(dataChanged()), stnInfoList, SLOT(updateContent()));
1306  connect(this, SIGNAL(dataChanged()), srcInfoList, SLOT(updateContent()));
1307  connect(this, SIGNAL(dataChanged()), baselineInfoList, SLOT(updateContent()));
1308  return w;
1309 };
1310 
1311 
1312 
1313 //
1315 {
1316  QList<SgVlbiObservable*> *observables=NULL;
1317  QString title("");
1318  QString str("");
1319  title = band->getKey() + "-band of the session " + session_->getName() + ", baselines";
1320 
1321  SgPlotCarrier* carrier = new SgPlotCarrier( 33, 11, title);
1322 
1323  plotCarriers4Baselines_.append(carrier);
1324  str = title + " (group delay ambig.spacing: " + band->strGrdAmbigsStat() + " [ns])";
1325  carrier->setName(str, BPI_RES_GRD);
1326  carrier->setName(str, BPI_GR_DELAY);
1327  carrier->setName(str, BPI_ION_GRD);
1328  carrier->setName(str, BPI_AMBIG_GR_SPACING);
1329  carrier->setName(str, BPI_AMBIG_GR_NUMBER);
1330  str = title + " (phase delay ambig.spacing: " + band->strPhdAmbigsStat() + " [ns])";
1331  carrier->setName(str, BPI_RES_PHD);
1332  carrier->setName(str, BPI_ION_PHD);
1333  carrier->setName(str, BPI_AMBIG_PH_SPACING);
1334  carrier->setName(str, BPI_AMBIG_PH_NUMBER);
1335 
1336  carrier->setFile2SaveBaseName(session_->getName() + "_baselines_" + band->getKey() + "-band");
1337 
1338  // names of columns:
1339  // epoch:
1340  carrier->setNameOfColumn(BPI_EPOCH, "Time (UTC)");
1342  // values:
1343  carrier->setNameOfColumn(BPI_RES_SBD, "Res: SB delay, ns");
1344  carrier->setNameOfColumn(BPI_RES_GRD, "Res: GR delay, ns");
1345  carrier->setNameOfColumn(BPI_RES_PHD, "Res: PH delay, ns");
1346  carrier->setNameOfColumn(BPI_RES_PHR, "Res: PH rate, fs/s");
1347  carrier->setNameOfColumn(BPI_GR_DELAY, "Group delay, ns");
1348  carrier->setNameOfColumn(BPI_PH_RATE, "Delay rate, fs/s");
1349  carrier->setNameOfColumn(BPI_ION_SBD, "Iono SB delay, ns");
1350  carrier->setNameOfColumn(BPI_ION_GRD, "Iono GR delay, ns");
1351  carrier->setNameOfColumn(BPI_ION_PHD, "Iono PH delay, ns");
1352  carrier->setNameOfColumn(BPI_ION_PHR, "Iono PH rate, fs/s");
1353  carrier->setNameOfColumn(BPI_ION_DTEC, "Iono dTEK");
1354  carrier->setNameOfColumn(BPI_CORR_COEF, "Corr.Coeff.");
1355  carrier->setNameOfColumn(BPI_SNR, "SNR");
1356  // sigmas:
1357  carrier->setNameOfColumn(BPI_SIG_SBD, "Sigma of SB delay, ns");
1358  carrier->setNameOfColumn(BPI_SIG_GRD, "Sigma of GR delay, ns");
1359  carrier->setNameOfColumn(BPI_SIG_DEL_APPLIED, "Applied GR delay sigma, ns");
1360  carrier->setNameOfColumn(BPI_SIG_RAT_APPLIED, "Applied PH rate sigma, fs/s");
1361  carrier->setNameOfColumn(BPI_SIG_PHR, "Sigma of delay rate, fs/s");
1362  carrier->setNameOfColumn(BPI_SIG_PHD, "Sigma of PH delay, ns");
1363  carrier->setNameOfColumn(BPI_SIG_ION_SBD, "Sigma of Iono SB delay, ns");
1364  carrier->setNameOfColumn(BPI_SIG_ION_GRD, "Sigma of Iono GR delay, ns");
1365  carrier->setNameOfColumn(BPI_SIG_ION_PHD, "Sigma of Iono PH delay, ns");
1366  carrier->setNameOfColumn(BPI_SIG_ION_PHR, "Sigma of Iono PH rate, fs/s");
1367  carrier->setNameOfColumn(BPI_SIG_ION_DTEC, "Sigma of Iono dTEK");
1368  //
1369  carrier->setNameOfColumn(BPI_RES_NORM_DEL, "Normalized delay residuals");
1370  carrier->setNameOfColumn(BPI_RES_NORM_RAT, "Normalized rate residuals");
1371  carrier->setNameOfColumn(BPI_AMBIG_GR_SPACING,"Ambig GR spacing, ns");
1372  carrier->setNameOfColumn(BPI_AMBIG_GR_NUMBER, "Ambig GR #");
1373  carrier->setNameOfColumn(BPI_AMBIG_PH_SPACING,"Ambig PH spacing, ns");
1374  carrier->setNameOfColumn(BPI_AMBIG_PH_NUMBER, "Ambig PH #");
1375 
1376  carrier->setNameOfColumn(BPI_EFF_FRQ_GRD, "GR Eff Freq, MHZ");
1377  carrier->setNameOfColumn(BPI_EFF_FRQ_PHD, "PH Eff Freq, MHZ");
1378  carrier->setNameOfColumn(BPI_EFF_FRQ_PHR, "RT Eff Freq, MHZ");
1379  //
1380  //carrier->setNameOfColumn(BPI_S_DIFF, "sDiff");
1381  //carrier->setNameOfColumn(BPI_X_DIFF, "xDiff");
1382  //carrier->setNameOfColumn(BPI_R_DIFF, "rDiff");
1383  //carrier->setNameOfColumn(BPI_GRD_SBD, "GRD-SBD");
1384  //carrier->setNameOfColumn(BPI_Q_SBD, "qSBD");
1385  //carrier->setNameOfColumn(BPI_Q_GRD, "qGRD");
1386  //carrier->setNameOfColumn(BPI_Q_PHR, "qPHR");
1387  //carrier->setNameOfColumn(BPI_CLK_1, "ClcF#1");
1388  //carrier->setNameOfColumn(BPI_CLK_1L, "ClcF#1_left");
1389  //carrier->setNameOfColumn(BPI_CLK_1R, "ClcF#1_right");
1390  carrier->setNameOfColumn(BPI_QF, "QF");
1391  carrier->setNameOfColumn(BPI_FEC, "Frng Error Code");
1392  carrier->setNameOfColumn(BPI_PCAL_GR_DEL_1, "PCal:GrDel@1");
1393  carrier->setNameOfColumn(BPI_PCAL_PH_DEL_1, "PCal:PhDel@1");
1394  carrier->setNameOfColumn(BPI_PCAL_GR_DEL_2, "PCal:GrDel@2");
1395  carrier->setNameOfColumn(BPI_PCAL_PH_DEL_2, "PCal:PhDel@2");
1396  carrier->setNameOfColumn(BPI_U, "U");
1397  carrier->setNameOfColumn(BPI_V, "V");
1398  carrier->setNameOfColumn(BPI_TAUS, "tauS, ns");
1399  carrier->setNameOfColumn(BPI_TEST, "Test");
1400 
1401  // set up sigmas:
1413 
1414  // create branches and fill data:
1415  carrier->listOfBranches()->clear();
1416  title = band->getKey() + "-band of the session " + session_->getName() + "; ";
1417  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
1418  for (; it!=band->baselinesByName().constEnd(); ++it)
1419  {
1420  SgVlbiBaselineInfo *baselineInfo=it.value();
1421  observables = &baselineInfo->observables();
1422  carrier->createBranch(observables->size(), baselineInfo->getKey(), true);
1423  SgPlotBranch *branch=carrier->listOfBranches()->last();
1424  //
1425  // group delays ambigs info:
1426  str = title + baselineInfo->getKey() + " (ambig. spacing: " +
1427  baselineInfo->strGrdAmbigsStat() + " [ns])";
1428  branch->setAlternativeTitleName(str, BPI_RES_GRD);
1429  branch->setAlternativeTitleName(str, BPI_GR_DELAY);
1432  // phase delays ambigs info:
1433  str = title + baselineInfo->getKey() + " (ambig. spacing: " +
1434  baselineInfo->strPhdAmbigsStat() + " [ns])";
1435  branch->setAlternativeTitleName(str, BPI_RES_PHD);
1438 
1439  //
1440  QList<SgVlbiObservable*>::const_iterator jt=observables->constBegin();
1441  for (int idx=0; jt!=observables->constEnd(); ++jt, idx++)
1442  {
1443  SgVlbiObservable *o=*jt;
1444  //
1446  {
1449  else
1451  if (o->isUsable())
1453  else
1455  };
1456  //
1457  // epoch:
1458  branch->data()->setElement(idx, BPI_EPOCH, o->epoch().toDouble());
1459  // residuals:
1460  branch->data()->setElement(idx, BPI_RES_SBD, o->sbDelay().getResidual()*scale4Delay_);
1461  branch->data()->setElement(idx, BPI_RES_GRD, o->grDelay().getResidual()*scale4Delay_);
1462  branch->data()->setElement(idx, BPI_RES_PHD, o->phDelay().getResidual()*scale4Delay_);
1463  branch->data()->setElement(idx, BPI_RES_PHR, o->phDRate().getResidual()*scale4Rate_);
1464  // values:
1465  branch->data()->setElement(idx, BPI_GR_DELAY,o->grDelay().getValue() *scale4Delay_);
1466  branch->data()->setElement(idx, BPI_PH_RATE, o->phDRate().getValue() *scale4Rate_);
1467  // ionospheric corrections:
1468  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
1469  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
1470  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
1471  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
1472  branch->data()->setElement(idx, BPI_ION_DTEC,o->owner()->getDTec());
1473  //
1474  branch->data()->setElement(idx, BPI_CORR_COEF, o->getCorrCoeff());
1475  branch->data()->setElement(idx, BPI_SNR, o->getSnr());
1476  // sigmas:
1477  branch->data()->setElement(idx, BPI_SIG_SBD, o->sbDelay().getSigma()*scale4Delay_);
1478  branch->data()->setElement(idx, BPI_SIG_GRD, o->grDelay().getSigma()*scale4Delay_);
1479  branch->data()->setElement(idx, BPI_SIG_PHD, o->phDelay().getSigma()*scale4Delay_);
1480  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
1482  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
1484  branch->data()->setElement(idx, BPI_SIG_PHR, o->phDRate().getSigma() *scale4Rate_);
1485  // iono's sigmas:
1490  branch->data()->setElement(idx, BPI_SIG_ION_DTEC, o->owner()->getDTecStdDev());
1491  //
1492 // branch->data()->setElement(idx, BPI_NORM_RESID, o->grDelay().getResidualNorm());
1493  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
1494  o->activeDelay()->getResidualNorm():0.0);
1495  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
1496  branch->data()->setElement(idx, BPI_AMBIG_GR_SPACING,
1498  branch->data()->setElement(idx, BPI_AMBIG_GR_NUMBER,
1499  o->grDelay().getNumOfAmbiguities());
1500  branch->data()->setElement(idx, BPI_AMBIG_PH_SPACING,
1502  branch->data()->setElement(idx, BPI_AMBIG_PH_NUMBER,
1503  o->phDelay().getNumOfAmbiguities());
1504  branch->data()->setElement(idx, BPI_EFF_FRQ_GRD, o->grDelay().getEffFreq());
1505  branch->data()->setElement(idx, BPI_EFF_FRQ_PHD, o->phDelay().getEffFreq());
1506  branch->data()->setElement(idx, BPI_EFF_FRQ_PHR, o->phDRate().getEffFreq());
1507 
1508  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
1509  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
1510  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
1511  //branch->data()->setElement(idx, BPI_GRD_SBD, (o->grDelay().getValue() +
1512  // o->grDelay().ambiguity() +
1513  // o->grDelay().getIonoValue() - o->sbDelay().getValue())*scale4Delay_);
1514  //branch->data()->setElement(idx, BPI_Q_SBD, o->getSbdQ());
1515  //branch->data()->setElement(idx, BPI_Q_GRD, o->getGrdQ());
1516  //branch->data()->setElement(idx, BPI_Q_PHR, o->getPhrQ());
1517  //branch->data()->setElement(idx, BPI_CLK_1, o->owner()->getBaselineClock_F1()*scale4Delay_);
1518  //branch->data()->setElement(idx, BPI_CLK_1L, o->owner()->getBaselineClock_F1l()*scale4Delay_);
1519  //branch->data()->setElement(idx, BPI_CLK_1R, o->owner()->getBaselineClock_F1r()*scale4Delay_);
1520  branch->data()->setElement(idx, BPI_QF, o->getQualityFactor());
1521  branch->data()->setElement(idx, BPI_FEC, o->errorCode2Int());
1526  branch->data()->setElement(idx, BPI_U, o->getUvFrPerAsec(0));
1527  branch->data()->setElement(idx, BPI_V, o->getUvFrPerAsec(1));
1528  branch->data()->setElement(idx, BPI_TAUS, o->getTauS()*scale4Delay_);
1529  branch->data()->setElement(idx, BPI_TEST, o->getTest()*scale4Delay_);
1530 
1531  branch->setExtKey(idx, o->src()->getKey());
1532  };
1533  };
1534 
1535  // widgets:
1536  QWidget *w = new QWidget(this);
1537  unsigned int plotterModes;
1540  plotterModes |= SgPlot::PM_EXT_KEY_SELECT;
1541 
1542  SgPlot *plot = new SgPlot(carrier, setup.path2(setup.getPath2PlotterOutput()), w, plotterModes);
1544  //
1545  QList<QString> filters, filtersAux, filtersExt;
1546  QString blNames("");
1547  for (BaselinesByName_it it=session_->baselinesByName().begin();
1548  it!=session_->baselinesByName().end(); ++it)
1549  blNames += it.value()->getKey() + ",";
1550  for (StationsByName_it it=session_->stationsByName().begin();
1551  it!=session_->stationsByName().end(); ++it)
1552  {
1553  filters << it.value()->getKey();
1554  QString key=it.value()->getKey() + ":";
1555  if (blNames.contains(key))
1556  filtersAux << key;
1557  key = ":" + it.value()->getKey();
1558  if (blNames.contains(key))
1559  filtersAux << key;
1560  };
1561  for (SourcesByName_it it=session_->sourcesByName().begin();
1562  it!=session_->sourcesByName().end(); ++it)
1563  filtersExt << it.value()->getKey();
1564  plot->setFilterNames(filters);
1565  plot->setFilterAuxNames(filtersAux);
1566  plot->setFilterExtNames(filtersExt);
1567  //
1568  plots4Baselines_.append(plot);
1569  QBoxLayout *layout = new QVBoxLayout(w);
1570  layout->addWidget(plot);
1571  connect(plot, SIGNAL(userPressedAKey(SgPlot*, Qt::KeyboardModifiers, int)),
1572  SLOT (dispatchUserKey(SgPlot*, Qt::KeyboardModifiers, int)));
1573  connect(plot, SIGNAL(yAxisChanged(int)), SLOT(dispatchChangeOfYAxis(int)));
1574  connect(plot, SIGNAL(pointInfoRequested(SgPlot*, SgPlotBranch*, int, int, int)),
1575  SLOT (displayPointInfo(SgPlot*, SgPlotBranch*, int, int, int)));
1576  return w;
1577 };
1578 
1579 
1580 
1581 //
1583 {
1584  QMap<QString, SgVlbiAuxObservation*> *auxObservationsByScan=NULL;
1585  int numOfIfs = session_->skyFreqByIfId().size();
1586  QList<QString> ifIds=session_->skyFreqByIfId().keys();
1587  QList<double> ifFrqs=session_->skyFreqByIfId().values();
1588 
1589  cableCalsOffset_ = 0;
1590  // check for presence of some data:
1591  bool hasTsyses=false;
1592  bool hasCdms=false;
1593  bool hasPcmt=false;
1594  QMap<QString, SgVlbiStationInfo*>::const_iterator
1595  it=session_->stationsByName().constBegin();
1596  for (; it!=session_->stationsByName().constEnd(); ++it)
1597  {
1598  SgVlbiStationInfo *si=it.value();
1599 
1601  hasTsyses = true;
1603  hasCdms = true;
1605  hasPcmt = true;
1606  };
1607  if (!hasTsyses)
1608  numOfIfs = 0;
1609  //
1610  //
1611  if (hasCdms || hasPcmt)
1612  cableCalsOffset_ = 3;
1613  //
1614  plotCarrier4Stations_ = new SgPlotCarrier( 14 + numOfIfs + cableCalsOffset_, 6,
1615  "Plots for the session " + session_->getName() + ", station view");
1617 
1618  // names of columns:
1621  if (hasCdms || hasPcmt)
1622  {
1623  plotCarrier4Stations_->setNameOfColumn(SPI_CABLE_CAL, "Default Cable cal., ps");
1624  plotCarrier4Stations_->setNameOfColumn(SPI_CABLE_CAL + 1, "FS Log Cable cal., ps");
1625  plotCarrier4Stations_->setNameOfColumn(SPI_CABLE_CAL + 2, "CDMS Cable cal., ps");
1626  plotCarrier4Stations_->setNameOfColumn(SPI_CABLE_CAL + 3, "PCMT Cable cal., ps");
1627  }
1628  else
1637 // plotCarrier4Stations_->setNameOfColumn(SPI_EST_WZD, "Est.Zenith, cm");
1642  // sigmas:
1658 
1662  for (int i=0; i<numOfIfs; i++)
1664  "Tsys @IF " + ifIds.at(i) + QString("").sprintf(", %.2fMHz", ifFrqs.at(i)));
1665 
1666 
1667  // create branches and fill data:
1669  for (it=session_->stationsByName().constBegin(); it!=session_->stationsByName().constEnd(); ++it)
1670  {
1671  SgVlbiStationInfo* stationInfo=it.value();
1672  QMap<int, int> frq2if;
1673  for (int i=0; i<ifFrqs.size(); i++)
1674  {
1675  frq2if[i] = -1;
1676  for (int j=0; j<stationInfo->tsysIfFreqs().size(); j++)
1677  if (fabs(ifFrqs.at(i) - stationInfo->tsysIfFreqs().at(j)) < 0.01)
1678  frq2if[i] = j;
1679  };
1680 
1681  auxObservationsByScan = stationInfo->auxObservationByScanId();
1682  plotCarrier4Stations_->createBranch(auxObservationsByScan->size(), stationInfo->getKey());
1684  //
1685  QMap<QString, SgVlbiAuxObservation*>::const_iterator jt=auxObservationsByScan->constBegin();
1686  for (int idx=0; jt!=auxObservationsByScan->constEnd(); ++jt, idx++)
1687  {
1688  SgVlbiAuxObservation *auxObs=jt.value();
1689 
1690  branch->data()->setElement(idx, SPI_EPOCH, auxObs->toDouble());
1691  branch->data()->setElement(idx, SPI_CABLE_CAL, auxObs->getCableCalibration()*1.0e12);
1692  if (hasCdms || hasPcmt)
1693  {
1694  branch->data()->setElement(idx, SPI_CABLE_CAL, auxObs->getCableCalibration()*1.0e12);
1695  branch->data()->setElement(idx, SPI_CABLE_CAL + 1,
1697  branch->data()->setElement(idx, SPI_CABLE_CAL + 2,
1699  branch->data()->setElement(idx, SPI_CABLE_CAL + 3,
1701  }
1702  else
1703  branch->data()->setElement(idx, SPI_CABLE_CAL,
1704  auxObs->getCableCalibration()*1.0e12);
1705 
1706  branch->data()->setElement(idx, SPI_MET_TEMP + cableCalsOffset_,
1707  auxObs->getMeteoData().getTemperature());
1708  branch->data()->setElement(idx, SPI_MET_PRESS + cableCalsOffset_,
1709  auxObs->getMeteoData().getPressure());
1710  branch->data()->setElement(idx, SPI_MET_HUMID + cableCalsOffset_,
1711  auxObs->getMeteoData().getRelativeHumidity()*100.0);
1712  branch->data()->setElement(idx, SPI_AZIMUTH + cableCalsOffset_,
1713  auxObs->getAzimuthAngle()*RAD2DEG);
1714  branch->data()->setElement(idx, SPI_ELEVATION + cableCalsOffset_,
1715  auxObs->getElevationAngle()*RAD2DEG);
1716  branch->data()->setElement(idx, SPI_PARALLACTIC + cableCalsOffset_,
1717  auxObs->getParallacticAngle()*RAD2DEG);
1718  branch->data()->setElement(idx, SPI_EST_CLK + cableCalsOffset_,
1719  auxObs->getEstClocks());
1720  branch->data()->setElement(idx, SPI_EST_WZD + cableCalsOffset_,
1721  auxObs->getEstZenithDelay()*1.0e10/vLight);
1722  branch->data()->setElement(idx, SPI_EST_GRN + cableCalsOffset_,
1723  auxObs->getEstAtmGradN());
1724  branch->data()->setElement(idx, SPI_EST_GRE + cableCalsOffset_,
1725  auxObs->getEstAtmGradE());
1726  branch->data()->setElement(idx, SPI_TOT_ZDEL + cableCalsOffset_,
1727  (auxObs->getZenithDelayH() + auxObs->getZenithDelayW())*100.0 + auxObs->getEstZenithDelay());
1728  branch->data()->setElement(idx, SPI_SIG_EST_CLK + cableCalsOffset_,
1729  auxObs->getEstClocksSigma());
1730  branch->data()->setElement(idx, SPI_SIG_EST_WZD + cableCalsOffset_,
1731  auxObs->getEstZenithDelaySigma()*1.0e10/vLight);
1732  branch->data()->setElement(idx, SPI_SIG_EST_GRN + cableCalsOffset_,
1733  auxObs->getEstAtmGradNSigma());
1734  branch->data()->setElement(idx, SPI_SIG_EST_GRE + cableCalsOffset_,
1735  auxObs->getEstAtmGradESigma());
1737  auxObs->getEstZenithDelaySigma());
1738 
1739  SgVlbiObservation *obs=auxObs->getOwner();
1740  SgVlbiObservable *o=obs?obs->activeObs():NULL;
1741  if (o)
1742  {
1743  branch->data()->setElement(idx, SPI_RES_GRD + cableCalsOffset_,
1744  o->grDelay().getResidual()*scale4Delay_*1.0e3);
1745  branch->data()->setElement(idx, SPI_SIG_GRD + cableCalsOffset_,
1746  o->grDelay().sigma2Apply()*scale4Delay_*1.0e3);
1747  };
1748 
1749  for (int i=0; i<numOfIfs; i++)
1750  if (-1 < frq2if[i])
1751  branch->data()->setElement(idx, SPI_SIG_GRD + cableCalsOffset_ + 1 + i,
1752  auxObs->tSyses()->getElement(frq2if[i]));
1753 // if (auxObs->getElevationAngle()<-9.0)
1754 // branch->addDataAttr(idx, SgPlotCarrier::DataAttr_IGNORE);
1755 // if (auxObs->meteoData().isAttr(SgMeteoData::Attr_ARTIFICIAL_DATA))
1756 // branch->addDataAttr(idx, SgPlotCarrier::DataAttr_IGNORE);
1757  };
1758  };
1759 
1760  // widgets:
1761  QWidget *w = new QWidget(this);
1764  QBoxLayout *layout = new QVBoxLayout(w);
1765  layout->addWidget(plot4Stations_);
1766 
1767  return w;
1768 };
1769 
1770 
1771 
1772 //
1773 //
1775 {
1776  QWidget *w=new QWidget(this);
1777 
1778  plotCarrier4Session_ = new SgPlotCarrier( 4, /*+*/ 3, "Plots for the session " +
1779  session_->getName() + ", session wide data");
1780 
1782 
1783  // names of columns:
1786 
1796 
1797  // create branches and fill data:
1799 
1800  int numOfScans=session_->scanEpochs().size(), idx;
1801  SgMJD t(tZero);
1802 
1803  plotCarrier4Session_->createBranch(numOfScans, "ERP: HF external model");
1805  plotCarrier4Session_->createBranch(numOfScans, "ERP: HF CALC");
1806  SgPlotBranch *branchC=plotCarrier4Session_->listOfBranches()->last();
1807  plotCarrier4Session_->createBranch(numOfScans, "ERP: estimation ARC");
1808  SgPlotBranch *branchA=plotCarrier4Session_->listOfBranches()->last();
1809  plotCarrier4Session_->createBranch(numOfScans, "ERP: estimation PWL");
1810  SgPlotBranch *branchP=plotCarrier4Session_->listOfBranches()->last();
1811  plotCarrier4Session_->createBranch(numOfScans, "ERP: estimation stochastic");
1812  SgPlotBranch *branchS=plotCarrier4Session_->listOfBranches()->last();
1813 
1814  t = tZero;
1815  idx = 0;
1816  for (int i=0; i<session_->observations().size(); i++)
1817  if (t != session_->observations().at(i)->getMJD())
1818  {
1819  SgVlbiObservation *obs=session_->observations().at(i);
1820  t = session_->observations().at(i)->getMJD();
1821  branch->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1822 
1823  branch->data()->setElement(idx, SNI_EST_UT1, obs->getAprioriUt1HfContrib()*DAY2SEC*1.0e3);
1824  branch->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1825  branch->data()->setElement(idx, SNI_EST_PMX, obs->getAprioriPxHfContrib()*RAD2MAS);
1826  branch->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1827  branch->data()->setElement(idx, SNI_EST_PMY, obs->getAprioriPyHfContrib()*RAD2MAS);
1828  branch->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1829 
1830  branchC->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1831  branchC->data()->setElement(idx, SNI_EST_UT1, obs->getCalcHiFyUt1Delay()/obs->getDdel_dUT1() *DAY2SEC*1.0e3);
1832  // there are no LCODES from CALC with Px and Py corrections due to the model.
1833 
1834  branchA->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1835  branchA->data()->setElement(idx, SNI_EST_UT1, 0.0);
1836  branchA->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1837  branchA->data()->setElement(idx, SNI_EST_PMX, 0.0);
1838  branchA->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1839  branchA->data()->setElement(idx, SNI_EST_PMY, 0.0);
1840  branchA->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1842 
1843  branchP->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1844  branchP->data()->setElement(idx, SNI_EST_UT1, 0.0);
1845  branchP->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1846  branchP->data()->setElement(idx, SNI_EST_PMX, 0.0);
1847  branchP->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1848  branchP->data()->setElement(idx, SNI_EST_PMY, 0.0);
1849  branchP->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1851 
1852  branchS->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1853  branchS->data()->setElement(idx, SNI_EST_UT1, 0.0);
1854  branchS->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1855  branchS->data()->setElement(idx, SNI_EST_PMX, 0.0);
1856  branchS->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1857  branchS->data()->setElement(idx, SNI_EST_PMY, 0.0);
1858  branchS->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1860 
1861  idx++;
1862  };
1863 
1864  // widgets:
1867  QBoxLayout *layout=new QVBoxLayout(w);
1868  layout->addWidget(plot4Session_);
1869 
1870  return w;
1871 };
1872 
1873 
1874 
1875 //
1877 {
1878  activeBand_ = idx;
1879  scanAmbigs_->setEnabled(session_->bands().at(activeBand_)->isAttr(SgVlbiBand::Attr_HAS_AMBIGS));
1881  {
1884  };
1885 };
1886 
1887 
1888 
1889 //
1891 {
1892  if (session_)
1893  {
1896  ": changePrimaryBand(): the primary band switched to " + session_->primaryBand()->getKey() +
1897  "-band");
1898  };
1899 };
1900 
1901 
1902 
1903 //
1905 {
1907  config_->getUseRateType()==SgTaskConfig::VR_NONE && // do not switch if rates are "in"
1908  (n==BPI_RES_SBD || n==BPI_RES_GRD || n==BPI_RES_PHD) )
1909  {
1910  switch (n)
1911  {
1912  default:
1913  case BPI_RES_SBD:
1915  break;
1916  case BPI_RES_GRD:
1918  break;
1919  case BPI_RES_PHD:
1921  break;
1922  };
1923 
1924  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
1925  {
1926  SgPlot *plot=plots4Baselines_.at(iBand);
1927  if (iBand != activeBand_)
1928  plot->changeYaxisTemp2(n);
1929  };
1931  };
1932 };
1933 
1934 
1935 
1936 //
1938 {
1939  int n;
1940  switch (delType)
1941  {
1942  default:
1943  case SgTaskConfig::VD_NONE:
1944  n = -1;
1945  break;
1947  n = BPI_RES_SBD;
1948  break;
1950  n = BPI_RES_GRD;
1951  break;
1953  n = BPI_RES_PHD;
1954  break;
1955  };
1956  if (n >= 0)
1957  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
1958  {
1959  SgPlot *plot=plots4Baselines_.at(iBand);
1960  plot->changeYaxisTemp2(n);
1961  };
1962 };
1963 
1964 
1965 
1966 //
1968 {
1970  &session_->stationsByName(), session_->getTStart(), this));
1971 };
1972 
1973 
1974 
1975 //
1977 {
1979  &session_->baselinesByName(), this));
1980 };
1981 
1982 
1983 
1984 //
1986 {
1988  &session_->sourcesByName(), this));
1989 };
1990 
1991 
1992 
1993 //
1994 void NsSessionEditDialog::process(/*bool isNeedUpdatePlots*/)
1995 {
1996  bool isNeedUpdatePlots=true;
1997  //
1998  // for people from USNO:
1999  int numOfConstrains=0;
2000  for (StationsByName_it it=session_->stationsByName().begin();
2001  it!=session_->stationsByName().end(); ++it)
2002  {
2003  SgVlbiStationInfo *si=it.value();
2006  numOfConstrains++;
2007  };
2008  if (numOfConstrains==0)
2009  QMessageBox::warning(this,
2010  "No reference clock station", "No station is selected as a reference clock one.");
2011  // end of p.f.u.
2012  //
2013  blockInput();
2014  // run it:
2015  session_->process(true, true);
2016  //
2017  processHasBeenCalled_ = true;
2018  if (isNeedUpdatePlots)
2019  {
2020  updateResiduals();
2021  emit dataChanged();
2022  };
2023  restoreInput();
2024  //
2025  QString str;
2026  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2027  {
2028  SgVlbiBand *band=session_->bands().at(iBand);
2029  labelsPrc_ .at(iBand)->setText(str.sprintf("%3d/%3d",
2030  band->observables().count(), band->numProcessed(DT_DELAY)));
2031  labelsPar_ .at(iBand)->setText(str.sprintf("%d/%d",
2033  labelsWRMS_.at(iBand)->setText(str.sprintf("%.1f", band->wrms(DT_DELAY)*scale4Delay_*1.0E3));
2034  labelsSig0_.at(iBand)->setText(str.sprintf("%.1f", band->getSigma2add(DT_DELAY)*scale4Delay_*1.0E3));
2035  labelsChi2_.at(iBand)->setText(str.sprintf("%.2f",
2036  session_->getNumOfDOF()>0.0?band->chi2(DT_DELAY)/session_->getNumOfDOF():0.0));
2037  };
2040 };
2041 
2042 
2043 
2044 //
2046 {
2047  process();
2048  process();
2049 };
2050 
2051 
2052 
2053 //
2055 {
2056  process();
2057  process();
2058  process();
2059 };
2060 
2061 
2062 //
2064 {
2066  process_3times();
2067 };
2068 
2069 
2070 
2071 //
2073 {
2074  SgPlot *plot=NULL;
2075  SgPlotCarrier *carrier=NULL;
2076  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2077  {
2078  SgVlbiBand *band=session_->bands().at(iBand);
2079  //
2080  plot = plots4Baselines_.at(iBand);
2081  carrier = plotCarriers4Baselines_.at(iBand);
2082  //
2083  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
2084  for (int iBaseline=0; it!=band->baselinesByName().constEnd(); ++it, iBaseline++)
2085  {
2086  SgVlbiBaselineInfo* baselineInfo=it.value();
2087  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2088  {
2089  if (iBand == config_->getActiveBandIdx())
2090  baselineInfo->calculateClockF1(config_);
2091 
2092  QList<SgVlbiObservable*> *observables=&baselineInfo->observables();
2093  SgPlotBranch *branch=carrier->listOfBranches()->at(iBaseline);
2094 
2095  QList<SgVlbiObservable*>::const_iterator jt=observables->constBegin();
2096  for (int idx=0; jt!=observables->constEnd(); ++jt, idx++)
2097  {
2098  SgVlbiObservable *o=*jt;
2101  else
2103  if (o->isUsable())
2105  else
2107  branch->data()->setElement(idx, BPI_RES_SBD, o->sbDelay().getResidual()*scale4Delay_);
2108  branch->data()->setElement(idx, BPI_RES_GRD, o->grDelay().getResidual()*scale4Delay_);
2109  branch->data()->setElement(idx, BPI_RES_PHD, o->phDelay().getResidual()*scale4Delay_);
2110  branch->data()->setElement(idx, BPI_RES_PHR, o->phDRate().getResidual()*scale4Rate_);
2111  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
2113  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
2115 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
2116  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
2117  o->activeDelay()->getResidualNorm():0.0);
2118  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
2119  branch->data()->setElement(idx, BPI_AMBIG_GR_NUMBER,
2120  o->grDelay().getNumOfAmbiguities());
2121  branch->data()->setElement(idx, BPI_AMBIG_PH_NUMBER,
2122  o->phDelay().getNumOfAmbiguities());
2123  //branch->data()->setElement(idx, BPI_GRD_SBD, (o->grDelay().getValue() +
2124  // o->grDelay().ambiguity() +
2125  // o->grDelay().getIonoValue() - o->sbDelay().getValue())*scale4Delay_);
2126  //branch->data()->setElement(idx, BPI_Q_SBD, o->getSbdQ());
2127  //branch->data()->setElement(idx, BPI_Q_GRD, o->getGrdQ());
2128  //branch->data()->setElement(idx, BPI_Q_PHR, o->getPhrQ());
2129 
2130  branch->data()->setElement(idx, BPI_TAUS, o->getTauS()*scale4Delay_);
2131  branch->data()->setElement(idx, BPI_TEST, o->getTest()*scale4Delay_);
2132  };
2133  };
2134  };
2135  plot->dataContentChanged();
2136  labelsSig0_.at(iBand)->setText(QString("").
2137  sprintf("%.2f", band->getSigma2add(DT_DELAY)*scale4Delay_*1.0E3));
2138  };
2139  // plus estimated parameters:
2140  QMap<QString, SgVlbiAuxObservation*> *auxObservationsByScan=NULL;
2141  int stnIdx;
2142  plot = plot4Stations_;
2143  carrier = plotCarrier4Stations_;
2144  //
2145  QMap<QString, SgVlbiStationInfo*>::const_iterator it=session_->stationsByName().constBegin();
2146  for (stnIdx=0; it!=session_->stationsByName().constEnd(); ++it, stnIdx++)
2147  {
2148  SgVlbiStationInfo *stationInfo=it.value();
2149  SgPlotBranch *branch=carrier->listOfBranches()->at(stnIdx);
2150  auxObservationsByScan = stationInfo->auxObservationByScanId();
2151 
2152  QMap<QString, SgVlbiAuxObservation*>::const_iterator jt=auxObservationsByScan->constBegin();
2153  for (int idx=0; jt!=auxObservationsByScan->constEnd(); ++jt, idx++)
2154  {
2155  SgVlbiAuxObservation *auxObs=jt.value();
2156  if (!auxObs->isAttr(SgObservation::Attr_PROCESSED))
2158  else
2160 /*
2161  if (auxObs->isUsable())
2162  branch->delDataAttr(idx, SgPlotCarrier::DA_NONUSABLE);
2163  else
2164  branch->addDataAttr(idx, SgPlotCarrier::DA_NONUSABLE);
2165 */
2166  branch->data()->setElement(idx, SPI_EST_CLK + cableCalsOffset_,
2167  auxObs->getEstClocks());
2168  branch->data()->setElement(idx, SPI_EST_WZD + cableCalsOffset_,
2169  auxObs->getEstZenithDelay()*1.0e10/vLight);
2170  branch->data()->setElement(idx, SPI_EST_GRN + cableCalsOffset_,
2171  auxObs->getEstAtmGradN());
2172  branch->data()->setElement(idx, SPI_EST_GRE + cableCalsOffset_,
2173  auxObs->getEstAtmGradE());
2174  branch->data()->setElement(idx, SPI_TOT_ZDEL + cableCalsOffset_,
2175  (auxObs->getZenithDelayH() + auxObs->getZenithDelayW())*100.0 + auxObs->getEstZenithDelay());
2176  branch->data()->setElement(idx, SPI_SIG_EST_CLK + cableCalsOffset_,
2177  auxObs->getEstClocksSigma());
2178  branch->data()->setElement(idx, SPI_SIG_EST_WZD + cableCalsOffset_,
2179  auxObs->getEstZenithDelaySigma()*1.0e10/vLight);
2180  branch->data()->setElement(idx, SPI_SIG_EST_GRN + cableCalsOffset_,
2181  auxObs->getEstAtmGradNSigma());
2182  branch->data()->setElement(idx, SPI_SIG_EST_GRE + cableCalsOffset_,
2183  auxObs->getEstAtmGradESigma());
2185  auxObs->getEstZenithDelaySigma());
2186 
2187  SgVlbiObservation *obs=auxObs->getOwner();
2188  SgVlbiObservable *o=obs?obs->activeObs():NULL;
2189  if (o && obs->isAttr(SgObservation::Attr_PROCESSED))
2190  {
2191  branch->data()->setElement(idx, SPI_RES_GRD + cableCalsOffset_,
2192  o->grDelay().getResidual()*scale4Delay_*1.0e3);
2193  branch->data()->setElement(idx, SPI_SIG_GRD + cableCalsOffset_,
2194  o->grDelay().sigma2Apply()*scale4Delay_*1.0e3);
2195  }
2196  else
2197  {
2198  branch->data()->setElement(idx, SPI_RES_GRD + cableCalsOffset_, 0.0);
2199  branch->data()->setElement(idx, SPI_SIG_GRD + cableCalsOffset_, 0.0);
2200  };
2201  };
2202  };
2203  plot->dataContentChanged();
2204  //
2205  //
2207 };
2208 
2209 
2210 
2211 //
2213 {
2214  SgPlot *plot=plot4Session_;
2216  QString keyUt1("EOP: dUT1, ms");
2217  QString keyPmx("EOP: P_x, mas");
2218  QString keyPmy("EOP: P_y, mas");
2219  const double scale4Ut1(parametersDescriptor_->getPolusUT1().getScale());
2220  const double scale4Pm(parametersDescriptor_->getPolusXY().getScale());
2221  bool isTmp;
2222 
2223  SgPlotBranch *brArc=carrier->listOfBranches()->at(2);
2224  SgPlotBranch *brPwl=carrier->listOfBranches()->at(3);
2225  SgPlotBranch *brStc=carrier->listOfBranches()->at(4);
2226 
2227 
2228  // 4Arc:
2229  SgArcStorage *arcUt1=NULL, *arcPmx=NULL, *arcPmy=NULL;
2230  // 4PWL:
2231  SgPwlStorage *pwlUt1=NULL, *pwlPmx=NULL, *pwlPmy=NULL;
2232  // 4Stoch:
2233  const QMap<QString, SgParameter*>
2234  *ut1ByEpoch=NULL, *pmxByEpoch=NULL, *pmyByEpoch=NULL;
2235  SgParameter *par;
2236 
2237 
2238  // Arc:
2239  if (reporter_->arcByName().contains(keyUt1))
2240  arcUt1 = reporter_->arcByName().value(keyUt1);
2241  if (reporter_->arcByName().contains(keyPmx))
2242  arcPmx = reporter_->arcByName().value(keyPmx);
2243  if (reporter_->arcByName().contains(keyPmy))
2244  arcPmy = reporter_->arcByName().value(keyPmy);
2245 
2246  // PWL:
2247  if (reporter_->pwlByName().contains(keyUt1))
2248  pwlUt1 = reporter_->pwlByName().value(keyUt1);
2249  if (reporter_->pwlByName().contains(keyPmx))
2250  pwlPmx = reporter_->pwlByName().value(keyPmx);
2251  if (reporter_->pwlByName().contains(keyPmy))
2252  pwlPmy = reporter_->pwlByName().value(keyPmy);
2253 
2254  // Stoch:
2255  if (reporter_->stcParByName()->contains(keyUt1))
2256  ut1ByEpoch = &(*reporter_->stcParByName())[keyUt1];
2257  if (reporter_->stcParByName()->contains(keyPmx))
2258  pmxByEpoch = &(*reporter_->stcParByName())[keyPmx];
2259  if (reporter_->stcParByName()->contains(keyPmy))
2260  pmyByEpoch = &(*reporter_->stcParByName())[keyPmy];
2261 
2262 
2263  for (int i=0; i<session_->scanEpochs().size(); i++)
2264  {
2265  const SgMJD *pt=session_->scanEpochs().at(i);
2266  QString timeTag(pt->toString(SgMJD::F_INTERNAL));
2267 
2268  // ARC:
2269  isTmp = false;
2270  if (arcUt1)
2271  {
2272  brArc->data()->setElement(i, SNI_EST_UT1, arcUt1->calcSolution(*pt)*scale4Ut1);
2273  brArc->data()->setElement(i, SNI_SIG_UT1, arcUt1->calcSigma(*pt)*scale4Ut1);
2275  isTmp = true;
2276  }
2277  else
2278  {
2279  brArc->data()->setElement(i, SNI_EST_UT1, 0.0);
2280  brArc->data()->setElement(i, SNI_SIG_UT1, 0.0);
2282  };
2283  //
2284  if (arcPmx)
2285  {
2286  brArc->data()->setElement(i, SNI_EST_PMX, arcPmx->calcSolution(*pt)*scale4Pm);
2287  brArc->data()->setElement(i, SNI_SIG_PMX, arcPmx->calcSigma(*pt)*scale4Pm);
2289  }
2290  else
2291  {
2292  brArc->data()->setElement(i, SNI_EST_PMX, 0.0);
2293  brArc->data()->setElement(i, SNI_SIG_PMX, 0.0);
2295  };
2296  //
2297  if (arcPmy)
2298  {
2299  brArc->data()->setElement(i, SNI_EST_PMY, arcPmy->calcSolution(*pt)*scale4Pm);
2300  brArc->data()->setElement(i, SNI_SIG_PMY, arcPmy->calcSigma(*pt)*scale4Pm);
2302  }
2303  else
2304  {
2305  brArc->data()->setElement(i, SNI_EST_PMY, 0.0);
2306  brArc->data()->setElement(i, SNI_SIG_PMY, 0.0);
2308  };
2309  if (isTmp)
2311 
2312 
2313  // PWL:
2314  isTmp = false;
2315  if (pwlUt1)
2316  {
2317  brPwl->data()->setElement(i, SNI_EST_UT1, pwlUt1->calcSolution (*pt)*scale4Ut1);
2318  brPwl->data()->setElement(i, SNI_SIG_UT1, pwlUt1->calcRateSigma(*pt)*scale4Ut1);
2320  isTmp = true;
2321  }
2322  else
2323  {
2324  brPwl->data()->setElement(i, SNI_EST_UT1, 0.0);
2325  brPwl->data()->setElement(i, SNI_SIG_UT1, 0.0);
2327  };
2328  //
2329  if (pwlPmx)
2330  {
2331  brPwl->data()->setElement(i, SNI_EST_PMX, pwlPmx->calcSolution (*pt)*scale4Pm);
2332  brPwl->data()->setElement(i, SNI_SIG_PMX, pwlPmx->calcRateSigma(*pt)*scale4Pm);
2334  }
2335  else
2336  {
2337  brPwl->data()->setElement(i, SNI_EST_PMX, 0.0);
2338  brPwl->data()->setElement(i, SNI_SIG_PMX, 0.0);
2340  };
2341  //
2342  if (pwlPmy)
2343  {
2344  brPwl->data()->setElement(i, SNI_EST_PMY, pwlPmy->calcSolution (*pt)*scale4Pm);
2345  brPwl->data()->setElement(i, SNI_SIG_PMY, pwlPmy->calcRateSigma(*pt)*scale4Pm);
2347  }
2348  else
2349  {
2350  brPwl->data()->setElement(i, SNI_EST_PMY, 0.0);
2351  brPwl->data()->setElement(i, SNI_SIG_PMY, 0.0);
2353  };
2354  if (isTmp)
2356 
2357 
2358  // Stoch:
2359  isTmp = false;
2360  if (ut1ByEpoch && ut1ByEpoch->contains(timeTag) && (par=ut1ByEpoch->value(timeTag)))
2361  {
2362  brStc->data()->setElement(i, SNI_EST_UT1, par->getSolution()*scale4Ut1);
2363  brStc->data()->setElement(i, SNI_SIG_UT1, par->getSigma()*scale4Ut1);
2365  isTmp = true;
2366  }
2367  else
2368  {
2369  brStc->data()->setElement(i, SNI_EST_UT1, 0.0);
2370  brStc->data()->setElement(i, SNI_SIG_UT1, 0.0);
2372  };
2373  //
2374  if (pmxByEpoch && pmxByEpoch->contains(timeTag) && (par=pmxByEpoch->value(timeTag)))
2375  {
2376  brStc->data()->setElement(i, SNI_EST_PMX, par->getSolution()*scale4Pm);
2377  brStc->data()->setElement(i, SNI_SIG_PMX, par->getSigma()*scale4Pm);
2379  }
2380  else
2381  {
2382  brStc->data()->setElement(i, SNI_EST_PMX, 0.0);
2383  brStc->data()->setElement(i, SNI_SIG_PMX, 0.0);
2385  };
2386  //
2387  if (pmyByEpoch && pmyByEpoch->contains(timeTag) && (par=pmyByEpoch->value(timeTag)))
2388  {
2389  brStc->data()->setElement(i, SNI_EST_PMY, par->getSolution()*scale4Pm);
2390  brStc->data()->setElement(i, SNI_SIG_PMY, par->getSigma()*scale4Pm);
2392  }
2393  else
2394  {
2395  brStc->data()->setElement(i, SNI_EST_PMY, 0.0);
2396  brStc->data()->setElement(i, SNI_SIG_PMY, 0.0);
2398  };
2399  if (isTmp)
2401  };
2402 
2403  plot->dataContentChanged();
2404 };
2405 
2406 
2407 
2408 //
2410 {
2412  {
2413  if (QMessageBox::warning(this, "Novice User Warning",
2414  "It looks like ambiguities are not resolved for the session yet."
2415  "Do you want to evaluate ionosphere corrections?",
2416  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
2417  return;
2418  };
2419  //
2421  // replot:
2422  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2423  {
2424  SgPlot *plot = plots4Baselines_.at(iBand);
2425  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
2426  SgVlbiBand *band = session_->bands().at(iBand);
2427 
2428  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2429  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2430  {
2431  SgVlbiBaselineInfo* baselineInfo = i.value();
2432  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2433  {
2434  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2435  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
2436 
2437  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
2438  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
2439  {
2440  SgVlbiObservable *o=*j;
2441  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
2442  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
2443  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
2444  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
2445  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
2447  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
2453 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
2454  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
2455  o->activeDelay()->getResidualNorm():0.0);
2456  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
2457  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
2458  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
2459  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
2460  };
2461  };
2462  };
2463  plot->dataContentChanged();
2464  };
2465  emit dataChanged();
2468  ionoC_->setEnabled(false);
2469  iono0_->setEnabled(true);
2470 };
2471 
2472 
2473 
2474 //
2476 {
2477  //
2479  // replot:
2480  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2481  {
2482  SgPlot *plot = plots4Baselines_.at(iBand);
2483  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
2484  SgVlbiBand *band = session_->bands().at(iBand);
2485 
2486  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2487  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2488  {
2489  SgVlbiBaselineInfo* baselineInfo = i.value();
2490  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2491  {
2492  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2493  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
2494 
2495  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
2496  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
2497  {
2498  SgVlbiObservable *o=*j;
2499  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
2500  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
2501  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
2502  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
2503  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
2505  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
2511 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
2512  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
2513  o->activeDelay()->getResidualNorm():0.0);
2514  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
2515  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
2516  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
2517  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
2518  };
2519  };
2520  };
2521  plot->dataContentChanged();
2522  };
2523  emit dataChanged();
2526  ionoC_->setEnabled(true);
2527  iono0_->setEnabled(false);
2528 };
2529 
2530 
2531 
2532 //
2534 {
2535  /*
2536  session_->calculateBaselineClock_F1();
2537  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2538  {
2539  SgPlot *plot = plots4Baselines_.at(iBand);
2540  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
2541  SgVlbiBand *band = session_->bands().at(iBand);
2542 
2543  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2544  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2545  {
2546  SgVlbiBaselineInfo* baselineInfo = i.value();
2547  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2548  {
2549  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2550  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
2551 
2552  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
2553  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
2554  {
2555  SgVlbiObservable *o=*j;
2556  branch->data()->setElement(idx, BPI_CLK_1, o->owner()->getBaselineClock_F1() *scale4Delay_);
2557  branch->data()->setElement(idx, BPI_CLK_1L, o->owner()->getBaselineClock_F1l()*scale4Delay_);
2558  branch->data()->setElement(idx, BPI_CLK_1R, o->owner()->getBaselineClock_F1r()*scale4Delay_);
2559  };
2560  };
2561  };
2562  plot->dataContentChanged();
2563  };
2564  emit dataChanged();
2565  if (isNeed2SaveSir_ && setup.getAutoSavingMode()==NsSetup::AS_ALWAYS)
2566  saveIntermediateResults();
2567  */
2568 };
2569 
2570 
2571 
2572 //
2573 void NsSessionEditDialog::dispatchUserKey(SgPlot* plotter, Qt::KeyboardModifiers modifiers, int key)
2574 {
2575  switch (modifiers)
2576  {
2577  case Qt::ControlModifier:
2578  switch (key)
2579  {
2580  case Qt::Key_B:
2581  processClockBreakMarksNew(plotter);
2582  // std::cout << "processed New\n";
2583  break;
2584  case Qt::Key_F:
2585  generateRequest4Refringing(plotter);
2586  // std::cout << "processed New\n";
2587  break;
2588 // case Qt::Key_M:
2589 // adjustAmbiguityMultipliers();
2590  break;
2591  case Qt::Key_X:
2592  excludeMarkedPoints(plotter);
2593  break;
2594  case Qt::Key_Y:
2595  includeMarkedPoints(plotter);
2596  break;
2597  case Qt::Key_T:
2598  processTestFunctionN1(plotter);
2599  break;
2600  default:
2601  break;
2602  };
2603  break;
2604 
2605  case Qt::AltModifier:
2606  switch (key)
2607  {
2608  case Qt::Key_B:
2609  processClockBreakMarks(plotter);
2610  // std::cout << "processed Old\n";
2611  break;
2612  default:
2613  break;
2614  };
2615  break;
2616 /*
2617  case Qt::ShiftModifier:
2618  std::cout << " ++ got shift modifier\n";
2619  switch (key)
2620  {
2621  case Qt::Key_Equal:
2622  changeNumOfSubAmbig4MarkedPoints(plotter, 1);
2623  break;
2624  case Qt::Key_Minus:
2625  changeNumOfSubAmbig4MarkedPoints(plotter, -1);
2626  break;
2627  default:
2628  break;
2629  };
2630  std::cout << "Dispatch: key= " << key << ", modifiers=" << modifiers << "\n";
2631  break;
2632 */
2633  default:
2634  case Qt::NoModifier:
2635  switch (key)
2636  {
2637  case Qt::Key_Equal:
2639  break;
2640  case Qt::Key_Minus:
2642  break;
2643  case Qt::Key_Plus:
2645  break;
2646  case Qt::Key_Underscore:
2647  changeNumOfSubAmbig4MarkedPoints(plotter, -1);
2648  break;
2649  default:
2650  break;
2651  };
2652 // std::cout << "Dispatch: key= " << key << ", modifiers=" << modifiers << "\n";
2653  break;
2654  };
2655 };
2656 
2657 
2658 
2659 //
2661 {
2662  SgPlotCarrier* actualCarrier = plotter->carrier();
2663 
2664  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2665  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2666  {
2667  SgVlbiBand *band = session_->bands().at(iBand);
2668  BaselinesByName_it i=band->baselinesByName().begin();
2669  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
2670  {
2671  SgVlbiBaselineInfo* baselineInfo = i.value();
2672  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2673  {
2674  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2675  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2676 
2677  QList<SgVlbiObservable*>::iterator j = observables->begin();
2678  for (int idx=0; j!=observables->end(); ++j, idx++)
2679  {
2680  SgVlbiObservable *o=*j;
2681  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2682  {
2683  // change observation attribute
2686  else
2687  //obs->addAttr(SgVlbiObservation::Attr_NOT_VALID);
2688  o->owner()->modifyNotValidAttribute(true);
2691  // adjust plot data
2694  };
2695  };
2696  };
2697  };
2698  plotter->dataContentChanged();
2699  };
2700  //emit dataChanged();
2703 };
2704 
2705 
2706 
2707 //
2709 {
2710  SgPlotCarrier* actualCarrier = plotter->carrier();
2711 
2712  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2713  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2714  {
2715  SgVlbiBand *band = session_->bands().at(iBand);
2716  BaselinesByName_it i=band->baselinesByName().begin();
2717  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
2718  {
2719  SgVlbiBaselineInfo* baselineInfo = i.value();
2720  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2721  {
2722  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2723  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2724 
2725  QList<SgVlbiObservable*>::iterator j = observables->begin();
2726  for (int idx=0; j!=observables->end(); ++j, idx++)
2727  {
2728  SgVlbiObservable *o=*j;
2729  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2730  {
2731  // change observation attribute
2732  //obs->delAttr(SgVlbiObservation::Attr_NOT_VALID);
2733  if (o->owner()->modifyNotValidAttribute(false))
2734  {
2737  };
2740  };
2741  };
2742  };
2743  };
2744  plotter->dataContentChanged();
2745  };
2746  //emit dataChanged();
2749 };
2750 
2751 
2752 
2753 
2754 //
2756 {
2757  if (plotter->getNumOfYColumn() != BPI_RES_GRD)
2758  return;
2760  QMessageBox::warning(this,
2761  "Unable to proceed",
2762  "Cannot create the list of observations for refringing. Turn off ionosphere corrections and repeat");
2763  //
2764  //
2765  QList<SgVlbiObservable*> obsList;
2766  SgPlotCarrier *actualCarrier=plotter->carrier();
2767  //
2768  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2769  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2770  {
2771  SgVlbiBand *band=session_->bands().at(iBand);
2772  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
2773  for (int iBaseline=0; it!=band->baselinesByName().constEnd(); ++it, iBaseline++)
2774  {
2775  SgVlbiBaselineInfo *baselineInfo=it.value();
2776  if (baselineInfo)
2777  {
2779  *observables=&baselineInfo->observables();
2780  SgPlotBranch *branch=actualCarrier->listOfBranches()->at(iBaseline);
2781  for (int idx=0; idx<observables->size(); idx++)
2782  {
2783  SgVlbiObservable *o=observables->at(idx);
2784  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2785  {
2786  obsList << o;
2788  };
2789  };
2790  };
2791  };
2792  plotter->dataContentChanged();
2793  //
2794  };
2795 
2796  if (!obsList.size())
2797  return;
2798 
2799  QString bandKey(obsList.at(0)->getBandKey());
2800  QString str(setup.path2(setup.getPath2SpoolFileOutput()));
2801  QDir d(str);
2802  bool isOk;
2803  if (!d.exists())
2804  {
2805  isOk = d.mkpath("./");
2806  if (!isOk)
2807  {
2809  "::generateRequest4Refringing(): cannot create directory " + str);
2810  return;
2811  };
2812  };
2813  //
2814  QString fileName(session_->getName());
2815  if (fileName.at(0) == '$')
2816  fileName.remove(0, 1);
2817  fileName += ".b_" + bandKey + ".4FourFit";
2818  QFile f(str + "/" + fileName);
2819  if (!f.open(QIODevice::WriteOnly))
2820  {
2822  "::generateRequest4Refringing(): error opening output file: " + str + "/" + fileName);
2823  return;
2824  };
2825 
2826  double dInterval=1.5e-9; // 1.5 ns
2827  double wantedResid;
2828  if (bandKey == "S")
2829  dInterval = 3e-9; // was: 4ns
2830 
2831  QTextStream s(&f);
2832  for (int i=0; i<obsList.size(); i++)
2833  {
2834  SgVlbiObservable *o=obsList.at(i);
2835  wantedResid = o->grDelay().getResidualFringeFitting() -
2836  (o->grDelay().getResidual() /*+ o->grDelay().ambiguity()*/);
2837  if (wantedResid < -o->grDelay().getAmbiguitySpacing()/2.0)
2838  wantedResid += o->grDelay().getAmbiguitySpacing();
2839  if (o->grDelay().getAmbiguitySpacing()/2.0 < wantedResid)
2840  wantedResid -= o->grDelay().getAmbiguitySpacing();
2841 
2842  str = "fourfit -c " + o->getFourfitControlFile() +
2843  " -b " + o->owner()->stn_1()->getCid() + o->owner()->stn_2()->getCid() + ":" + o->getBandKey() +
2844  " " + o->owner()->getScanName() + " set mb_win " +
2845  QString("").sprintf("%.6f %.6f", (wantedResid - dInterval)*1.0e6, (wantedResid + dInterval)*1.0e6);
2846 
2847  s << str << "\n";
2848  };
2849  //
2850  s.setDevice(NULL);
2851  f.close();
2852  obsList.clear();
2853 
2855  "::generateRequest4Refringing(): the file \"" + f.fileName() + "\" has been created");
2856 };
2857 
2858 
2859 
2860 //
2862 {
2864  {
2865  if (QMessageBox::warning(this, "Novice User Warning",
2866  "The ionosphere corrections are evaluated and taken into account."
2867  "Modifications of ambiguity multiplier numbers will lead to unexpected results."
2868  "Do you want to continue?",
2869  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
2870  return;
2871  };
2872 
2873  SgPlotCarrier *actualCarrier=plotter->carrier();
2874  bool isDataModified(false);
2875  //
2876  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2877  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2878  {
2879  // group delays:
2880  if (plotter->getNumOfYColumn()==BPI_RES_GRD || // this is a group delay residuals
2881  plotter->getNumOfYColumn()==BPI_AMBIG_GR_NUMBER // or ambig numbers
2882  //|| plotter->getNumOfYColumn()==BPI_GRD_SBD
2883  )
2884  {
2885  SgVlbiBand *band=session_->bands().at(iBand);
2886  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2887  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2888  {
2889  SgVlbiBaselineInfo* baselineInfo = i.value();
2890  if (baselineInfo)
2891  {
2892  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2893  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2894 
2895  QList<SgVlbiObservable*>::iterator j = observables->begin();
2896  for (int idx=0; j!=observables->end(); ++j, idx++)
2897  {
2898  SgVlbiObservable *o=*j;
2899  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2900  {
2901  // change observation attribute
2903 //--> // adjust residual (can be used somewhere else before a user will make another iteration)
2904  o->grDelay().setResidual(o->grDelay().getResidual() +
2905  o->grDelay().getAmbiguitySpacing()*inc);
2906  // adjust plot data
2907  branch->data()->setElement(idx, BPI_RES_GRD,
2908  branch->data()->getElement(idx, BPI_RES_GRD) +
2911  //branch->data()->setElement(idx, BPI_GRD_SBD,
2912  // ( o->grDelay().getValue() +
2913  // o->grDelay().ambiguity() +
2914  // o->grDelay().getIonoValue() - o->sbDelay().getValue() )*scale4Delay_);
2916  isDataModified = true;
2918  };
2919  };
2920  };
2921  };
2922  plotter->dataContentChanged();
2923  };
2924  //
2925  // phase delays:
2926  if (plotter->getNumOfYColumn()==BPI_RES_PHD || // this is a group delay residuals
2927  plotter->getNumOfYColumn()==BPI_AMBIG_PH_NUMBER ) // or ambig numbers
2928  {
2929  SgVlbiBand *band=session_->bands().at(iBand);
2930  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
2931  for (int iBaseline=0; it!=band->baselinesByName().constEnd(); ++it, iBaseline++)
2932  {
2933  SgVlbiBaselineInfo *baselineInfo=it.value();
2934  if (baselineInfo)
2935  {
2936  QList<SgVlbiObservable*> *observables=&baselineInfo->observables();
2937  SgPlotBranch *branch=actualCarrier->listOfBranches()->at(iBaseline);
2938 
2939  QList<SgVlbiObservable*>::iterator j=observables->begin();
2940  for (int idx=0; j!=observables->end(); ++j, idx++)
2941  {
2942  SgVlbiObservable *o=*j;
2943  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2944  {
2945  // change observation attribute
2947  // adjust plot data
2948  branch->data()->setElement(idx, BPI_RES_PHD,
2949  branch->data()->getElement(idx, BPI_RES_PHD) +
2953  isDataModified = true;
2954  };
2955  };
2956  };
2957  };
2958  plotter->dataContentChanged();
2959  };
2960  //
2961  };
2962  //emit dataChanged();
2963  if (isDataModified)
2967 };
2968 
2969 
2970 
2971 //
2973 {
2974  SgPlotCarrier *actualCarrier=plotter->carrier();
2975 // bool isDataModified(false);
2976  //
2977  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2978  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2979  {
2980  // group delays only:
2981  if (plotter->getNumOfYColumn()==BPI_RES_GRD)
2982  {
2983  SgVlbiBand *band=session_->bands().at(iBand);
2984  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2985  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2986  {
2987  SgVlbiBaselineInfo* baselineInfo = i.value();
2988  if (baselineInfo)
2989  {
2990  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2991  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2992 
2993  QList<SgVlbiObservable*>::iterator j = observables->begin();
2994  for (int idx=0; j!=observables->end(); ++j, idx++)
2995  {
2996  SgVlbiObservable *o=*j;
2997  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2998  {
2999  // change observation attribute
3001  // adjust plot data
3002  branch->data()->setElement(idx, BPI_RES_GRD,
3003  branch->data()->getElement(idx, BPI_RES_GRD) +
3006 // isDataModified = true;
3008  };
3009  };
3010  };
3011  };
3012  plotter->dataContentChanged();
3013  };
3014  };
3017 };
3018 
3019 
3020 
3021 //
3023  QList<SgVlbiBaselineInfo*>& markedBaselines, SgVlbiBand*& band,
3024  SgMJD& tBreak, SgVlbiStationInfo*& stnBreak)
3025 {
3026  SgPlotCarrier *actualCarrier=plotter->carrier();
3027  QList<SgVlbiObservable*> obsAtBreak;
3028  QList<SgVlbiObservable*> obsNextToBreak;
3029  bool isOK=false;
3030 
3031  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3032  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
3033  {
3034  band = session_->bands().at(iBand);
3035  isOK = true;
3036  };
3037 
3038  if (!isOK)
3039  return isOK;
3040 
3041  BaselinesByName_it i=band->baselinesByName().begin();
3042  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
3043  {
3044  SgVlbiBaselineInfo* baselineInfo = i.value();
3045  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
3046  {
3047  //---------- collect marked points:
3048  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
3049  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
3050  bool hasMatched=false;
3051  for (int idx=observables->size()-2; idx>=0; idx--)
3052  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
3053  {
3054  if (!hasMatched)
3055  {
3056  hasMatched = true;
3057  SgVlbiObservable *o=observables->at(idx);
3058  markedBaselines.append(baselineInfo);
3059  int j=idx+1;
3060  while (j<observables->size() && branch->getDataAttr(j) & SgPlotCarrier::DA_REJECTED)
3061  j++;
3062  if (j<observables->size() && !(branch->getDataAttr(j) & SgPlotCarrier::DA_REJECTED))
3063  {
3064  SgVlbiObservable *obsNext=observables->at(j);
3065  obsAtBreak.append(o);
3066  obsNextToBreak.append(obsNext);
3067  };
3068  };
3069  // discard selection marks:
3071  };
3072  };
3073  };
3074  // perform some checks:
3075  if (!obsAtBreak.size()) // that's ok, user just occasionally pressed keys, nothing to do
3076  return false;
3077  if (obsAtBreak.size() != obsNextToBreak.size())
3078  {
3080  ": findClockBreakEvent(): number of points in the aux lists are not equal: " +
3081  QString("").sprintf("%d vs %d", obsAtBreak.size(), obsNextToBreak.size()));
3082  return false;
3083  };
3084  if (obsAtBreak.size() == 1 && band->baselinesByName().size()>1)
3085  {
3087  ": findClockBreakEvent(): not enough points to detect a clock break");
3088  QMessageBox::warning(this, "Clock Breaks detector", "Not enough points to detect a clock break");
3089  return false;
3090  };
3091  // guess a clock break:
3092  // count frequencies:
3093  QMap<QString, int> numByName;
3094  for (int i=0; i<obsAtBreak.size(); i++)
3095  {
3096  numByName[obsAtBreak.at(i)->stn_1()->getKey()]++;
3097  numByName[obsAtBreak.at(i)->stn_2()->getKey()]++;
3098  };
3099  // get maximum:
3100  QMap<QString, int>::iterator iAux=numByName.begin();
3101  int minN=iAux.value(), maxN=iAux.value();
3102  QString stnName=iAux.key();
3103  for (; iAux!=numByName.end(); ++iAux)
3104  {
3105  int n=iAux.value();
3106  if (minN>n)
3107  minN = n;
3108  if (maxN<n)
3109  {
3110  maxN = n;
3111  stnName = iAux.key();
3112  };
3113  };
3114  // determine proper station and epoch:
3115  if (maxN!=minN || (maxN==1 && minN==1))
3116  {
3117  stnBreak = NULL;
3118  tBreak = session_->getTStart();
3119  if (session_->stationsByName().contains(stnName))
3120  {
3121  SgVlbiObservable *obsBreak=NULL;
3122  stnBreak = session_->stationsByName().value(stnName);
3123  for (int i=0; i<obsAtBreak.size(); i++)
3124  if (tBreak < obsAtBreak.at(i)->epoch())
3125  {
3126  obsBreak = obsAtBreak.at(i);
3127  tBreak = obsBreak->epoch();
3128  };
3129  }
3130  else
3131  {
3133  ": findClockBreakEvent(): stnName " + stnName + " is not in session_->stationsByName()");
3134  isOK = false;
3135  };
3136  }
3137  else
3138  {
3140  ": findClockBreakEvent(): impossible to guess the station name: maxN==minN");
3141  isOK = false;
3142  };
3145  return isOK;
3146 };
3147 
3148 
3149 
3150 //
3152 {
3153  SgMJD tBreak=tZero;
3154  QList<SgVlbiBaselineInfo*> markedBaselines;
3155  SgVlbiStationInfo *stnBreak=NULL;
3156  SgVlbiBand *band=NULL;
3157 
3158  // parse user marks, determine station and epoch of the break (plus some aux variables):
3159  if (!findClockBreakEvent(plotter, markedBaselines, band, tBreak, stnBreak))
3160  return;
3161  if (!markedBaselines.size() || !band || tBreak==tZero || !stnBreak)
3162  return;
3163 
3164  // determine parameters of the break:
3165  double shift, sigma;
3166  session_->calculateClockBreakParameter(tBreak, stnBreak, band, shift, sigma);
3168  shift = round(1.0E9*shift); // round to ns
3171  shift = round(1.0E12*shift)*1.0E-3; // round to ps
3172  sigma *= 1.0E9;
3173 
3174  if (fabs(shift) > 3.0*sigma) // 3sigma threshold (otherwise, do it by hands):
3175  {
3176  // ok, let user know
3178  ": processClockBreakMarks(): detected clock break at " + stnBreak->getKey() +
3179  " station on " + tBreak.toString() + "; the shift is " +
3180  QString("").sprintf("%.4f ns", shift));
3181  // adjust station information concerning the clock break:
3182  session_->correctClockBreak(band, stnBreak, tBreak, shift, sigma, true);
3183  // replot residuals:
3184  updateResiduals();
3185  // emit dataChanged();
3186  }
3187  else // just print out what was found:
3189  ": processClockBreakMarks(): here could be a clock break at " + stnBreak->getKey() +
3190  " station on " + tBreak.toString() + "; however, its value is small, about " +
3191  QString("").sprintf("%.4f (+/- %.4f) ns", shift, sigma));
3194 };
3195 
3196 
3197 
3198 //
3200 {
3201  SgMJD tBreak=tZero;
3202  QList<SgVlbiBaselineInfo*> markedBaselines;
3203  SgVlbiStationInfo *stnBreak=NULL;
3204  SgVlbiBand *band=NULL;
3205  SgClockBreakAgent *cbAgent=NULL;
3206  QList<SgClockBreakAgent*> cbAgents;
3207 
3208  // collect previously detected clock breaks:
3209  QMap<QString, SgVlbiStationInfo*> *stationsByName;
3210  if (!config_->getUseDynamicClockBreaks() &&
3211  (plotter->getNumOfYColumn()==BPI_RES_GRD || plotter->getNumOfYColumn()==BPI_RES_PHD) )
3212  stationsByName = &session_->bands().at(activeBand_)->stationsByName();
3213  else
3214  stationsByName = &session_->stationsByName();
3215  StationsByName_it it=stationsByName->begin();
3216  for (int idx=0; it!=stationsByName->end(); ++it, idx++)
3217  {
3218  SgVlbiStationInfo *stn=it.value();
3219  SgBreakModel &breakModel=stn->clockBreaks();
3220  for (int brkIdx=0; brkIdx<breakModel.size(); brkIdx++)
3221  {
3222  SgParameterBreak *brk=breakModel.at(brkIdx);
3223  cbAgent = new SgClockBreakAgent;
3224  cbAgent->epoch_ = *brk;
3225  cbAgent->stn_ = stn;
3226  cbAgents.append(cbAgent);
3227  };
3228  };
3230  ": processClockBreakMarksNew(): got " + QString("").setNum(cbAgents.size()) +
3231  " entries in cbAgents");
3232 
3233  // parse user marks, determine station and epoch of the break (plus some aux variables):
3234  if (findClockBreakEvent(plotter, markedBaselines, band, tBreak, stnBreak) &&
3235  markedBaselines.size() && band && tBreak!=tZero && stnBreak )
3236  {
3237  // first, check for clock break, it may be already in the list:
3238  bool doesExist=false;
3239  for (int i=0; i<cbAgents.size(); i++)
3240  {
3241  cbAgent = cbAgents.at(i);
3242  if (fabs(cbAgent->epoch_ - tBreak)<5.5E-6 && cbAgent->stn_->getKey()==stnBreak->getKey())
3243  doesExist = true;
3244  };
3245  // if it is a new entry, append it:
3246  if (!doesExist)
3247  {
3248  cbAgent = new SgClockBreakAgent;
3249  cbAgent->epoch_ = tBreak;
3250  cbAgent->stn_ = stnBreak;
3251  cbAgents.append(cbAgent);
3252  };
3253  }; // All in all it's just another break in the clocks.
3254 
3255  if (!cbAgents.size()) // nothing to evaluate, perhaps, a user pressed the keys by accident.
3256  {
3258  ": processClockBreakMarksNew(): the size of clock break agents list is zero, nothing to do");
3259  return;
3260  };
3261 
3262  // determine parameters of the breaks:
3263  session_->calculateClockBreaksParameters(cbAgents, band);
3264 
3265  // std::cout << "Evaluated clock breaks:\n";
3266  for (int idx=0; idx<cbAgents.size(); idx++)
3267  {
3268  cbAgent = cbAgents.at(idx);
3269  double shift, sigma;
3270  tBreak = cbAgent->epoch_;
3271  stnBreak = cbAgent->stn_;
3272  shift = cbAgent->shift_;
3273  sigma = cbAgent->sigma_;
3274 
3276  shift = round(1.0E9*shift); // round to ns
3279  shift = round(1.0E12*shift)*1.0E-3; // round to ps
3280  sigma *= 1.0E9;
3281  //
3282  // std::cout << qPrintable(stnBreak->getKey() + " " + tBreak.toString() ) << " "
3283  // << shift << " +/-" << sigma << "\n";
3284  //
3285  if (fabs(shift) > 3.0*sigma) // 3sigma threshold (otherwise, do it by hands):
3286  {
3287  // ok, let user know
3289  ": processClockBreakMarksNew(): detected clock break at " + stnBreak->getKey() +
3290  " station on " + tBreak.toString() + "; shift on " +
3291  QString("").sprintf("%.4f ns", shift));
3292  // adjust station information concerning the clock break:
3293  session_->correctClockBreak(band, stnBreak, tBreak, shift, sigma, true);
3294  // replot residuals:
3295  updateResiduals();
3296  }
3297  else // just print out what was found:
3299  ": processClockBreakMarksNew(): here could be a clock break at " + stnBreak->getKey() +
3300  " station on " + tBreak.toString() + "; however, its value is small, about " +
3301  QString("").sprintf("%.4f (+/- %.4f) ns", shift, sigma));
3302  // free the allocated memory:
3303  delete cbAgent;
3304  };
3307 };
3308 
3309 
3310 
3311 //
3313 {
3314  SgVlbiBand *band=NULL;
3315  SgPlotCarrier *actualCarrier=plotter->carrier();
3316  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3317  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
3318  band = session_->bands().at(iBand);
3319  if (!band)
3320  return;
3321 
3322  QString stnName("");
3323  SgMJD tBreak(tZero);
3324  if (session_->detectClockBreaks_mode1(band, stnName, tBreak))
3325  {
3327  ": processTestFunctionN1(): detected clock break at " +
3328  stnName + " on " + tBreak.toString());
3329  };
3330 };
3331 
3332 
3333 
3334 //
3336 {
3338  ": adjustAmbiguityMultipliers(): starting adjusting of ambiguity multipliers");
3339 
3340  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3341  {
3342  SgVlbiBand *band=session_->bands().at(iBand);
3343  BaselinesByName_it i=band->baselinesByName().begin();
3344  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
3345  {
3346  SgVlbiBaselineInfo* baselineInfo=i.value();
3347  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
3348  {
3349  QList<SgVlbiObservable*> *observables=&baselineInfo->observables();
3350  for (int idx=0; idx<observables->size(); idx++)
3351  {
3352  SgVlbiObservable *o=observables->at(idx);
3353  double diff=o->sbDelay().getResidual() + o->sbDelay().getIonoValue() -
3354  ( o->grDelay().getResidual() + o->grDelay().ambiguity() +
3355  o->grDelay().getIonoValue());
3357  o->grDelay().getNumOfAmbiguities() + rint(diff/o->grDelay().getAmbiguitySpacing()));
3358  };
3359  };
3360  };
3361  };
3364 
3365 };
3366 
3367 
3368 
3369 //
3371 {
3373  return;
3374 
3376  {
3377  if (QMessageBox::warning(this, "Novice User Warning",
3378  "The ionosphere corrections are evaluated and taken into account."
3379  "Modifications of ambiguity multiplier numbers will lead to unexpected results."
3380  "Do you want to continue?",
3381  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
3382  return;
3383  };
3384 
3386  ": scanAmbiguityMultipliers(): starting scanning of ambiguity multipliers");
3387 
3388  blockInput();
3390  updateResiduals();
3391  restoreInput();
3392  emit dataChanged();
3396 };
3397 
3398 
3399 
3400 //
3402 {
3404  ": detectAndProcessClockBreaks(): clock break correction procedure initiated");
3405 
3407 
3408  updateResiduals();
3409  emit dataChanged();
3412 };
3413 
3414 
3415 
3416 //
3418 {
3420  ": processRmOutButton(): outliers detect procedure initiated");
3421 
3422  // show "wait" cursor:
3423  blockInput();
3424 
3426  {
3429  else
3431  }
3432  else
3434 
3435  updateResiduals();
3436  emit dataChanged();
3437  // restore cursor:
3438  restoreInput();
3441 };
3442 
3443 
3444 
3445 //
3447 {
3448  if (QMessageBox::warning(this, "Warning",
3449  "Are you sure to wipe out all changes you made for the session?",
3450  QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
3451  return;
3452 
3454  ": clearAllEditings(): starting clear of all edit information");
3455 
3456  zeroIono();
3457  session_->resetAllEditings(true);
3458 
3459  updateResiduals();
3462  emit dataChanged();
3465 };
3466 
3467 
3468 
3469 //
3471 {
3472  if (session_)
3474  emit dataChanged();
3477 };
3478 
3479 
3480 
3481 //
3483  int /*xColIdx*/, int /*yColIdx*/)
3484 {
3485  SgVlbiBand *band=session_->bands().at(activeBand_);
3486  QString blName=branch->getName();
3487  SgVlbiBaselineInfo *baseline=NULL;
3488  if (band->baselinesByName().contains(blName))
3489  {
3490  baseline = band->baselinesByName().find(blName).value();
3491  SgVlbiObservable *o=baseline->observables().at(idx);
3492  if (o)
3493  {
3494  QMessageBox msgBox(this);
3495  QString str2copy, str2copyBlName(""), strQCs(""), strSnrs(""), strECs("");
3496  QString str4usability("");
3497  QString blnStat(""), srcStat(""), stn1Stat(""), stn2Stat("");
3498  if (session_->baselinesByName().size()>1)
3499  str2copyBlName = " " + o->baseline()->getKey() + ",";
3500  str2copy.sprintf("observation %d,%s %s, %s, which fits at %.2f +/- %.2f ps",
3501  o->getMediaIdx()+1, qPrintable(str2copyBlName),
3502  qPrintable(o->src()->getKey()), qPrintable(o->epoch().toString(SgMJD::F_HHMMSS)),
3503  o->activeDelay()->getResidual()*scale4Delay_*1.0e3,
3504  o->activeDelay()->sigma2Apply()*scale4Delay_*1.0e3);
3505 /*
3506  o->measurement(config_)->getResidual()*scale4Delay_*1.0e3,
3507  o->measurement(config_)->sigma2Apply()*scale4Delay_*1.0e3);
3508 */
3509 // o->measurement(config_)->getSigma()*scale4Delay_*1.0e3);
3510 
3511  SgVlbiObservation *obs=o->owner();
3512  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3513  it_obs!=obs->observableByKey().end(); ++it_obs)
3514  {
3515  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ", ";
3516  strSnrs+= it_obs.key() + ":" + QString("").sprintf("%.2g", it_obs.value()->getSnr()) + ", ";
3517  strECs += it_obs.key() + ":\"" + it_obs.value()->getErrorCode() + "\", ";
3518  };
3519  if (strQCs.size()>1)
3520  strQCs = strQCs.left(strQCs.size() - 2);
3521  if (strSnrs.size()>1)
3522  strSnrs = strSnrs.left(strSnrs.size() - 2);
3523  if (strECs.size()>1)
3524  strECs = strECs.left(strECs.size() - 2);
3525 
3526  str4usability = "";
3527  if (!o->isUsable())
3528  {
3530  str4usability += "Low quality factor. ";
3532  str4usability += "Deselected source. ";
3534  str4usability += "Deselected station. ";
3536  str4usability += "Deselected baseline. ";
3538  str4usability += "Not mated. ";
3540  str4usability += "Not enough used channels. ";
3542  str4usability += "Low quality factor on another band. ";
3544  str4usability += "Not enough used channels on another band. ";
3545  str4usability.chop(1);
3546 
3547  str4usability = "<dt>Reason(s) of non-usability:</dt><dd>" + str4usability + "</dd>";
3548  };
3549 // blnStat.sprintf(" Nums: %d/%d/%d, WRMS=%.2fps",
3550  blnStat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps</ul></small>",
3551  o->baseline()->numTotal(DT_DELAY),
3552  o->baseline()->numUsable(DT_DELAY),
3554  o->baseline()->wrms(DT_DELAY)*1.0e12);
3555 // srcStat.sprintf(" Nums: %d/%d/%d, WRMS=%.2fps",
3556  srcStat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps</ul></small>",
3557  o->src()->numTotal(DT_DELAY),
3558  o->src()->numUsable(DT_DELAY),
3559  o->src()->numProcessed(DT_DELAY),
3560  o->src()->wrms(DT_DELAY)*1.0e12);
3561  //stn1Stat.sprintf("Nums: %d/%d/%d, WRMS=%.2fps",
3562  stn1Stat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps"
3563  "<li>Azimuth %.1f(degree)<li>Elevation %.1f(degree)</ul></small>",
3564  o->stn_1()->numTotal(DT_DELAY),
3565  o->stn_1()->numUsable(DT_DELAY),
3566  o->stn_1()->numProcessed(DT_DELAY),
3567  o->stn_1()->wrms(DT_DELAY)*1.0e12,
3568  obs->auxObs_1()->getAzimuthAngle()*RAD2DEG,
3569  obs->auxObs_1()->getElevationAngle()*RAD2DEG);
3570  stn2Stat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps"
3571  "<li>Azimuth %.1f(degree)<li>Elevation %.1f(degree)</ul></small>",
3572  o->stn_2()->numTotal(DT_DELAY),
3573  o->stn_2()->numUsable(DT_DELAY),
3574  o->stn_2()->numProcessed(DT_DELAY),
3575  o->stn_2()->wrms(DT_DELAY)*1.0e12,
3576  obs->auxObs_2()->getAzimuthAngle()*RAD2DEG,
3577  obs->auxObs_2()->getElevationAngle()*RAD2DEG);
3578  msgBox.setIcon(QMessageBox::Information);
3579  msgBox.setText("<b>Inquired observation</b>");
3580  msgBox.setInformativeText("<p>You have selected an observation of " +
3581  o->src()->getKey() + " radio source on the baseline " +
3582  o->baseline()->getKey() + ". Its attributes are:"
3583  "<ul>"
3584  "<li>baseline: <b>" + o->baseline()->getKey() + "</b>" + blnStat +
3585  "<li>radio source: <b>" + o->src()->getKey() + "</b>" + srcStat +
3586  "<li>reference station: <b>" + o->stn_1()->getKey() + "</b>" + stn1Stat +
3587  "<li>remote station: <b>" + o->stn_2()->getKey() + "</b>" + stn2Stat +
3588  "<li>band: <b>" + o->getBandKey() + "</b>" +
3589  "<li>observation # " + QString("").setNum(o->getMediaIdx()) +
3590  ", baseline idx: " + QString("").setNum(idx) + "</li>" +
3591  "<li>epoch: " + o->epoch().toString() + "</li>" +
3592  "<li>scan name: " + obs->getScanName() + "</li>" +
3593  "<li>fourfit file name: " + o->getFourfitOutputFName() + "</li>" +
3594  "<li>" + o->activeDelay()->getName() +
3595  QString("").sprintf(" residual: %.4f +/- %.4fps (applied: %.4fps) </li>",
3596  o->activeDelay()->getResidual()*scale4Delay_*1.0e3,
3597  o->activeDelay()->getSigma()*scale4Delay_*1.0e3,
3598  o->activeDelay()->sigma2Apply()*scale4Delay_*1.0e3) +
3599  "<li>Attributes:<dl>"
3600  "<dt>Quality code(s):</dt><dd>{" + strQCs + "}</dd>"
3601  "<dt>SNR(s):</dt><dd>{" + strSnrs + "}</dd>"
3602 
3603  "<dt>Usable:</dt><dd>" + (o->isUsable()?QString("<b>Yes</b>"):QString("No")) + "</dd>" +
3604  str4usability +
3605  "<dt>Excluded:</dt><dd>" +
3606  (obs->isAttr(SgVlbiObservation::Attr_NOT_VALID)?"<b>Yes</b>":"No") + "</dd>" +
3607  "<dt>Processed:</dt><dd>" +
3608  (obs->isAttr(SgVlbiObservation::Attr_PROCESSED)?"<b>Yes</b>":"No") + "</dd>" +
3609 
3610  "<dt>Fringe error code(s):</dt><dd>{" + strECs + "}</dd></dl></ul></p><p>"
3611  "Cut and copy string for reports:<br>" +
3612  str2copy + "</p>");
3613 
3614  msgBox.exec();
3615  };
3616  };
3617 };
3618 
3619 
3620 
3621 //
3623 {
3624  QString dirName=setup.path2(setup.getPath2IntermediateResults());
3625  bool isOk(true);
3626  SgMJD startEpoch(SgMJD::currentMJD());
3627  // check for existance:
3628  QDir d(dirName);
3629  if (!d.exists())
3630  {
3631  isOk = d.mkpath("./"); // Qt, wtf?
3632  if (isOk)
3634  ": saveIntermediateResults(): the directory " + dirName + " has been created");
3635  else
3636  {
3638  ": saveIntermediateResults(): cannot create directory " + dirName +
3639  "; saving the intermediate results has failed");
3640  setup.setLnfsFileName("");
3642  return;
3643  };
3644  };
3645  if (dirName.size()>0)
3646  dirName += "/";
3647  QString fileName(session_->name4SirFile(setup.getHave2UpdateCatalog()));
3648  QFile file(dirName + fileName);
3649  if (!file.open(QIODevice::WriteOnly))
3650  {
3652  ": saveIntermediateResults(): cannot open file " + file.fileName() +
3653  "; saving the intermediate results has failed");
3654  setup.setLnfsFileName("");
3656  return;
3657  };
3658  QDataStream s(&file);
3659  if ((isOk=session_->saveIntermediateResults(s)))
3660  {
3661  SgMJD finisEpoch(SgMJD::currentMJD());
3663  ": saveIntermediateResults(): the intermediate results have been saved in the file " +
3664  file.fileName() + ", elapsed time: " +
3665  QString("").sprintf("%.2f", (finisEpoch - startEpoch)*86400000.0) + " ms");
3666  }
3667  else
3668  {
3670  ": saveIntermediateResults(): saving the intermediate results in the file " +
3671  file.fileName() + " has failed");
3672  setup.setLnfsFileName("");
3674  };
3675  s.setDevice(NULL);
3676  file.close();
3677  return;
3678 };
3679 
3680 
3681 
3682 //
3684 {
3685  QString dirName=setup.path2(setup.getPath2IntermediateResults());
3686  bool isOk(true);
3687  SgMJD startEpoch(SgMJD::currentMJD());
3688  // check for existance:
3689  QDir d(dirName);
3690  if (!d.exists())
3691  return false;
3692  if (dirName.size()>0)
3693  dirName += "/";
3694  QString fileName(session_->name4SirFile(setup.getHave2UpdateCatalog()));
3695  QFile file(dirName + fileName);
3696  if (!file.exists())
3697  {
3699  ": loadIntermediateResults(): nothing to read, the file " + file.fileName() + " does not exist");
3700  return false;
3701  };
3702  if (!file.open(QIODevice::ReadOnly))
3703  {
3705  ": loadIntermediateResults(): cannot read file " + file.fileName() +
3706  "; loading the intermediate results has failed");
3707  return false;
3708  };
3709  // ok, it is exist and we can read the file. Ask user:
3710  if (need2notify &&
3711  QMessageBox::question(this,
3712  "Found unsaved data",
3713  "There are intermediate results for this session, should we load them?\n"
3714  "If you say No, you'll start a session from the scratch, also the intermediate results "
3715  "will be overwritten.",
3716  QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)==QMessageBox::No)
3717  {
3718  file.close();
3719  file.remove();
3720  return false;
3721  };
3722  QDataStream s(&file);
3723  if ((isOk=session_->loadIntermediateResults(s)))
3724  {
3725  SgMJD finisEpoch(SgMJD::currentMJD());
3727  ": loadIntermediateResults(): the intermediate results have been loaded from the file " +
3728  file.fileName() + ", elapsed time: " +
3729  QString("").sprintf("%.2f", (finisEpoch - startEpoch)*86400000.0) + " ms");
3730  }
3731  else
3733  ": loadIntermediateResults(): loading the intermediate results from the file " +
3734  file.fileName() + " has failed");
3735  s.setDevice(NULL);
3736  file.close();
3737  return isOk;
3738 };
3739 
3740 
3741 
3742 //
3744 {
3745  blockInput();
3747 
3748 /*
3749  // put here an action to test:
3750  session_->calculateIonoCorrections(NULL);
3751  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3752  {
3753  SgPlot *plot = plots4Baselines_.at(iBand);
3754  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
3755  SgVlbiBand *band = session_->bands().at(iBand);
3756 
3757  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
3758  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
3759  {
3760  SgVlbiBaselineInfo* baselineInfo = i.value();
3761  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
3762  {
3763  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
3764  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
3765 
3766  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
3767  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
3768  {
3769  SgVlbiObservable *o=*j;
3770  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
3771  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
3772  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
3773  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
3774  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
3775  o->grDelay().sigma2Apply()*scale4Delay_);
3776  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
3777  o->phDRate().sigma2Apply()*scale4Rate_);
3778  branch->data()->setElement(idx, BPI_SIG_ION_SBD, o->sbDelay().getIonoSigma()*scale4Delay_);
3779  branch->data()->setElement(idx, BPI_SIG_ION_GRD, o->grDelay().getIonoSigma()*scale4Delay_);
3780  branch->data()->setElement(idx, BPI_SIG_ION_PHD, o->phDelay().getIonoSigma()*scale4Delay_);
3781  branch->data()->setElement(idx, BPI_SIG_ION_PHR, o->phDRate().getIonoSigma()*scale4Rate_);
3782 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
3783  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
3784  o->activeDelay()->getResidualNorm():0.0);
3785  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
3786  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
3787  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
3788  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
3789  };
3790  };
3791  };
3792  plot->dataContentChanged();
3793  };
3794 */
3795 
3796  emit dataChanged();
3797 
3800 
3802  ": executeTestAction(): done");
3803  restoreInput();
3804 };
3805 
3806 
3807 
3808 //
3809 //
3811 {
3812  // collect info and display it:
3813  QList<SgVlbiObservation*> deselectedObs;
3814  QList<SgVlbiObservation*> nonUsableObs;
3815  QList<NsDeselectedObsInfo*> deselectedObservations;
3816  QList<NsNotUsedObsInfo*> nonUsableObservations;
3817 
3818  for (int i=0; i<session_->observations().size(); i++)
3819  {
3820  SgVlbiObservation *obs=session_->observations().at(i);
3821  if (obs->activeObs() && !obs->activeObs()->isUsable())
3822  nonUsableObs << obs;
3823  else if (obs->isAttr(SgVlbiObservation::Attr_NOT_VALID) &&
3824  obs->activeObs() && obs->activeObs()->isUsable() )
3825  deselectedObs << obs;
3826  };
3827  QString str("");
3828  for (int i=0; i<deselectedObs.size(); i++)
3829  {
3830  QString strQCs("");
3831  SgVlbiObservation *obs=deselectedObs.at(i);
3832  SgVlbiObservable *o=obs->activeObs(); // can be NULL
3833  if (o)
3834  {
3835  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3836  it_obs!=obs->observableByKey().end(); ++it_obs)
3837  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ",";
3838  strQCs.chop(1);
3840  obs->stn_1()->getKey(), obs->stn_2()->getKey(), obs->src()->getKey(),
3841  obs->toString(SgMJD::F_HHMMSS), strQCs,
3842  o->activeDelay()->getResidual()*1.0e12,
3843  o->activeDelay()->sigma2Apply()*1.0e12,
3845  );
3846  deselectedObservations << obsInfo;
3847  };
3848  };
3849  for (int i=0; i<nonUsableObs.size(); i++)
3850  {
3851  QString strReasons("");
3852  QString strQCs("");
3853  SgVlbiObservation *obs=nonUsableObs.at(i);
3854  SgVlbiObservable *o=obs->activeObs(); // can be NULL
3855  if (o)
3856  {
3857  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3858  it_obs!=obs->observableByKey().end(); ++it_obs)
3859  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ",";
3860  strQCs.chop(1);
3861 
3863  strReasons += "Low quality factor. ";
3865  strReasons += "Deselected source. ";
3867  strReasons += "Deselected station. ";
3869  strReasons += "Deselected baseline. ";
3871  strReasons += "Not mated. ";
3873  strReasons += "Not enough used channels. ";
3875  strReasons += "Low quality factor on another band. ";
3877  strReasons += "Not enough used channels on another band. ";
3878  strReasons.chop(1);
3879 
3880  NsNotUsedObsInfo *obsInfo=new NsNotUsedObsInfo(o->getMediaIdx(), obs->stn_1()->getKey(),
3881  obs->stn_2()->getKey(), obs->src()->getKey(), obs->toString(SgMJD::F_HHMMSS), strQCs,
3882  strReasons);
3883 
3884  nonUsableObservations << obsInfo;
3885  };
3886  };
3887  //
3888  NsBrowseNotUsedObsDialog *browser;
3889  browser = new NsBrowseNotUsedObsDialog(nonUsableObservations, deselectedObservations, reporter_, this);
3890  browser->setModal(false);
3891  browser->setSizeGripEnabled(true);
3892  browser->setWindowModality(Qt::NonModal);
3893  browser->setWindowFlags(Qt::Window);
3894  browser->resize(0.8*size());
3895  browser->show();
3896  browser->raise();
3897  browser->activateWindow();
3898 
3899 };
3900 
3901 
3902 
3903 //
3905 {
3906  // collect info and diplay it:
3907  QList<SgVlbiObservation*> listOfExcludedObs;
3908  for (int i=0; i<session_->observations().size(); i++)
3909  {
3910  SgVlbiObservation *obs=session_->observations().at(i);
3911 // if (obs->minQualityFactor() >= config_->getQualityCodeThreshold() &&
3912 // obs->isAttr(SgVlbiObservation::Attr_NOT_VALID))
3914  obs->activeObs() && obs->activeObs()->isUsable() )
3915  listOfExcludedObs << obs;
3916  };
3917  QString lstOfObs("");
3918  QString str2copy("");
3919  for (int i=0; i<listOfExcludedObs.size(); i++)
3920  {
3921  QString str2copyBlName(""), strQCs("");
3922  SgVlbiObservation *obs=listOfExcludedObs.at(i);
3923  SgVlbiObservable *o=obs->primeObs();
3924  // need to specify a baseline:
3925  if (session_->baselinesByName().size() > 1)
3926  str2copyBlName = " " + obs->baseline()->getKey() + ",";
3927  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3928  it_obs!=obs->observableByKey().end(); ++it_obs)
3929  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ",";
3930  if (strQCs.size()>1)
3931  strQCs = strQCs.left(strQCs.size() - 1);
3932  str2copy.sprintf("observation %d,%s %s, %s, QC=(%s) which fits at %.2f +/- %.2f ps",
3933  o->getMediaIdx()+1, qPrintable(str2copyBlName),
3934  qPrintable(o->src()->getKey()), qPrintable(o->epoch().toString(SgMJD::F_HHMMSS)),
3935  qPrintable(strQCs),
3936  o->activeDelay()->getResidual()*1.0e12,
3937  o->activeDelay()->sigma2Apply()*1.0e12);
3938 // lstOfObs += str2copy + "<br>";
3939  lstOfObs += str2copy + "\n";
3940  };
3941 // QMessageBox msgBox(NULL);
3942  QMessageBox msgBox(QMessageBox::Information, "", "",
3943  QMessageBox::Ok, NULL, Qt::Window);
3944 
3945 
3946  msgBox.setIcon(QMessageBox::Information);
3947  msgBox.setText("<b>The list of potentially good observations that were excluded from data analysis "
3948  "for the session " + session_->getName() + ":</b>");
3949  msgBox.setInformativeText("Total amount: " + QString("").setNum(listOfExcludedObs.size()));
3950  msgBox.setDetailedText(
3951 // "<p>The observations are:</p>"
3952 // "<p>" + lstOfObs + "</p>");
3953  "The observations are:\n" + lstOfObs);
3954  msgBox.setSizeGripEnabled(true);
3955  msgBox.exec();
3956 };
3957 
3958 
3959 
3960 
3961 
3962 
3963 //
3965 {
3966  if (setup.getExternalCommand().size() == 0)
3967  {
3969  "::runExternalCommand(): no command specified");
3970  return;
3971  };
3972 /*
3973  QFileInfo fi(setup.getExternalCommand());
3974  if (!fi.exists())
3975  {
3976  logger->write(SgLogger::ERR, SgLogger::RUN, className() +
3977  "::runExternalCommand(): the file \"" + setup.getExternalCommand() + "\" does not exist");
3978  return;
3979  };
3980  if (!fi.isExecutable())
3981  {
3982  logger->write(SgLogger::ERR, SgLogger::RUN, className() +
3983  "::runExternalCommand(): the file \"" + setup.getExternalCommand() + "\" is not not executable");
3984  return;
3985  };
3986 */
3987  int rc;
3988  QString command(setup.getExternalCommand());
3989  command += " '" + session_->getName() + "' '" +
3990  session_->getSessionCode() + "' '" + session_->getOfficialName() + "' '" +
3992 
3994  "::runExternalCommand(): executing the command \"" + command + "\"");
3995 
3996  rc = system(qPrintable(command));
3998  "::runExternalCommand(): the command \"" + command +
3999  "\" has been executed with rc=" + QString("").setNum(rc));
4000 };
4001 /*=====================================================================================================*/
4002 
4003 
4004 
4005 
4006 
4007 
4008 
4009 
4010 
4011 
4012 
4013 /*=====================================================================================================*/
void longOperationStartDisplay(int minStep, int maxStep, const QString &message)
void longOperationStopDisplay()
void longOperationMessageDisplay(const QString &message)
void longOperationShowStats(const QString &label, int numTot, int numPrc, double wrms, double chi2)
void longOperationProgressDisplay(int step)
@ BPI_SIG_ION_SBD
@ BPI_AMBIG_GR_NUMBER
@ BPI_PCAL_PH_DEL_1
@ BPI_SIG_ION_PHD
@ BPI_SIG_RAT_APPLIED
@ BPI_PCAL_PH_DEL_2
@ BPI_RES_NORM_DEL
@ BPI_EFF_FRQ_PHR
@ BPI_SIG_DEL_APPLIED
@ BPI_PCAL_GR_DEL_1
@ BPI_ION_DTEC
@ BPI_CORR_COEF
@ BPI_AMBIG_PH_NUMBER
@ BPI_PCAL_GR_DEL_2
@ BPI_EFF_FRQ_PHD
@ BPI_EFF_FRQ_GRD
@ BPI_RES_NORM_RAT
@ BPI_SIG_ION_DTEC
@ BPI_SIG_ION_PHR
@ BPI_AMBIG_PH_SPACING
@ BPI_AMBIG_GR_SPACING
@ BPI_GR_DELAY
@ BPI_SIG_ION_GRD
@ SPI_SIG_TOT_ZDEL
@ SPI_MET_PRESS
@ SPI_SIG_EST_GRE
@ SPI_PARALLACTIC
@ SPI_SIG_EST_WZD
@ SPI_SIG_EST_CLK
@ SPI_ELEVATION
@ SPI_CABLE_CAL
@ SPI_TOT_ZDEL
@ SPI_SIG_EST_GRN
@ SPI_MET_HUMID
@ SPI_MET_TEMP
const double vLight
Definition: SgConstants.cpp:35
SgLogger * logger
Definition: SgLogger.cpp:231
QString interval2Str(double days)
Definition: SgMJD.cpp:1371
const SgMJD tZero(1957, 10, 4)
#define RAD2MAS
radians to ms:
Definition: SgMathSupport.h:73
#define DAY2SEC
radians to mas:
Definition: SgMathSupport.h:69
#define RAD2DEG
radians to degrees:
Definition: SgMathSupport.h:41
@ OBM_BAND
Definition: SgObjectInfo.h:46
@ OBM_SESSION
Definition: SgObjectInfo.h:46
QMap< QString, SgVlbiBaselineInfo * >::iterator BaselinesByName_it
QList< SgVlbiNetworkId > networks
QMap< QString, SgVlbiSourceInfo * >::iterator SourcesByName_it
QMap< QString, SgVlbiStationInfo * >::iterator StationsByName_it
@ DT_DELAY
Definition: SgWrmsable.h:44
QString className() const
void netIdCurrentIndexChanged(const QString &)
bool findClockBreakEvent(SgPlot *, QList< SgVlbiBaselineInfo * > &, SgVlbiBand *&, SgMJD &, SgVlbiStationInfo *&)
QList< QLabel * > labelsWRMS_
void generateRequest4Refringing(SgPlot *)
void changeNumOfAmbigSpacing4MarkedPoints(SgPlot *, int)
void changeNumOfSubAmbig4MarkedPoints(SgPlot *, int)
SgGuiVlbiSourceList * sourcesList_
SgGuiTaskConfig * configWidget_
void processClockBreakMarks(SgPlot *)
void dispatchChangeOfClocksParameterModel(SgParameterCfg::PMode)
QList< SgPlot * > plots4Baselines_
QWidget * tab4BandPlots(SgVlbiBand *)
void excludeMarkedPoints(SgPlot *)
void displayPointInfo(SgPlot *, SgPlotBranch *, int, int, int)
void dispatchUserKey(SgPlot *, Qt::KeyboardModifiers, int)
QWidget * tab4Band(SgVlbiBand *)
NsSessionEditDialog(const QString &fileName, const QString &fileNameAux, SgTaskConfig *, SgParametersDescriptor *, SgVlbiSessionInfo::OriginType, bool isLnfs, QWidget *parent=0, Qt::WindowFlags flags=Qt::Dialog)
void processClockBreakMarksNew(SgPlot *)
QList< SgPlotCarrier * > plotCarriers4Baselines_
QList< QLabel * > labelsPar_
QList< QWidget * > widgets2Block_
QList< QLabel * > labelsPrc_
void includeMarkedPoints(SgPlot *)
QList< QLabel * > labelsSig0_
SgPlotCarrier * plotCarrier4Session_
SgGuiVlbiStationList * stationsList_
void dispatchChangeOfZenithParameterModel(SgParameterCfg::PMode)
void processTestFunctionN1(SgPlot *)
QList< QLabel * > labelsChi2_
SgGuiVlbiBaselineList * baselinesList_
SgPlotCarrier * plotCarrier4Stations_
SgSolutionReporter * reporter_
void generateReport(bool isExtended=false)
bool importSession(bool guiExpected)
bool exportDataIntoVgosDb(QString output=QString(""))
SgVlbiSessionInfo::OriginType oType_
SgParametersDescriptor * parametersDescriptor_
bool exportDataIntoVgosDa(QString output=QString(""))
SgTaskConfig * config_
SgVlbiSession * session_
SaveStatus saveStatus_
void setSeWinWidth(int)
Definition: NsSetup.h:912
QString path2(const QString &) const
Definition: NsSetup.h:1008
AutoSaving getAutoSavingMode() const
Definition: NsSetup.h:502
bool getHave2SkipAutomaticProcessing() const
Definition: NsSetup.h:686
bool getExecExternalCommand() const
Definition: NsSetup.h:185
const QString & getPath2SpoolFileOutput() const
Definition: NsSetup.h:454
const QString & getExternalCommand() const
Definition: NsSetup.h:187
void setLnfsOriginType(SgVlbiSessionInfo::OriginType)
Definition: NsSetup.h:960
SgPlot::OutputFormat getPlotterOutputFormat() const
Definition: NsSetup.h:654
void setSeWinHeight(int)
Definition: NsSetup.h:920
SgIdentities & identities()
Definition: NsSetup.h:566
int getSeWinWidth() const
Definition: NsSetup.h:622
bool getIsShortScreen() const
Definition: NsSetup.h:582
bool getHave2UpdateCatalog() const
Definition: NsSetup.h:526
int getSeWinHeight() const
Definition: NsSetup.h:630
const QString & getPath2PlotterOutput() const
Definition: NsSetup.h:486
@ AS_NONE
Definition: NsSetup.h:50
@ AS_ALWAYS
Definition: NsSetup.h:52
bool getHave2WarnCloseWindow() const
Definition: NsSetup.h:574
void setLnfsFileName(const QString &)
Definition: NsSetup.h:952
void setLnfsIsThroughCatalog(bool)
Definition: NsSetup.h:968
bool getIsBandPlotPerSrcView() const
Definition: NsSetup.h:646
bool getHave2ForceAutomaticProcessing() const
Definition: NsSetup.h:694
const QString & getPath2IntermediateResults() const
Definition: NsSetup.h:494
double calcSolution(const SgMJD &)
double calcSigma(const SgMJD &)
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
SgVlbiStationInfo * stn_
Definition: SgVlbiSession.h:65
void displayParametersDesriptor()
void addRefClockStation(const QString &)
const QString & getUserDefaultInitials() const
Definition: SgIdentities.h:231
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_TXT
Definition: SgLogger.h:65
@ REPORT
Definition: SgLogger.h:95
@ PREPROC
Definition: SgLogger.h:98
@ SESSION
Definition: SgLogger.h:77
Definition: SgMJD.h:59
@ F_Verbose
Definition: SgMJD.h:65
@ F_HHMMSS
Just time: 17:02:43.6.
Definition: SgMJD.h:96
@ F_Simple
Digits: 2010/04/02 17:02:43.6.
Definition: SgMJD.h:68
@ F_INTERNAL
Digits, date and time: 20100402.71.
Definition: SgMJD.h:72
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1008
double toDouble() const
Definition: SgMJD.h:531
static SgMJD currentMJD()
Definition: SgMJD.cpp:119
void setElement(unsigned int i, unsigned int j, double d)
Definition: SgMatrix.h:402
double getElement(unsigned int i, unsigned int j) const
Definition: SgMatrix.h:385
double getPressure() const
Definition: SgMeteoData.h:242
double getTemperature() const
Definition: SgMeteoData.h:234
double getRelativeHumidity() const
Definition: SgMeteoData.h:250
double getDversion() const
Definition: SgModelsInfo.h:114
double getSigma2add(DataType) const
Definition: SgObjectInfo.h:367
const QString & getKey() const
Definition: SgObjectInfo.h:319
int numProcessed(DataType dType) const
Definition: SgObjectInfo.h:351
int numUsable(DataType) const
Definition: SgObjectInfo.h:359
double chi2(DataType) const
Definition: SgObjectInfo.h:415
double wrms(DataType) const
Definition: SgObjectInfo.h:567
int numTotal(DataType dType) const
Definition: SgObjectInfo.h:343
@ Attr_NOT_VALID
omit the observation;
Definition: SgObservation.h:78
@ Attr_PROCESSED
the observation has been processed;
Definition: SgObservation.h:79
void setPMode(PMode mode)
double getScale() const
double getSolution() const
Definition: SgParameter.h:435
double getSigma() const
Definition: SgParameter.h:443
const SgParameterCfg & getPolusUT1() const
const SgParameterCfg & getPolusXY() const
const QString & getName() const
Definition: SgGuiPlotter.h:92
unsigned int getDataAttr(unsigned int) const
void addDataAttr(unsigned int, unsigned int)
void setExtKey(int idx, const QString &key)
Definition: SgGuiPlotter.h:101
void setAlternativeTitleName(const QString &aName, int idx=-1)
Definition: SgGuiPlotter.h:95
SgMatrix * data()
Definition: SgGuiPlotter.h:83
void delDataAttr(unsigned int, unsigned int)
void createBranch(unsigned int numberOfRows, const QString &branchName, bool hasExtKeys=false)
QList< SgPlotBranch * > * listOfBranches()
Definition: SgGuiPlotter.h:163
void setFile2SaveBaseName(const QString &name)
Definition: SgGuiPlotter.h:178
void setNameOfColumn(unsigned int, const QString &)
void setAxisType(int columnIdx, AxisType axisType)
Definition: SgGuiPlotter.h:207
void setStdVarIdx(int columnIdx, int sigmaColumnIdx)
Definition: SgGuiPlotter.h:216
void setName(const QString &name, int idx=-1)
Definition: SgGuiPlotter.h:177
void setOutputFormat(OutputFormat fmt)
Definition: SgGuiPlotter.h:625
int getNumOfYColumn() const
Definition: SgGuiPlotter.h:621
void setFilterNames(const QList< QString > &)
void dataContentChanged()
SgPlotCarrier * carrier()
Definition: SgGuiPlotter.h:618
void setFilterExtNames(const QList< QString > &)
void changeYaxisTemp2(int)
void setFilterAuxNames(const QList< QString > &)
@ PM_Q_PNT_EXT_PROC
Definition: SgGuiPlotter.h:601
@ PM_ERRBARS
Definition: SgGuiPlotter.h:600
@ PM_FILTERS_ENABLED
Definition: SgGuiPlotter.h:602
@ PM_EXT_KEY_SELECT
Definition: SgGuiPlotter.h:603
virtual double calcSolution(const SgMJD &)
virtual double calcRateSigma(const SgMJD &)
const QMap< QString, SgArcStorage * > & arcByName()
QMap< QString, QMap< QString, SgParameter * > > * stcParByName()
const QMap< QString, SgPwlStorage * > & pwlByName()
void setHave2ApplyUt1OceanTideHFContrib(bool b)
Definition: SgTaskConfig.h:616
bool getHave2ApplyNutationHFContrib() const
Definition: SgTaskConfig.h:386
bool getIsObservableFollowsPlot() const
bool getHave2ApplyOldPoleTideContrib() const
Definition: SgTaskConfig.h:393
void setHave2ApplyEarthTideContrib(bool b)
Definition: SgTaskConfig.h:611
void setHave2ApplyOceanPoleTideContrib(bool b)
Definition: SgTaskConfig.h:621
void setHave2ApplyTiltRemvrContrib(bool b)
Definition: SgTaskConfig.h:623
VlbiDelayType getUseDelayType() const
Definition: SgTaskConfig.h:873
bool getHave2ApplyEarthTideContrib() const
Definition: SgTaskConfig.h:379
bool getHave2ApplyPyContrib() const
Definition: SgTaskConfig.h:378
QMap< QString, AutomaticProcessing > & apByNetId()
Definition: SgTaskConfig.h:637
bool getHave2ApplyOceanTideContrib() const
Definition: SgTaskConfig.h:380
void setActiveBandIdx(int)
VlbiRateType getUseRateType() const
Definition: SgTaskConfig.h:881
bool getHave2ApplyUt1OceanTideHFContrib() const
Definition: SgTaskConfig.h:384
bool getIsNoviceUser() const
Definition: SgTaskConfig.h:294
bool getContribsAreFromDatabase() const
Definition: SgTaskConfig.h:376
bool getHave2ApplyPxyOceanTideHFContrib() const
Definition: SgTaskConfig.h:385
void setHave2ApplyOceanTideContrib(bool b)
Definition: SgTaskConfig.h:612
bool getHave2ApplyOldOceanTideContrib() const
Definition: SgTaskConfig.h:392
bool getHave2ApplyPoleTideContrib() const
Definition: SgTaskConfig.h:381
void setHave2ApplyPoleTideContrib(bool b)
Definition: SgTaskConfig.h:613
void setHave2ApplyOldPoleTideContrib(bool b)
Definition: SgTaskConfig.h:625
bool getIsActiveBandFollowsTab() const
bool getHave2ApplyPxyLibrationContrib() const
Definition: SgTaskConfig.h:388
void setHave2ApplyPxyOceanTideHFContrib(bool b)
Definition: SgTaskConfig.h:617
bool getHave2ApplyTiltRemvrContrib() const
Definition: SgTaskConfig.h:391
bool getUseDynamicClockBreaks() const
Definition: SgTaskConfig.h:921
void setHave2ApplyOldOceanTideContrib(bool b)
Definition: SgTaskConfig.h:624
bool getHave2ApplyPxContrib() const
Definition: SgTaskConfig.h:377
bool getHave2ApplyOceanPoleTideContrib() const
Definition: SgTaskConfig.h:389
void setHave2ApplyPxyLibrationContrib(bool b)
Definition: SgTaskConfig.h:620
void setUseDelayType(VlbiDelayType)
void setHave2ApplyPyContrib(bool b)
Definition: SgTaskConfig.h:610
void setHave2ApplyPxContrib(bool b)
Definition: SgTaskConfig.h:609
void setHave2ApplyFeedCorrContrib(bool b)
Definition: SgTaskConfig.h:622
void setHave2ApplyNutationHFContrib(bool b)
Definition: SgTaskConfig.h:618
void setHave2ApplyUt1LibrationContrib(bool b)
Definition: SgTaskConfig.h:619
int getActiveBandIdx() const
Definition: SgTaskConfig.h:889
bool getHave2ApplyFeedCorrContrib() const
Definition: SgTaskConfig.h:390
bool getHave2ApplyUt1LibrationContrib() const
Definition: SgTaskConfig.h:387
OutliersProcessingAction getOpAction() const
Definition: SgTaskConfig.h:985
double getElement(unsigned int i) const
Definition: SgVector.h:362
int getCurrentVersion() const
Definition: SgVgosDb.h:280
double getZenithDelayW() const
double getCableCalibration() const
double getElevationAngle() const
double getEstZenithDelay() const
double getEstAtmGradNSigma() const
SgVlbiObservation * getOwner() const
const SgMeteoData & getMeteoData() const
double getZenithDelayH() const
double getEstAtmGradESigma() const
double getEstClocksSigma() const
double getEstZenithDelaySigma() const
double getParallacticAngle() const
const SgVector & cableCorrections() const
double getAzimuthAngle() const
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
Definition: SgVlbiBand.h:376
QMap< QString, SgVlbiStationInfo * > & stationsByName()
Definition: SgVlbiBand.h:368
int getInputFileVersion() const
Definition: SgVlbiBand.h:344
const SgMJD & getTCreation() const
Definition: SgVlbiBand.h:328
const QString & getInputFileName() const
Definition: SgVlbiBand.h:336
QList< SgVlbiObservable * > & observables()
Definition: SgVlbiBand.h:288
const QString & strGrdAmbigsStat() const
Definition: SgVlbiBand.h:160
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
Definition: SgVlbiBand.h:384
double getFrequency() const
Definition: SgVlbiBand.h:320
SgVlbiHistory & history()
Definition: SgVlbiBand.h:360
const QString & strPhdAmbigsStat() const
Definition: SgVlbiBand.h:164
@ Attr_HAS_AMBIGS
the band contains group delays and ambiguities;
Definition: SgVlbiBand.h:62
@ Attr_NOT_VALID
omit the baseline;
const QString & strPhdAmbigsStat() const
QList< SgVlbiObservable * > & observables()
void calculateClockF1(SgTaskConfig *)
const QString & strGrdAmbigsStat() const
double sigma2Apply() const
double getEffFreq() const
double getAmbiguitySpacing() const
void setNumOfSubAmbigs(int n)
void setResidual(double)
double ambiguity() const
void setNumOfAmbiguities(int)
double getValue() const
int getNumOfAmbiguities() const
double getSigma() const
double getIonoValue() const
double getSubAmbigSpacing() const
double getResidual() const
double getResidualFringeFitting() const
int getNumOfSubAmbigs() const
const QString & getName() const
double getResidualNorm() const
double getIonoSigma() const
const QString & getFourfitOutputFName() const
double getPhaseCalPhDelays(int i) const
bool isUsable() const
double getUvFrPerAsec(int i) const
double getPhaseCalGrDelays(int i) const
const SgMJD & epoch() const
int getQualityFactor() const
SgVlbiStationInfo *& stn_2()
SgVlbiStationInfo *& stn_1()
double getTauS() const
SgVlbiObservation * owner()
SgVlbiMeasurement & phDRate()
int errorCode2Int() const
SgVlbiSourceInfo *& src()
const QString & getFourfitControlFile() const
double getSnr() const
const QString & getBandKey() const
const SgAttribute & nonUsableReason() const
SgVlbiBaselineInfo *& baseline()
double getTest() const
SgVlbiMeasurement & phDelay()
SgVlbiMeasurement * activeDelay()
double getCorrCoeff() const
SgVlbiMeasurement & grDelay()
SgVlbiMeasurement & sbDelay()
int getMediaIdx() const
@ Attr_SBD_NOT_VALID
omit the observation if single band delay is analysed;
SgVlbiStationInfo * stn_1()
SgVlbiAuxObservation * auxObs_2()
SgVlbiSession * session()
SgVlbiSourceInfo * src()
double getDTecStdDev() const
SgVlbiBaselineInfo * baseline()
bool modifyNotValidAttribute(bool=false)
double getAprioriUt1HfContrib() const
SgVlbiStationInfo * stn_2()
double getAprioriPyHfContrib() const
double getDTec() const
SgVlbiObservable * primeObs()
const QString & getScanName() const
QMap< QString, SgVlbiObservable * > & observableByKey()
double getDdel_dUT1() const
SgVlbiAuxObservation * auxObs_1()
double getAprioriPxHfContrib() const
double getCalcHiFyUt1Delay() const
SgVlbiObservable * activeObs()
const SgMJD & getTFinis() const
const QString & getName() const
const QString & getNetworkID() const
const SgMJD & getTStart() const
void setNetworkID(const QString &netID)
const QString & getSubmitterName() const
const QString & getUserFlag() const
@ OT_DBH
observations are from database files provided by correlators;
@ OT_MK4
observations are from Mk4-compatible correlator output;
@ OT_AGV
observations are in AGV format;
@ OT_VDB
observations are from vgosDb data tree;
@ OT_NGS
observations are from a NGS file provided by other AC;
@ OT_KOMB
observations are from KOMB output (generated by NICT, Japan);
@ OT_UNKNOWN
unknown (=all others) source of import;
@ Attr_FF_EDIT_INFO_MODIFIED
edit info has been modified by user;
@ Attr_FF_WEIGHTS_CORRECTED
weights have been corrected;
@ Attr_FF_ION_C_CALCULATED
ionospheric corrections have been calculated;
@ Attr_FF_AMBIGS_RESOLVED
ambiguities have been resolved;
@ Attr_FF_AUTOPROCESSED
automatic data processing performed successfully;
@ Attr_HAS_IONO_CORR
the theoretical values are available;
OriginType getOriginType() const
const QString & getCorrelatorName() const
const QString & getOfficialName() const
const QString & getDescription() const
const QString & getSchedulerName() const
const QString & getSessionType() const
const QString & getSessionCode() const
const SgMJD & getTMean() const
const SgMJD & getTCreation() const
SgVlbiBand * primaryBand()
int checkBandForClockBreaks(int, bool)
int numberOfBands() const
const SgMJD & getLastProcessed() const
int getNumOfConstraints() const
void setLongOperationStart(void(*operation)(int, int, const QString &))
SgModelsInfo & calcInfo()
QList< SgVlbiBand * > & bands()
void setPrimaryBandByIdx(int)
void calculateIonoCorrections(const SgTaskConfig *)
int restoreOutliers(int bandIdx)
void setLongOperationProgress(void(*operation)(int))
QMap< QString, SgVlbiStationInfo * > & stationsByName()
const SgMJD & tRefer() const
void setLongOperationShowStats(void(*operation)(const QString &label, int numTot, int numPrc, double wrms, double chi2))
bool saveIntermediateResults(QDataStream &) const
bool detectClockBreaks_mode1(SgVlbiBand *, QString &, SgMJD &)
QList< SgVlbiObservation * > & observations()
void process(bool haveProcessAllBands, bool interactWithGui)
QString name4SirFile(bool)
void scanBaselines4GrDelayAmbiguities(int bandIdx)
void resetAllEditings(bool have2resetConfig)
void eliminateLargeOutliers(int bandIdx, int maxNumOfPasses, double wrmsRatio)
void correctClockBreak(SgVlbiBand *, SgVlbiStationInfo *, const SgMJD &, double, double, bool, bool=true)
void zerofyIonoCorrections(const SgTaskConfig *)
const QList< SgMJD * > & scanEpochs() const
void calculateClockBreaksParameters(QList< SgClockBreakAgent * > &, SgVlbiBand *)
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
void calculateClockBreakParameter(const SgMJD &, SgVlbiStationInfo *, SgVlbiBand *, double &, double &)
int getNumOfDOF() const
int eliminateOutliers(int bandIdx)
void eliminateOutliersSimpleMode(int bandIdx, int maxNumOfPasses, double threshold, double=0.0)
void setLongOperationMessage(void(*operation)(const QString &))
int getNumOfParameters() const
bool loadIntermediateResults(QDataStream &)
void setHave2InteractWithGui(bool have2)
QMap< QString, double > & skyFreqByIfId()
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
void setLongOperationStop(void(*operation)())
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
QVector< double > & tsysIfFreqs()
@ Attr_NOT_VALID
omit the station;
@ Attr_REFERENCE_CLOCKS
the clocks are the reference ones;
@ Attr_HAS_CCC_CDMS
a station has cable calibrations from CDMS
@ Attr_HAS_CCC_PCMT
a station has cable calibrations from PCMT
SgParameterCfg * pcZenith()
SgParameterCfg * pcClocks()
SgBreakModel & clockBreaks()
NsSetup setup
Definition: nuSolve.cpp:61
SgTaskConfig config
Definition: nuSolve.cpp:59
SgParametersDescriptor parametersDescriptor
Definition: nuSolve.cpp:60