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  scale4Delay_ = 1.0e9; // this is ns
228  scale4Rate_ = 1.0e15; // fs
229  // scale4Delay_ = vLight*100.0; // this is cm
230  processHasBeenCalled_ = false;
231  isImpossibleUpdateCat_ = false;
232  isNeed2SaveSir_ = true;
233  //
234  // save some info:
250 
251  // add GUI:
258 
259  blockInput();
260  if (!importSession(true))
261  {
262  restoreInput();
263  deleteLater();
264  return;
265  };
266  restoreInput();
267  // warn a user:
269  {
270  QMessageBox::warning(this, "Warning", "A database with the next version "
271  "already exists in the catalog.\nThe 'Save' procedure will not work if you do not remove it "
272  "from the catalog first.");
274  };
275  // if nothing to load:
276  if (loadIntermediateResults(!isLnfs))
277  processHasBeenCalled_ = true;
278  else if (oType_ == SgVlbiSessionInfo::OT_AGV)
279  {
281  ": the automatic analysis is disabled for vgosDa input type");
282  }
284  {
286  ": the automatic analysis is disabled by the command line argument");
288  }
289  // unprocessed or foreign session:
291  {
293  generateReport();
294  processHasBeenCalled_ = true;
295  if (config_->apByNetId().contains(session_->getNetworkID()) &&
296  config_->apByNetId()[session_->getNetworkID()].doOutliers_ &&
297  config_->apByNetId()[session_->getNetworkID()].doWeights_ )
298  (new SgGuiPiaReport(config_, parametersDescriptor_, session_, this, Qt::Dialog))->show();
299  }
300  else
301  {
302  // the reference clock station(s) should be saved in a database
303  // have to set up a coordinate reference station and adjust clock's polynomial model order:
306  };
307  //
308  //
309  // set up the GUI stuff:
310  //
311  //
312  setWindowTitle(session_->getName() + " Session Editor " +
313  (setup.getHave2UpdateCatalog()?"(work through catalog":"(standalone mode") + " as " +
315 
316  if (0<setup.getSeWinWidth() && 0<setup.getSeWinHeight())
318 
319  QBoxLayout *layout, *subLayout;
320  QSize btnSize;
321  if (setup.getIsShortScreen())
322  layout = new QHBoxLayout(this);
323  else
324  layout = new QVBoxLayout(this);
325  QTabWidget *sessionTabs=new QTabWidget(this);
326 
327  sessionTabs->addTab(tab4GeneralInfo(), "&General Info");
328  sessionTabs->addTab(tab4Options(), "&Options");
329  sessionTabs->addTab(tab4BaselinesPlot(), "&Bands");
330  sessionTabs->addTab(tab4StationsInfo(), "S&tations (List)");
331  sessionTabs->addTab(tab4SourcesInfo(), "Sou&rces (List)");
332  sessionTabs->addTab(tab4BaselinesInfo(), "Base&lines (List)");
333  sessionTabs->addTab(tab4StationsPlot(), "&Stations (Plots)");
334  sessionTabs->addTab(tab4SessionPlot(), "S&ession (Plots)");
335  //
337  //
338  layout->addWidget(sessionTabs, 10);
339  // "too big, too small
340  if (setup.getIsShortScreen()) // size does matter after all."
341  subLayout = new QVBoxLayout();
342  else
343  subLayout = new QHBoxLayout();
344  layout->addLayout(subLayout);
345 
346 
347  QPushButton *ok, *process, *dapCB, *rmOut, *save, *s2add0, *reset;
348  ok = new QPushButton("Close", this);
349  ionoC_ = new QPushButton("&IonoC", this);
350  iono0_ = new QPushButton("Iono&0", this);
351  process= new QPushButton("&Process", this);
352 #ifndef DEMO
353  //QPushButton *clcF1 = new QPushButton("ClcF#1", this);
354 #endif
355  dapCB = new QPushButton("&CBreak", this);
356  rmOut = new QPushButton("O&utlr", this);
357  scanAmbigs_ = new QPushButton("&Ambig", this);
358  save = new QPushButton("Sa&ve", this);
359  s2add0 = new QPushButton("Au&xSig0", this);
360  reset = new QPushButton("Reset", this);
361  saveButton_ = save;
362  // QPushButton *rprt = new QPushButton("Report", this);
363  process->setDefault(true);
364 
365  process->setMinimumSize((btnSize=process->sizeHint()));
366  ionoC_ ->setMinimumSize( btnSize );
367  iono0_ ->setMinimumSize( btnSize );
368 #ifndef DEMO
369  // clcF1 ->setMinimumSize( btnSize );
370 #endif
371  // cancel ->setMinimumSize( btnSize );
372  ok ->setMinimumSize( btnSize );
373  dapCB ->setMinimumSize( btnSize );
374  rmOut ->setMinimumSize( btnSize );
375  scanAmbigs_->setMinimumSize( btnSize );
376  save ->setMinimumSize( btnSize );
377  // rprt ->setMinimumSize( btnSize );
378  s2add0 ->setMinimumSize( btnSize );
379  reset ->setMinimumSize( btnSize );
380  if (setup.getIsShortScreen())
381  subLayout->addSpacing(btnSize.height());
382  subLayout->addWidget(process);
383  subLayout->addWidget(ionoC_);
384  subLayout->addWidget(iono0_);
385  subLayout->addWidget(scanAmbigs_);
386 #ifndef DEMO
387  //subLayout->addWidget(clcF1);
388 #endif
389  subLayout->addWidget(dapCB);
390  subLayout->addWidget(s2add0);
391  subLayout->addWidget(reset);
392  subLayout->addWidget(rmOut);
393 
394  subLayout->addStretch(1);
395  // subLayout->addWidget(rprt);
396  subLayout->addWidget(save);
397  subLayout->addWidget(ok);
398  // subLayout->addWidget(cancel);
399  if (setup.getIsShortScreen())
400  subLayout->addSpacing(btnSize.height());
401  setSizeGripEnabled(true);
402 
403 // stationsList_ ->setWrmsScale(scale4Delay_*1.0E3);
404 // sourcesList_ ->setWrmsScale(scale4Delay_*1.0E3);
405 // baselinesList_->setWrmsScale(scale4Delay_*1.0E3);
406 
407  connect(this, SIGNAL(dataChanged()), stationsList_, SLOT(updateContent()));
408  connect(this, SIGNAL(dataChanged()), sourcesList_, SLOT(updateContent()));
409  connect(this, SIGNAL(dataChanged()), baselinesList_, SLOT(updateContent()));
410 
411  connect(stationsList_, SIGNAL(refClockStationSelected (const QString&)),
412  baselinesList_,SLOT (addRefClockStation (const QString&)));
413  connect(stationsList_, SIGNAL(refClockStationDeselected(const QString&)),
414  baselinesList_,SLOT (delRefClockStation (const QString&)));
415  // set up ref clocks if exist:
416  QMap<QString, SgVlbiStationInfo*>::const_iterator it=session_->stationsByName().constBegin();
417  for (; it!=session_->stationsByName().constEnd(); ++it)
418  {
419  SgVlbiStationInfo* stInfo = it.value();
422  };
423  //
424  connect(process,SIGNAL(clicked()), SLOT(process()));
425 #ifndef DEMO
426  //connect(clcF1, SIGNAL(clicked()), SLOT(calcClcF1()));
427 #endif
428  connect(ionoC_, SIGNAL(clicked()), SLOT(calcIono()));
429  connect(iono0_, SIGNAL(clicked()), SLOT(zeroIono()));
430  connect(dapCB, SIGNAL(clicked()), SLOT(detectAndProcessClockBreaks()));
431  connect(rmOut, SIGNAL(clicked()), SLOT(processRmOutButton()));
432  connect(scanAmbigs_, SIGNAL(clicked()), SLOT(scanAmbiguityMultipliers()));
433  connect(ok, SIGNAL(clicked()), SLOT(accept()));
434  connect(save, SIGNAL(clicked()), SLOT(saveData()));
435  connect(s2add0, SIGNAL(clicked()), SLOT(clearAuxSigmas()));
436  connect(reset, SIGNAL(clicked()), SLOT(clearAllEditings()));
437 
438 // if (session_->isAttr(SgVlbiSessionInfo::Attr_FF_ION_C_CALCULATED))
440  ionoC_->setEnabled(false);
441  else
442  iono0_->setEnabled(false);
443  //
445  //
446 // if (isImpossibleUpdateCat_)
447 // save->setEnabled(false);
448  isWidgetsBlocked_ = false;
449  widgets2Block_ << ok << process << ionoC_ << iono0_ << dapCB << rmOut << scanAmbigs_ << save
450  << s2add0;
451  // << cancel << clcF1 << rprt;
452  // set actual values:
453  setup.setLnfsFileName(fileName);
454  setup.setLnfsOriginType(oType);
456 
457  QShortcut *shCut;
458 
459  // These are still alt's:
460  shCut = new QShortcut(QKeySequence(tr("Alt+2")), this);
461  connect(shCut, SIGNAL(activated()), this, SLOT(process_2times()));
462  shCut = new QShortcut(QKeySequence(tr("Alt+3")), this);
463  connect(shCut, SIGNAL(activated()), this, SLOT(process_3times()));
464  shCut = new QShortcut(QKeySequence(tr("Alt+4")), this);
465  connect(shCut, SIGNAL(activated()), this, SLOT(process_4macro()));
466 
467  //
468  shCut = new QShortcut(QKeySequence(tr("Ctrl+a")), this);
469  connect(shCut, SIGNAL(activated()), this, SLOT(generateAposterioriFiles()));
470 
471  shCut = new QShortcut(QKeySequence(tr("Ctrl+g")), this);
472  connect(shCut, SIGNAL(activated()), this, SLOT(putDataToAgv()));
473 
474  shCut = new QShortcut(QKeySequence(tr("Ctrl+h")), this);
475  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport4StcPars()));
476 
477  shCut = new QShortcut(QKeySequence(tr("Ctrl+i")), this);
478  connect(shCut, SIGNAL(activated()), this, SLOT(displayExcludedObs()));
479 
480  shCut = new QShortcut(QKeySequence(tr("Ctrl+m")), this);
481  connect(shCut, SIGNAL(activated()), this, SLOT(makeMyAction()));
482 
483  shCut = new QShortcut(QKeySequence(tr("Ctrl+n")), this);
484  connect(shCut, SIGNAL(activated()), this, SLOT(exportDataToNgs()));
485 
486  shCut = new QShortcut(QKeySequence(tr("Ctrl+r")), this);
487  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport()));
488 
489  shCut = new QShortcut(QKeySequence(tr("Ctrl+Shift+r")), this); //
490  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport_Extended())); // mostly for tests
491 
492  shCut = new QShortcut(QKeySequence(tr("Ctrl+s")), this);
493  connect(shCut, SIGNAL(activated()), this, SLOT(saveIntermediateResults()));
494 
495  shCut = new QShortcut(QKeySequence(tr("Ctrl+t")), this);
496  connect(shCut, SIGNAL(activated()), this, SLOT(executeTestAction()));
497 
498  shCut = new QShortcut(QKeySequence(tr("Ctrl+z")), this);
499  connect(shCut, SIGNAL(activated()), this, SLOT(generateReport4Tzds()));
500 };
501 
502 
503 
504 //
506 {
507  // restore overwritten configs:
509  {
525  };
526  //
527 
528 // while (!plotCarriers4Baselines_.isEmpty())
529 // delete plotCarriers4Baselines_.takeFirst();
530  for (int i=0; i<plotCarriers4Baselines_.size(); i++)
531  delete plotCarriers4Baselines_.at(i);
532  plotCarriers4Baselines_.clear();
533 
535  {
536  delete plotCarrier4Stations_;
537  plotCarrier4Stations_ = NULL;
538  };
539 
541  {
542  delete plotCarrier4Session_;
543  plotCarrier4Session_ = NULL;
544  };
545 
546  setup.setSeWinWidth(width());
547  setup.setSeWinHeight(height());
548 };
549 
550 
551 
552 
553 // non-GUI and NsSessionHandler's reloads:
554 //
555 //
556 //
558 {
560 };
561 
562 
563 
564 //
566 {
568 };
569 
570 
571 
572 //
574 {
576 };
577 
578 
579 
580 //
582 {
584 };
585 
586 
587 
588 //
590 {
592 };
593 
594 
595 
596 //
598 {
600 };
601 
602 
603 
604 //
606 {
607  blockInput();
609  restoreInput();
610 };
611 
612 
613 
614 //
616 {
617  blockInput();
619  restoreInput();
620 };
621 
622 
623 
624 //
626 {
627  bool isOk;
628 
629  blockInput();
631  if (isOk)
632  postSave();
633  restoreInput();
634 
635  if (!isOk && saveStatus_==SS_FILE_EXISTS)
636  QMessageBox::warning(this, "Warning", "The database with the new version "
637  "already exists in the catalog.\nRemove it from the catalog and try again.");
638 
639  return isOk;
640 };
641 
642 
643 
644 //
646 {
647  //
648  bool isOk;
649 
650  blockInput();
652  if (isOk)
653  postSave();
654  restoreInput();
655 
656  return isOk;
657 };
658 
659 
660 
661 //
663 {
664  if (config_->getIsNoviceUser() &&
665  QMessageBox::warning(this, "Novice User Warning", "Do you want to save data?",
666  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
667  return;
668 
669  bool isOk(false);
670  //
672  isOk = exportDataIntoDbh();
673  else if (oType_ == SgVlbiSessionInfo::OT_VDB)
674  isOk = exportDataIntoVgosDb();
675  else if (oType_ == SgVlbiSessionInfo::OT_AGV) // export data in vgosDb format:
676  isOk = exportDataIntoVgosDb();
677  else
678  {
680  "::saveData(): unrecognized type of data");
681  return;
682  };
683  //
684  if (isOk &&
686  {
687  generateReport();
690  };
691 };
692 
693 
694 
695 //
697 {
698  if (saveStatus_ == SS_OK) // was already saved:
699  {
700  if (QMessageBox::warning(this, "Warning",
701  "This session already has been saved. "
702  "Do you want to save the session as a new version?",
703  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
704  return false;
705  };
706  //
707  if (!config_->getIsNoviceUser())
708  return true;
709  //
710  // help to new user:
711 // if (!session_->isAttr(SgVlbiSessionInfo::Attr_FF_ION_C_CALCULATED))
713  {
714  if (QMessageBox::warning(this, "Novice User Warning",
715  "No ionosphere corrections evaluated for the session. "
716  "Do you want to save the session anyway?",
717  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
718  return false;
719  };
721  {
722  if (QMessageBox::warning(this, "Novice User Warning",
723  "No additional weights were calculated for the session. "
724  "Do you want to save the session anyway?",
725  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
726  return false;
727  };
728  return true;
729 };
730 
731 
732 
733 //
735 {
736  isNeed2SaveSir_ = false;
737  // remove the file with intermediate results:
738  QString dirName=setup.path2(setup.getPath2IntermediateResults());
739  QDir d(dirName);
740  if (!d.exists())
741  return;
742  if (dirName.size()>0)
743  dirName += "/";
744  QFile file(dirName + session_->name4SirFile(setup.getHave2UpdateCatalog()));
745  if (file.exists())
746  file.remove();
750 };
751 
752 
753 
754 
755 // sess edit dialog's and GUI stuff:
756 //
757 //
759 {
761  QMessageBox::warning(this, "Warning", "There are unsaved data. Are you sure to close the window?",
762  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
763  return;
764 
765  //
766  // save intermediate results:
769  //
770 
771  QDialog::accept();
773  ": accept selected");
774  deleteLater();
775 };
776 
777 
778 
779 //
781 {
783  QMessageBox::warning(this, "Warning", "There are unsaved data. Are you sure to close the window?",
784  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
785  return;
786  //
787  // save intermediate results:
790  //
791  QDialog::reject();
793  ": reject selected");
794  deleteLater();
795 };
796 
797 
798 
799 //
801 {
802  if (!isWidgetsBlocked_)
803  {
804  isWidgetsBlocked_ = true;
805  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
806  for (int i=0; i<widgets2Block_.size(); i++)
807  widgets2Block_.at(i)->blockSignals(isWidgetsBlocked_);
808  };
809 };
810 
811 
812 
813 //
815 {
816  if (isWidgetsBlocked_)
817  {
818  isWidgetsBlocked_ = false;
819  QApplication::restoreOverrideCursor();
820  for (int i=0; i<widgets2Block_.size(); i++)
821  widgets2Block_.at(i)->blockSignals(isWidgetsBlocked_);
822  };
823 };
824 
825 
826 
827 //
829 {
830  QString str;
831  QWidget *w = new QWidget(this);
832  QBoxLayout *layout = new QHBoxLayout(w);
833  QLabel *label;
834  QGridLayout *grid;
835  QGroupBox *gbox;
836  QBoxLayout *subLayout;
837 
838  subLayout = new QVBoxLayout;
839  layout->addLayout(subLayout);
840 
841  // attributes:
842  gbox = new QGroupBox("Attributes of the session", w);
843  grid = new QGridLayout(gbox);
844 
845  label = new QLabel("Type of import file(s):", gbox);
846  label->setMinimumSize(label->sizeHint());
847  grid->addWidget(label, 0,0);
848  switch(session_->getOriginType())
849  {
851  str = "Mk-III database";
852  break;
854  str = "NGS cards";
855  break;
857  str = "vgosDB tree";
858  break;
860  str = "Mk4 correlator files";
861  break;
863  str = "KOMB correlator files";
864  break;
866  str = "VDA file";
867  break;
869  str = "unknown";
870  break;
871  };
872  label = new QLabel(str, gbox);
873  label->setMinimumSize(label->sizeHint());
874  grid->addWidget(label, 0,1);
875 
876  label = new QLabel("Official Name/Code:", gbox);
877  label->setMinimumSize(label->sizeHint());
878  grid->addWidget(label, 1,0);
879  label = new QLabel(session_->getOfficialName() + "/" + session_->getSessionCode(), gbox);
880  label->setMinimumSize(label->sizeHint());
881  grid->addWidget(label, 1,1);
882 
883  label = new QLabel("Experiment description:", gbox);
884  label->setMinimumSize(label->sizeHint());
885  grid->addWidget(label, 2,0);
886  str = session_->getDescription().simplified();
887  label = new QLabel(str!=""?str:QString(" "), gbox);
888  label->setMinimumSize(label->sizeHint());
889  grid->addWidget(label, 2,1);
890 
891  label = new QLabel("The session was scheduled at:", gbox);
892  label->setMinimumSize(label->sizeHint());
893  grid->addWidget(label, 3,0);
894  label = new QLabel(session_->getSchedulerName(), gbox);
895  label->setMinimumSize(label->sizeHint());
896  grid->addWidget(label, 3,1);
897 
898  label = new QLabel("Correlated by:", gbox);
899  label->setMinimumSize(label->sizeHint());
900  grid->addWidget(label, 4,0);
901  label = new QLabel(session_->getCorrelatorName(), gbox);
902  label->setMinimumSize(label->sizeHint());
903  grid->addWidget(label, 4,1);
904 
905  label = new QLabel("Responsibility of:", gbox);
906  label->setMinimumSize(label->sizeHint());
907  grid->addWidget(label, 5,0);
908  label = new QLabel(session_->getSubmitterName(), gbox);
909  label->setMinimumSize(label->sizeHint());
910  grid->addWidget(label, 5,1);
911 
912  label = new QLabel("Latest version created on:", gbox);
913  label->setMinimumSize(label->sizeHint());
914  grid->addWidget(label, 6,0);
915  label = new QLabel(session_->getTCreation().toString(SgMJD::F_Verbose), gbox);
916  label->setMinimumSize(label->sizeHint());
917  grid->addWidget(label, 6,1);
918 
919  label = new QLabel("Network ID:", gbox);
920  label->setMinimumSize(label->sizeHint());
921  grid->addWidget(label, 7,0);
922  QComboBox *cbNetID=new QComboBox(gbox);
923  // cbNetID->setInsertPolicy(QComboBox::InsertAtBottom);
924  cbNetID->setInsertPolicy(QComboBox::InsertAlphabetically);
925 
926  bool isTmp(false);
927  for (int i=0; i<networks.size(); i++)
928  {
929  cbNetID->addItem(networks.at(i).getName());
930  if (networks.at(i).getName() == session_->getNetworkID())
931  {
932  cbNetID->setCurrentIndex(i);
933  isTmp = true;
934  };
935  };
936  if (!isTmp) // a net ID from the session (default):
937  {
938  cbNetID->addItem(session_->getNetworkID());
939  cbNetID->setCurrentIndex(cbNetID->count() - 1);
940  };
941  cbNetID->setMinimumSize(cbNetID->sizeHint());
942  grid->addWidget(cbNetID, 7,1);
943  connect(cbNetID,
944  SIGNAL(currentIndexChanged(const QString&)), SLOT(netIdCurrentIndexChanged(const QString&)));
945  //
946 
947 
948 
949  label = new QLabel("Epoch of the first observation:", gbox);
950  label->setMinimumSize(label->sizeHint());
951  grid->addWidget(label, 8,0);
952  label = new QLabel(session_->getTStart().toString(SgMJD::F_Verbose), gbox);
953  label->setMinimumSize(label->sizeHint());
954  grid->addWidget(label, 8,1);
955 
956  label = new QLabel("Epoch of the last observation:", gbox);
957  label->setMinimumSize(label->sizeHint());
958  grid->addWidget(label, 9,0);
959  label = new QLabel(session_->getTFinis().toString(SgMJD::F_Verbose), gbox);
960  label->setMinimumSize(label->sizeHint());
961  grid->addWidget(label, 9,1);
962 
963  label = new QLabel("Mean epoch of observations:", gbox);
964  label->setMinimumSize(label->sizeHint());
965  grid->addWidget(label, 10,0);
966  label = new QLabel(session_->getTMean().toString(SgMJD::F_Verbose), gbox);
967  label->setMinimumSize(label->sizeHint());
968  grid->addWidget(label, 10,1);
969 
970  label = new QLabel("Reference epoch:", gbox);
971  label->setMinimumSize(label->sizeHint());
972  grid->addWidget(label, 11,0);
973  label = new QLabel(session_->tRefer().toString(SgMJD::F_Verbose), gbox);
974  label->setMinimumSize(label->sizeHint());
975  grid->addWidget(label, 11,1);
976 
977  label = new QLabel("Interval of observations:", gbox);
978  label->setMinimumSize(label->sizeHint());
979  grid->addWidget(label, 12,0);
980  label = new QLabel(interval2Str(session_->getTFinis() - session_->getTStart()), gbox);
981  label->setMinimumSize(label->sizeHint());
982  grid->addWidget(label, 12,1);
983 
984  subLayout->addWidget(gbox);
985 
986 
987  // parameters:
988  gbox = new QGroupBox("Parameters", w);
989  grid = new QGridLayout(gbox);
990 
991  label = new QLabel("User Flag:", gbox);
992  label->setMinimumSize(label->sizeHint());
993  grid->addWidget(label, 0,0);
994 
995  QComboBox *userFlag = new QComboBox(gbox);
996  userFlag->setInsertPolicy(QComboBox::InsertAtBottom);
997 
998  const char* sUFlags[] =
999  {
1000  "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
1001  "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
1002  };
1003  for (int i=0; i<(int)(sizeof(sUFlags)/sizeof(const char*)); i++)
1004  {
1005  userFlag->addItem(sUFlags[i]);
1006  if (sUFlags[i] == session_->getUserFlag())
1007  userFlag->setCurrentIndex(i);
1008  };
1009  userFlag->setMinimumSize(userFlag->sizeHint());
1010  grid->addWidget(userFlag, 0,1);
1011  subLayout->addWidget(gbox);
1012 
1013  // bands:
1014  gbox = new QGroupBox("Bands", w);
1015  grid = new QGridLayout(gbox);
1016 
1017  label = new QLabel("<b>ID</b>", gbox);
1018  label->setAlignment(Qt::AlignCenter);
1019  grid->addWidget(label, 0, 0);
1020  //
1021  label = new QLabel("<b>Freq</b>", gbox);
1022  label->setAlignment(Qt::AlignCenter);
1023  grid->addWidget(label, 0, 1);
1024  //
1025 
1026 /*
1027  label = new QLabel("<b>Prime</b>", gbox);
1028  label->setAlignment(Qt::AlignCenter);
1029  grid->addWidget(label, 0, 2);
1030 */
1031 // label = new QLabel("<b>Omit</b>", gbox);
1032 // label->setAlignment(Qt::AlignCenter);
1033 // grid->addWidget(label, 0, 3);
1034 
1035  //
1036  label = new QLabel("<b>Ver</b>", gbox);
1037  label->setAlignment(Qt::AlignCenter);
1038  grid->addWidget(label, 0, 2);
1039  //
1040  label = new QLabel("<b>File</b>", gbox);
1041  label->setAlignment(Qt::AlignCenter);
1042  grid->addWidget(label, 0, 3);
1043  //
1044  label = new QLabel("<b>Created on</b>", gbox);
1045  label->setAlignment(Qt::AlignCenter);
1046  grid->addWidget(label, 0, 4);
1047  //
1048  label = new QLabel("<b>CALC ver</b>", gbox);
1049  label->setAlignment(Qt::AlignCenter);
1050  grid->addWidget(label, 0, 5);
1051  //
1052  label = new QLabel("<b>#Total/Used</b>", gbox);
1053  label->setAlignment(Qt::AlignCenter);
1054  grid->addWidget(label, 0, 6);
1055  //
1056 // label = new QLabel("<b>#Used</b>", gbox);
1057 // label->setAlignment(Qt::AlignCenter);
1058 // grid->addWidget(label, 0, 8);
1059 
1060  //
1061  label = new QLabel("<b>#Par/#C</b>", gbox);
1062  label->setAlignment(Qt::AlignCenter);
1063  grid->addWidget(label, 0, 7);
1064 
1065 
1066  //
1067  label = new QLabel("<b>WRMS</b>(ps)", gbox);
1068  label->setAlignment(Qt::AlignCenter);
1069  grid->addWidget(label, 0, 8);
1070  //
1071  label = new QLabel("<p><b>&sigma;<sub>0</sub><b></p>", gbox);
1072  label->setAlignment(Qt::AlignCenter);
1073  grid->addWidget(label, 0, 9);
1074  //
1075  label = new QLabel("<p><b>&chi;<sup>2</sup><b></p>", gbox);
1076  label->setAlignment(Qt::AlignCenter);
1077  grid->addWidget(label, 0, 10);
1078 
1079 /*
1080  QButtonGroup *bgPrimaryBands = new QButtonGroup(gbox);
1081  QRadioButton *rbPrimaryBand = NULL;
1082 */
1083 
1084 // QCheckBox *cbIgnore = NULL;
1085  for (int i=0; i<session_->numberOfBands(); i++)
1086  {
1087  SgVlbiBand* band=session_->bands().at(i);
1088 
1089  label = new QLabel(band->getKey(), gbox);
1090  label->setAlignment(Qt::AlignCenter);
1091  grid->addWidget(label, 1+i, 0);
1092  //
1093  label = new QLabel(str.sprintf("%6.1f", band->getFrequency()), gbox);
1094  label->setAlignment(Qt::AlignRight);
1095  grid->addWidget(label, 1+i, 1);
1096  //
1097 /*
1098  rbPrimaryBand = new QRadioButton(gbox);
1099  bgPrimaryBands->addButton(rbPrimaryBand, i);
1100  if (band->isAttr(SgVlbiBand::Attr_PRIMARY))
1101  rbPrimaryBand->setChecked(true);
1102  grid->addWidget(rbPrimaryBand, 1+i, 2);
1103 */
1104 
1105 
1106  //
1107 // cbIgnore = new QCheckBox(this);
1108 // if (band->isAttr(SgVlbiBand::Attr_NOT_VALID))
1109 // cbIgnore->setChecked(true);
1110 // grid->addWidget(cbIgnore, 1+i, 3);
1111  //
1112  label = new QLabel(str.sprintf("%3d", band->getInputFileVersion()), gbox);
1113  label->setAlignment(Qt::AlignCenter);
1114  grid->addWidget(label, 1+i, 2);
1115  //
1116  label = new QLabel(band->getInputFileName(), gbox);
1117  label->setAlignment(Qt::AlignCenter);
1118  grid->addWidget(label, 1+i, 3);
1119  //
1120  label = new QLabel(band->getTCreation().toString(SgMJD::F_Simple), gbox);
1121  label->setAlignment(Qt::AlignCenter);
1122  grid->addWidget(label, 1+i, 4);
1123  //
1124  label = new QLabel(str.sprintf("%g", session_->calcInfo().getDversion()), gbox);
1125  label->setAlignment(Qt::AlignCenter);
1126  grid->addWidget(label, 1+i, 5);
1127  //
1128  label = new QLabel(str.sprintf("%3d/%3d",
1129  band->observables().count(), band->numProcessed(DT_DELAY)), gbox);
1130  labelsPrc_.append(label);
1131  label->setAlignment(Qt::AlignCenter);
1132  grid->addWidget(label, 1+i, 6);
1133  //
1134 // label = new QLabel(str.sprintf("%3d", band->getNumOfProcessedObs()), gbox);
1135 // labelsPrc_.append(label);
1136 // label->setAlignment(Qt::AlignCenter);
1137 // grid->addWidget(label, 1+i, 8);
1138  //
1139  label = new QLabel(str.sprintf("%d/%d",
1141  labelsPar_.append(label);
1142  label->setAlignment(Qt::AlignCenter);
1143  grid->addWidget(label, 1+i, 7);
1144  //
1145  label = new QLabel(str.sprintf("%.1f", band->wrms(DT_DELAY)*scale4Delay_*1.0E3), gbox);
1146  labelsWRMS_.append(label);
1147  label->setAlignment(Qt::AlignCenter);
1148  grid->addWidget(label, 1+i, 8);
1149  //
1150  label = new QLabel(str.sprintf("%.1f", band->getSigma2add(DT_DELAY)*scale4Delay_*1.0E3), gbox);
1151  labelsSig0_.append(label);
1152  label->setAlignment(Qt::AlignCenter);
1153  grid->addWidget(label, 1+i, 9);
1154  //
1155  label = new QLabel(str.sprintf("%.2f",
1156  session_->getNumOfDOF()>0.0?band->chi2(DT_DELAY)/session_->getNumOfDOF():0.0), gbox);
1157  labelsChi2_.append(label);
1158  label->setAlignment(Qt::AlignCenter);
1159  grid->addWidget(label, 1+i, 10);
1160  };
1161  grid->setHorizontalSpacing(grid->horizontalSpacing() + 20);
1162  subLayout->addWidget(gbox);
1163  subLayout->addStretch(1);
1164  layout->addStretch(5);
1165  //
1166 
1167 /*
1168  connect(bgPrimaryBands, SIGNAL(buttonClicked(int)), SLOT(changePrimaryBand(int)));
1169 */
1170 
1171  //
1172  return w;
1173 };
1174 
1175 
1176 
1177 //
1179 {
1180  session_->setNetworkID(str);
1182  ": netIdCurrentIndexChanged(): the networkID of the session has been changed to `" + str + "'");
1183 };
1184 
1185 
1186 
1187 //
1189 {
1191  connect(this, SIGNAL(activeBandChanged(int)), configWidget_, SLOT(updateActiveBandSelection(int)));
1192  connect(this, SIGNAL(delayTypeChanged(int)), configWidget_, SLOT(updateDelayTypeSelection(int)));
1193  connect(configWidget_, SIGNAL(delayTypeModified(SgTaskConfig::VlbiDelayType)),
1195 
1196  connect(configWidget_, SIGNAL(clocksModelChanged(SgParameterCfg::PMode)),
1198  connect(configWidget_, SIGNAL(zenithModelChanged(SgParameterCfg::PMode)),
1200 
1201  return configWidget_;
1202 };
1203 
1204 
1205 
1206 //
1208 {
1209  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
1210  it!=session_->stationsByName().end(); ++it)
1211  {
1212  SgVlbiStationInfo *si=it.value();
1213  si->pcClocks()->setPMode(mode);
1214  };
1215 };
1216 
1217 
1218 
1219 //
1221 {
1222  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
1223  it!=session_->stationsByName().end(); ++it)
1224  {
1225  SgVlbiStationInfo *si=it.value();
1226  si->pcZenith()->setPMode(mode);
1227  };
1228 };
1229 
1230 
1231 
1232 //
1234 {
1235  QTabWidget *w = new QTabWidget(this);
1236 // w->setTabPosition(QTabWidget::South);
1237  w->setTabPosition(QTabWidget::East);
1238  for (int i=0; i<session_->numberOfBands(); i++)
1239  {
1240  w->addTab(tab4Band(session_->bands().at(i)), session_->bands().at(i)->getKey() + "-Band");
1241  };
1242  connect(w, SIGNAL(currentChanged(int)), this, SLOT(changeActiveBand(int)));
1243  connect(configWidget_, SIGNAL(activeBandModified(int)), w, SLOT(setCurrentIndex(int)));
1244  return w;
1245 };
1246 
1247 
1248 
1249 //
1251 {
1252  SgGuiVlbiStationList *stnInfoList;
1253  SgGuiVlbiSourceList *srcInfoList;
1254  SgGuiVlbiBaselineList *baselineInfoList;
1255 
1256  QTabWidget *w = new QTabWidget(this);
1257  w->setTabPosition(QTabWidget::South);
1258  w->addTab(tab4BandPlots(band), "Data");
1259  stnInfoList = new SgGuiVlbiStationList(OBM_BAND, band->getKey(), &band->stationsByName(),
1260  session_->getTStart(), this);
1261  srcInfoList = new SgGuiVlbiSourceList(OBM_BAND, band->getKey(), &band->sourcesByName(), this);
1262  baselineInfoList = new SgGuiVlbiBaselineList(session_, config_, OBM_BAND, &band->baselinesByName(),
1263  this);
1264  w->addTab(stnInfoList, "Stations");
1265  w->addTab(srcInfoList, "Sources");
1266  w->addTab(baselineInfoList, "Baselines");
1267  w->addTab(new SgGuiVlbiHistory(&band->history(), this), "History");
1268 // stnInfoList->setWrmsScale(scale4Delay_*1.0E3);
1269 // srcInfoList->setWrmsScale(scale4Delay_*1.0E3);
1270 // baselineInfoList->setWrmsScale(scale4Delay_*1.0E3);
1271  connect(this, SIGNAL(dataChanged()), stnInfoList, SLOT(updateContent()));
1272  connect(this, SIGNAL(dataChanged()), srcInfoList, SLOT(updateContent()));
1273  connect(this, SIGNAL(dataChanged()), baselineInfoList, SLOT(updateContent()));
1274  return w;
1275 };
1276 
1277 
1278 
1279 //
1281 {
1282  QList<SgVlbiObservable*> *observables=NULL;
1283  QString title("");
1284  QString str("");
1285  title = band->getKey() + "-band of the session " + session_->getName() + ", baselines";
1286 
1287 #ifdef DEMO
1288  SgPlotCarrier* carrier = new SgPlotCarrier( 20, 11, title);
1289 #else
1290  SgPlotCarrier* carrier = new SgPlotCarrier( 33, 11, title);
1291 #endif
1292  plotCarriers4Baselines_.append(carrier);
1293  str = title + " (group delay ambig.spacing: " + band->strGrdAmbigsStat() + " [ns])";
1294  carrier->setName(str, BPI_RES_GRD);
1295  carrier->setName(str, BPI_GR_DELAY);
1296  carrier->setName(str, BPI_ION_GRD);
1297  carrier->setName(str, BPI_AMBIG_GR_SPACING);
1298  carrier->setName(str, BPI_AMBIG_GR_NUMBER);
1299  str = title + " (phase delay ambig.spacing: " + band->strPhdAmbigsStat() + " [ns])";
1300  carrier->setName(str, BPI_RES_PHD);
1301  carrier->setName(str, BPI_ION_PHD);
1302  carrier->setName(str, BPI_AMBIG_PH_SPACING);
1303  carrier->setName(str, BPI_AMBIG_PH_NUMBER);
1304 
1305  carrier->setFile2SaveBaseName(session_->getName() + "_baselines_" + band->getKey() + "-band");
1306 
1307  // names of columns:
1308  // epoch:
1309  carrier->setNameOfColumn(BPI_EPOCH, "Time (UTC)");
1311  // values:
1312  carrier->setNameOfColumn(BPI_RES_SBD, "Res: SB delay, ns");
1313  carrier->setNameOfColumn(BPI_RES_GRD, "Res: GR delay, ns");
1314  carrier->setNameOfColumn(BPI_RES_PHD, "Res: PH delay, ns");
1315  carrier->setNameOfColumn(BPI_RES_PHR, "Res: PH rate, fs/s");
1316  carrier->setNameOfColumn(BPI_GR_DELAY, "Group delay, ns");
1317  carrier->setNameOfColumn(BPI_PH_RATE, "Delay rate, fs/s");
1318  carrier->setNameOfColumn(BPI_ION_SBD, "Iono SB delay, ns");
1319  carrier->setNameOfColumn(BPI_ION_GRD, "Iono GR delay, ns");
1320  carrier->setNameOfColumn(BPI_ION_PHD, "Iono PH delay, ns");
1321  carrier->setNameOfColumn(BPI_ION_PHR, "Iono PH rate, fs/s");
1322  carrier->setNameOfColumn(BPI_ION_DTEC, "Iono dTEK");
1323  carrier->setNameOfColumn(BPI_CORR_COEF, "Corr.Coeff.");
1324  carrier->setNameOfColumn(BPI_SNR, "SNR");
1325  // sigmas:
1326  carrier->setNameOfColumn(BPI_SIG_SBD, "Sigma of SB delay, ns");
1327  carrier->setNameOfColumn(BPI_SIG_GRD, "Sigma of GR delay, ns");
1328  carrier->setNameOfColumn(BPI_SIG_DEL_APPLIED, "Applied GR delay sigma, ns");
1329  carrier->setNameOfColumn(BPI_SIG_RAT_APPLIED, "Applied PH rate sigma, fs/s");
1330  carrier->setNameOfColumn(BPI_SIG_PHR, "Sigma of delay rate, fs/s");
1331  carrier->setNameOfColumn(BPI_SIG_PHD, "Sigma of PH delay, ns");
1332  carrier->setNameOfColumn(BPI_SIG_ION_SBD, "Sigma of Iono SB delay, ns");
1333  carrier->setNameOfColumn(BPI_SIG_ION_GRD, "Sigma of Iono GR delay, ns");
1334  carrier->setNameOfColumn(BPI_SIG_ION_PHD, "Sigma of Iono PH delay, ns");
1335  carrier->setNameOfColumn(BPI_SIG_ION_PHR, "Sigma of Iono PH rate, fs/s");
1336  carrier->setNameOfColumn(BPI_SIG_ION_DTEC, "Sigma of Iono dTEK");
1337  //
1338  carrier->setNameOfColumn(BPI_RES_NORM_DEL, "Normalized delay residuals");
1339  carrier->setNameOfColumn(BPI_RES_NORM_RAT, "Normalized rate residuals");
1340  carrier->setNameOfColumn(BPI_AMBIG_GR_SPACING,"Ambig GR spacing, ns");
1341  carrier->setNameOfColumn(BPI_AMBIG_GR_NUMBER, "Ambig GR #");
1342  carrier->setNameOfColumn(BPI_AMBIG_PH_SPACING,"Ambig PH spacing, ns");
1343  carrier->setNameOfColumn(BPI_AMBIG_PH_NUMBER, "Ambig PH #");
1344 #ifndef DEMO
1345  carrier->setNameOfColumn(BPI_EFF_FRQ_GRD, "GR Eff Freq, MHZ");
1346  carrier->setNameOfColumn(BPI_EFF_FRQ_PHD, "PH Eff Freq, MHZ");
1347  carrier->setNameOfColumn(BPI_EFF_FRQ_PHR, "RT Eff Freq, MHZ");
1348  //
1349  //carrier->setNameOfColumn(BPI_S_DIFF, "sDiff");
1350  //carrier->setNameOfColumn(BPI_X_DIFF, "xDiff");
1351  //carrier->setNameOfColumn(BPI_R_DIFF, "rDiff");
1352  //carrier->setNameOfColumn(BPI_GRD_SBD, "GRD-SBD");
1353  //carrier->setNameOfColumn(BPI_Q_SBD, "qSBD");
1354  //carrier->setNameOfColumn(BPI_Q_GRD, "qGRD");
1355  //carrier->setNameOfColumn(BPI_Q_PHR, "qPHR");
1356  //carrier->setNameOfColumn(BPI_CLK_1, "ClcF#1");
1357  //carrier->setNameOfColumn(BPI_CLK_1L, "ClcF#1_left");
1358  //carrier->setNameOfColumn(BPI_CLK_1R, "ClcF#1_right");
1359  carrier->setNameOfColumn(BPI_QF, "QF");
1360  carrier->setNameOfColumn(BPI_FEC, "Frng Error Code");
1361  carrier->setNameOfColumn(BPI_PCAL_GR_DEL_1, "PCal:GrDel@1");
1362  carrier->setNameOfColumn(BPI_PCAL_PH_DEL_1, "PCal:PhDel@1");
1363  carrier->setNameOfColumn(BPI_PCAL_GR_DEL_2, "PCal:GrDel@2");
1364  carrier->setNameOfColumn(BPI_PCAL_PH_DEL_2, "PCal:PhDel@2");
1365  carrier->setNameOfColumn(BPI_U, "U");
1366  carrier->setNameOfColumn(BPI_V, "V");
1367  carrier->setNameOfColumn(BPI_TAUS, "tauS, ns");
1368  carrier->setNameOfColumn(BPI_TEST, "Test");
1369 
1370 #endif
1371  // set up sigmas:
1383 
1384  // create branches and fill data:
1385  carrier->listOfBranches()->clear();
1386  title = band->getKey() + "-band of the session " + session_->getName() + "; ";
1387  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
1388  for (; it!=band->baselinesByName().constEnd(); ++it)
1389  {
1390  SgVlbiBaselineInfo *baselineInfo=it.value();
1391  observables = &baselineInfo->observables();
1392  carrier->createBranch(observables->size(), baselineInfo->getKey(), true);
1393  SgPlotBranch *branch=carrier->listOfBranches()->last();
1394  //
1395  // group delays ambigs info:
1396  str = title + baselineInfo->getKey() + " (ambig. spacing: " +
1397  baselineInfo->strGrdAmbigsStat() + " [ns])";
1398  branch->setAlternativeTitleName(str, BPI_RES_GRD);
1399  branch->setAlternativeTitleName(str, BPI_GR_DELAY);
1402  // phase delays ambigs info:
1403  str = title + baselineInfo->getKey() + " (ambig. spacing: " +
1404  baselineInfo->strPhdAmbigsStat() + " [ns])";
1405  branch->setAlternativeTitleName(str, BPI_RES_PHD);
1408 
1409  //
1410  QList<SgVlbiObservable*>::const_iterator jt=observables->constBegin();
1411  for (int idx=0; jt!=observables->constEnd(); ++jt, idx++)
1412  {
1413  SgVlbiObservable *o=*jt;
1414  //
1416  {
1419  else
1421  if (o->isUsable())
1423  else
1425  };
1426  //
1427  // epoch:
1428  branch->data()->setElement(idx, BPI_EPOCH, o->epoch().toDouble());
1429  // residuals:
1430  branch->data()->setElement(idx, BPI_RES_SBD, o->sbDelay().getResidual()*scale4Delay_);
1431  branch->data()->setElement(idx, BPI_RES_GRD, o->grDelay().getResidual()*scale4Delay_);
1432  branch->data()->setElement(idx, BPI_RES_PHD, o->phDelay().getResidual()*scale4Delay_);
1433  branch->data()->setElement(idx, BPI_RES_PHR, o->phDRate().getResidual()*scale4Rate_);
1434  // values:
1435  branch->data()->setElement(idx, BPI_GR_DELAY,o->grDelay().getValue() *scale4Delay_);
1436  branch->data()->setElement(idx, BPI_PH_RATE, o->phDRate().getValue() *scale4Rate_);
1437  // ionospheric corrections:
1438  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
1439  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
1440  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
1441  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
1442  branch->data()->setElement(idx, BPI_ION_DTEC,o->owner()->getDTec());
1443  //
1444  branch->data()->setElement(idx, BPI_CORR_COEF, o->getCorrCoeff());
1445  branch->data()->setElement(idx, BPI_SNR, o->getSnr());
1446  // sigmas:
1447  branch->data()->setElement(idx, BPI_SIG_SBD, o->sbDelay().getSigma()*scale4Delay_);
1448  branch->data()->setElement(idx, BPI_SIG_GRD, o->grDelay().getSigma()*scale4Delay_);
1449  branch->data()->setElement(idx, BPI_SIG_PHD, o->phDelay().getSigma()*scale4Delay_);
1450  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
1452  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
1454  branch->data()->setElement(idx, BPI_SIG_PHR, o->phDRate().getSigma() *scale4Rate_);
1455  // iono's sigmas:
1460  branch->data()->setElement(idx, BPI_SIG_ION_DTEC, o->owner()->getDTecStdDev());
1461  //
1462 // branch->data()->setElement(idx, BPI_NORM_RESID, o->grDelay().getResidualNorm());
1463  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
1464  o->activeDelay()->getResidualNorm():0.0);
1465  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
1466  branch->data()->setElement(idx, BPI_AMBIG_GR_SPACING,
1468  branch->data()->setElement(idx, BPI_AMBIG_GR_NUMBER,
1469  o->grDelay().getNumOfAmbiguities());
1470  branch->data()->setElement(idx, BPI_AMBIG_PH_SPACING,
1472  branch->data()->setElement(idx, BPI_AMBIG_PH_NUMBER,
1473  o->phDelay().getNumOfAmbiguities());
1474 #ifndef DEMO
1475  branch->data()->setElement(idx, BPI_EFF_FRQ_GRD, o->grDelay().getEffFreq());
1476  branch->data()->setElement(idx, BPI_EFF_FRQ_PHD, o->phDelay().getEffFreq());
1477  branch->data()->setElement(idx, BPI_EFF_FRQ_PHR, o->phDRate().getEffFreq());
1478 
1479  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
1480  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
1481  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
1482  //branch->data()->setElement(idx, BPI_GRD_SBD, (o->grDelay().getValue() +
1483  // o->grDelay().ambiguity() +
1484  // o->grDelay().getIonoValue() - o->sbDelay().getValue())*scale4Delay_);
1485  //branch->data()->setElement(idx, BPI_Q_SBD, o->getSbdQ());
1486  //branch->data()->setElement(idx, BPI_Q_GRD, o->getGrdQ());
1487  //branch->data()->setElement(idx, BPI_Q_PHR, o->getPhrQ());
1488  //branch->data()->setElement(idx, BPI_CLK_1, o->owner()->getBaselineClock_F1()*scale4Delay_);
1489  //branch->data()->setElement(idx, BPI_CLK_1L, o->owner()->getBaselineClock_F1l()*scale4Delay_);
1490  //branch->data()->setElement(idx, BPI_CLK_1R, o->owner()->getBaselineClock_F1r()*scale4Delay_);
1491  branch->data()->setElement(idx, BPI_QF, o->getQualityFactor());
1492  branch->data()->setElement(idx, BPI_FEC, o->errorCode2Int());
1497  branch->data()->setElement(idx, BPI_U, o->getUvFrPerAsec(0));
1498  branch->data()->setElement(idx, BPI_V, o->getUvFrPerAsec(1));
1499  branch->data()->setElement(idx, BPI_TAUS, o->getTauS()*scale4Delay_);
1500  branch->data()->setElement(idx, BPI_TEST, o->getTest());
1501 
1502  branch->setExtKey(idx, o->src()->getKey());
1503 #endif
1504  };
1505  };
1506 
1507  // widgets:
1508  QWidget *w = new QWidget(this);
1509  unsigned int plotterModes;
1512  plotterModes |= SgPlot::PM_EXT_KEY_SELECT;
1513 
1514  SgPlot *plot = new SgPlot(carrier, setup.path2(setup.getPath2PlotterOutput()), w, plotterModes);
1516  //
1517  QList<QString> filters, filtersAux, filtersExt;
1518  QString blNames("");
1519  for (BaselinesByName_it it=session_->baselinesByName().begin();
1520  it!=session_->baselinesByName().end(); ++it)
1521  blNames += it.value()->getKey() + ",";
1522  for (StationsByName_it it=session_->stationsByName().begin();
1523  it!=session_->stationsByName().end(); ++it)
1524  {
1525  filters << it.value()->getKey();
1526  QString key=it.value()->getKey() + ":";
1527  if (blNames.contains(key))
1528  filtersAux << key;
1529  key = ":" + it.value()->getKey();
1530  if (blNames.contains(key))
1531  filtersAux << key;
1532  };
1533  for (SourcesByName_it it=session_->sourcesByName().begin();
1534  it!=session_->sourcesByName().end(); ++it)
1535  filtersExt << it.value()->getKey();
1536  plot->setFilterNames(filters);
1537  plot->setFilterAuxNames(filtersAux);
1538  plot->setFilterExtNames(filtersExt);
1539  //
1540  plots4Baselines_.append(plot);
1541  QBoxLayout *layout = new QVBoxLayout(w);
1542  layout->addWidget(plot);
1543  connect(plot, SIGNAL(userPressedAKey(SgPlot*, Qt::KeyboardModifiers, int)),
1544  SLOT (dispatchUserKey(SgPlot*, Qt::KeyboardModifiers, int)));
1545  connect(plot, SIGNAL(yAxisChanged(int)), SLOT(dispatchChangeOfYAxis(int)));
1546  connect(plot, SIGNAL(pointInfoRequested(SgPlot*, SgPlotBranch*, int, int, int)),
1547  SLOT (displayPointInfo(SgPlot*, SgPlotBranch*, int, int, int)));
1548  return w;
1549 };
1550 
1551 
1552 
1553 //
1555 {
1556  QMap<QString, SgVlbiAuxObservation*> *auxObservationsByScan=NULL;
1557  int numOfIfs = session_->skyFreqByIfId().size();
1558  QList<QString> ifIds=session_->skyFreqByIfId().keys();
1559  QList<double> ifFrqs=session_->skyFreqByIfId().values();
1560 
1561 
1562  // check for presence of tsyses:
1563  bool hasTsyses=false;
1564  QMap<QString, SgVlbiStationInfo*>::const_iterator
1565  it=session_->stationsByName().constBegin();
1566  for (; it!=session_->stationsByName().constEnd(); ++it)
1567  if (it.value()->isAttr(SgVlbiStationInfo::Attr_HAS_TSYS))
1568  hasTsyses = true;
1569  if (!hasTsyses)
1570  numOfIfs = 0;
1571  //
1572 
1573 #ifndef DEMO
1574  plotCarrier4Stations_ = new SgPlotCarrier( 14 + numOfIfs, 6, "Plots for the session " +
1575  session_->getName() + ", station view");
1576 #else
1577  plotCarrier4Stations_ = new SgPlotCarrier( 13, 4, "Plots for the session " +
1578  session_->getName() + ", station view");
1579 #endif
1581 
1582  // names of columns:
1587  plotCarrier4Stations_->setNameOfColumn(SPI_MET_PRESS, "Met.: press., mb");
1588  plotCarrier4Stations_->setNameOfColumn(SPI_MET_HUMID, "Met.: rel.hum., %");
1593 // plotCarrier4Stations_->setNameOfColumn(SPI_EST_WZD, "Est.Zenith, cm");
1595  plotCarrier4Stations_->setNameOfColumn(SPI_EST_GRN, "Est.AtmGrd:N, cm");
1596  plotCarrier4Stations_->setNameOfColumn(SPI_EST_GRE, "Est.AtmGrd:E, cm");
1598  // sigmas:
1601  plotCarrier4Stations_->setNameOfColumn(SPI_SIG_EST_GRN, "Sigma of atmGrd:N");
1602  plotCarrier4Stations_->setNameOfColumn(SPI_SIG_EST_GRE, "Sigma of atmGrd:E");
1609 
1610 #ifndef DEMO
1611  plotCarrier4Stations_->setNameOfColumn(SPI_RES_GRD, "Res: GrDelay, ps");
1612  plotCarrier4Stations_->setNameOfColumn(SPI_SIG_GRD, "Sigma of GrD resid");
1614  for (int i=0; i<numOfIfs; i++)
1615  plotCarrier4Stations_->setNameOfColumn(SPI_SIG_GRD + 1 + i, "Tsys @IF " + ifIds.at(i) +
1616  QString("").sprintf(", %.2fMHz", ifFrqs.at(i)));
1617 #endif
1618 
1619 
1620  // create branches and fill data:
1622  for (it=session_->stationsByName().constBegin(); it!=session_->stationsByName().constEnd(); ++it)
1623  {
1624  SgVlbiStationInfo* stationInfo=it.value();
1625  QMap<int, int> frq2if;
1626  for (int i=0; i<ifFrqs.size(); i++)
1627  {
1628  frq2if[i] = -1;
1629  for (int j=0; j<stationInfo->tsysIfFreqs().size(); j++)
1630  if (fabs(ifFrqs.at(i) - stationInfo->tsysIfFreqs().at(j)) < 0.01)
1631  frq2if[i] = j;
1632  };
1633 
1634  auxObservationsByScan = stationInfo->auxObservationByScanId();
1635  plotCarrier4Stations_->createBranch(auxObservationsByScan->size(), stationInfo->getKey());
1637  //
1638  QMap<QString, SgVlbiAuxObservation*>::const_iterator jt=auxObservationsByScan->constBegin();
1639  for (int idx=0; jt!=auxObservationsByScan->constEnd(); ++jt, idx++)
1640  {
1641  SgVlbiAuxObservation *auxObs=jt.value();
1642 
1643  branch->data()->setElement(idx, SPI_EPOCH, auxObs->toDouble());
1644  branch->data()->setElement(idx, SPI_CABLE_CAL, auxObs->getCableCalibration()*1.0e12);
1645  branch->data()->setElement(idx, SPI_MET_TEMP, auxObs->getMeteoData().getTemperature());
1646  branch->data()->setElement(idx, SPI_MET_PRESS, auxObs->getMeteoData().getPressure());
1647  branch->data()->setElement(idx, SPI_MET_HUMID, auxObs->getMeteoData().getRelativeHumidity()*
1648  100.0);
1649  branch->data()->setElement(idx, SPI_AZIMUTH, auxObs->getAzimuthAngle()*RAD2DEG);
1650  branch->data()->setElement(idx, SPI_ELEVATION, auxObs->getElevationAngle()*RAD2DEG);
1651  branch->data()->setElement(idx, SPI_PARALLACTIC, auxObs->getParallacticAngle()*RAD2DEG);
1652  branch->data()->setElement(idx, SPI_EST_CLK, auxObs->getEstClocks());
1653  branch->data()->setElement(idx, SPI_EST_WZD, auxObs->getEstZenithDelay()*1.0e10/vLight);
1654  branch->data()->setElement(idx, SPI_EST_GRN, auxObs->getEstAtmGradN());
1655  branch->data()->setElement(idx, SPI_EST_GRE, auxObs->getEstAtmGradE());
1656  branch->data()->setElement(idx, SPI_TOT_ZDEL, (auxObs->getZenithDelayH() +
1657  auxObs->getZenithDelayW())*100.0 +
1658  auxObs->getEstZenithDelay());
1659  branch->data()->setElement(idx, SPI_SIG_EST_CLK, auxObs->getEstClocksSigma());
1660  branch->data()->setElement(idx, SPI_SIG_EST_WZD, auxObs->getEstZenithDelaySigma()*1.0e10/vLight);
1661  branch->data()->setElement(idx, SPI_SIG_EST_GRN, auxObs->getEstAtmGradNSigma());
1662  branch->data()->setElement(idx, SPI_SIG_EST_GRE, auxObs->getEstAtmGradESigma());
1663  branch->data()->setElement(idx, SPI_SIG_TOT_ZDEL, auxObs->getEstZenithDelaySigma());
1664 #ifndef DEMO
1665  SgVlbiObservation *obs=auxObs->getOwner();
1666  SgVlbiObservable *o=obs?obs->activeObs():NULL;
1667  if (o)
1668  {
1669  branch->data()->setElement(idx, SPI_RES_GRD, o->grDelay().getResidual()*scale4Delay_*1.0e3);
1670  branch->data()->setElement(idx, SPI_SIG_GRD, o->grDelay().sigma2Apply()*scale4Delay_*1.0e3);
1671  };
1672 
1673  for (int i=0; i<numOfIfs; i++)
1674  if (-1 < frq2if[i])
1675  branch->data()->setElement(idx, SPI_SIG_GRD + 1 + i,
1676  auxObs->tSyses()->getElement(frq2if[i]));
1677 #endif
1678 // if (auxObs->getElevationAngle()<-9.0)
1679 // branch->addDataAttr(idx, SgPlotCarrier::DataAttr_IGNORE);
1680 // if (auxObs->meteoData().isAttr(SgMeteoData::Attr_ARTIFICIAL_DATA))
1681 // branch->addDataAttr(idx, SgPlotCarrier::DataAttr_IGNORE);
1682  };
1683  };
1684 
1685  // widgets:
1686  QWidget *w = new QWidget(this);
1689  QBoxLayout *layout = new QVBoxLayout(w);
1690  layout->addWidget(plot4Stations_);
1691 
1692  return w;
1693 };
1694 
1695 
1696 
1697 //
1698 //
1700 {
1701  QWidget *w=new QWidget(this);
1702 
1703 
1704  plotCarrier4Session_ = new SgPlotCarrier( 7, 3, "Plots for the session " +
1705  session_->getName() + ", session wide data");
1706 
1708 
1709  // names of columns:
1712 
1722 
1723  // create branches and fill data:
1725 
1726  int numOfScans=session_->scanEpochs().size(), idx;
1727  SgMJD t(tZero);
1728 
1729  plotCarrier4Session_->createBranch(numOfScans, "ERP: HF external model");
1731  plotCarrier4Session_->createBranch(numOfScans, "ERP: HF CALC");
1732  SgPlotBranch *branchC=plotCarrier4Session_->listOfBranches()->last();
1733  plotCarrier4Session_->createBranch(numOfScans, "ERP: estimation ARC");
1734  SgPlotBranch *branchA=plotCarrier4Session_->listOfBranches()->last();
1735  plotCarrier4Session_->createBranch(numOfScans, "ERP: estimation PWL");
1736  SgPlotBranch *branchP=plotCarrier4Session_->listOfBranches()->last();
1737  plotCarrier4Session_->createBranch(numOfScans, "ERP: estimation stochastic");
1738  SgPlotBranch *branchS=plotCarrier4Session_->listOfBranches()->last();
1739 
1740  t = tZero;
1741  idx = 0;
1742  for (int i=0; i<session_->observations().size(); i++)
1743  if (t != session_->observations().at(i)->getMJD())
1744  {
1745  SgVlbiObservation *obs=session_->observations().at(i);
1746  t = session_->observations().at(i)->getMJD();
1747  branch->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1748 
1749  branch->data()->setElement(idx, SNI_EST_UT1, obs->getAprioriUt1HfContrib()*DAY2SEC*1.0e3);
1750  branch->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1751  branch->data()->setElement(idx, SNI_EST_PMX, obs->getAprioriPxHfContrib()*RAD2MAS);
1752  branch->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1753  branch->data()->setElement(idx, SNI_EST_PMY, obs->getAprioriPyHfContrib()*RAD2MAS);
1754  branch->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1755 
1756  branchC->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1757  branchC->data()->setElement(idx, SNI_EST_UT1, obs->getCalcHiFyUt1Delay()/obs->getDdel_dUT1() *DAY2SEC*1.0e3);
1758 
1759  branchA->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1760  branchA->data()->setElement(idx, SNI_EST_UT1, 0.0);
1761  branchA->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1762  branchA->data()->setElement(idx, SNI_EST_PMX, 0.0);
1763  branchA->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1764  branchA->data()->setElement(idx, SNI_EST_PMY, 0.0);
1765  branchA->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1767 
1768  branchP->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1769  branchP->data()->setElement(idx, SNI_EST_UT1, 0.0);
1770  branchP->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1771  branchP->data()->setElement(idx, SNI_EST_PMX, 0.0);
1772  branchP->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1773  branchP->data()->setElement(idx, SNI_EST_PMY, 0.0);
1774  branchP->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1776 
1777  branchS->data()->setElement(idx, SNI_EPOCH, obs->toDouble());
1778  branchS->data()->setElement(idx, SNI_EST_UT1, 0.0);
1779  branchS->data()->setElement(idx, SNI_SIG_UT1, 0.0);
1780  branchS->data()->setElement(idx, SNI_EST_PMX, 0.0);
1781  branchS->data()->setElement(idx, SNI_SIG_PMX, 0.0);
1782  branchS->data()->setElement(idx, SNI_EST_PMY, 0.0);
1783  branchS->data()->setElement(idx, SNI_SIG_PMY, 0.0);
1785 
1786  idx++;
1787  };
1788 
1789  // widgets:
1792  QBoxLayout *layout=new QVBoxLayout(w);
1793  layout->addWidget(plot4Session_);
1794 
1795  return w;
1796 };
1797 
1798 
1799 
1800 //
1802 {
1803  activeBand_ = idx;
1804  scanAmbigs_->setEnabled(session_->bands().at(activeBand_)->isAttr(SgVlbiBand::Attr_HAS_AMBIGS));
1806  {
1809  };
1810 };
1811 
1812 
1813 
1814 //
1816 {
1817  if (session_)
1818  {
1821  ": changePrimaryBand(): the primary band switched to " + session_->primaryBand()->getKey() +
1822  "-band");
1823  };
1824 };
1825 
1826 
1827 
1828 //
1830 {
1832  config_->getUseRateType()==SgTaskConfig::VR_NONE && // do not switch if rates are "in"
1833  (n==BPI_RES_SBD || n==BPI_RES_GRD || n==BPI_RES_PHD) )
1834  {
1835  switch (n)
1836  {
1837  default:
1838  case BPI_RES_SBD:
1840  break;
1841  case BPI_RES_GRD:
1843  break;
1844  case BPI_RES_PHD:
1846  break;
1847  };
1848 
1849  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
1850  {
1851  SgPlot *plot=plots4Baselines_.at(iBand);
1852  if (iBand != activeBand_)
1853  plot->changeYaxisTemp2(n);
1854  };
1856  };
1857 };
1858 
1859 
1860 
1861 //
1863 {
1864  int n;
1865  switch (delType)
1866  {
1867  default:
1868  case SgTaskConfig::VD_NONE:
1869  n = -1;
1870  break;
1872  n = BPI_RES_SBD;
1873  break;
1875  n = BPI_RES_GRD;
1876  break;
1878  n = BPI_RES_PHD;
1879  break;
1880  };
1881  if (n >= 0)
1882  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
1883  {
1884  SgPlot *plot=plots4Baselines_.at(iBand);
1885  plot->changeYaxisTemp2(n);
1886  };
1887 };
1888 
1889 
1890 
1891 //
1893 {
1895  &session_->stationsByName(), session_->getTStart(), this));
1896 };
1897 
1898 
1899 
1900 //
1902 {
1904  &session_->baselinesByName(), this));
1905 };
1906 
1907 
1908 
1909 //
1911 {
1913  &session_->sourcesByName(), this));
1914 };
1915 
1916 
1917 
1918 //
1919 void NsSessionEditDialog::process(/*bool isNeedUpdatePlots*/)
1920 {
1921  bool isNeedUpdatePlots=true;
1922  //
1923  // for people from USNO:
1924  int numOfConstrains=0;
1925  for (StationsByName_it it=session_->stationsByName().begin();
1926  it!=session_->stationsByName().end(); ++it)
1927  {
1928  SgVlbiStationInfo *si=it.value();
1931  numOfConstrains++;
1932  };
1933  if (numOfConstrains==0)
1934  QMessageBox::warning(this,
1935  "No reference clock station", "No station is selected as a reference clock one.");
1936  // end of p.f.u.
1937  //
1938  blockInput();
1939  // run it:
1940  session_->process(true, true);
1941  //
1942  processHasBeenCalled_ = true;
1943  if (isNeedUpdatePlots)
1944  {
1945  updateResiduals();
1946  emit dataChanged();
1947  };
1948  restoreInput();
1949  //
1950  QString str;
1951  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
1952  {
1953  SgVlbiBand *band=session_->bands().at(iBand);
1954  labelsPrc_ .at(iBand)->setText(str.sprintf("%3d/%3d",
1955  band->observables().count(), band->numProcessed(DT_DELAY)));
1956  labelsPar_ .at(iBand)->setText(str.sprintf("%d/%d",
1958  labelsWRMS_.at(iBand)->setText(str.sprintf("%.1f", band->wrms(DT_DELAY)*scale4Delay_*1.0E3));
1959  labelsSig0_.at(iBand)->setText(str.sprintf("%.1f", band->getSigma2add(DT_DELAY)*scale4Delay_*1.0E3));
1960  labelsChi2_.at(iBand)->setText(str.sprintf("%.2f",
1961  session_->getNumOfDOF()>0.0?band->chi2(DT_DELAY)/session_->getNumOfDOF():0.0));
1962  };
1965 };
1966 
1967 
1968 
1969 //
1971 {
1972  process();
1973  process();
1974 };
1975 
1976 
1977 
1978 //
1980 {
1981  process();
1982  process();
1983  process();
1984 };
1985 
1986 
1987 //
1989 {
1991  process_3times();
1992 };
1993 
1994 
1995 
1996 //
1998 {
1999  SgPlot *plot=NULL;
2000  SgPlotCarrier *carrier=NULL;
2001  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2002  {
2003  SgVlbiBand *band=session_->bands().at(iBand);
2004  //
2005  plot = plots4Baselines_.at(iBand);
2006  carrier = plotCarriers4Baselines_.at(iBand);
2007  //
2008  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
2009  for (int iBaseline=0; it!=band->baselinesByName().constEnd(); ++it, iBaseline++)
2010  {
2011  SgVlbiBaselineInfo* baselineInfo=it.value();
2012  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2013  {
2014  QList<SgVlbiObservable*> *observables=&baselineInfo->observables();
2015  SgPlotBranch *branch=carrier->listOfBranches()->at(iBaseline);
2016 
2017  QList<SgVlbiObservable*>::const_iterator jt=observables->constBegin();
2018  for (int idx=0; jt!=observables->constEnd(); ++jt, idx++)
2019  {
2020  SgVlbiObservable *o=*jt;
2023  else
2025  if (o->isUsable())
2027  else
2029  branch->data()->setElement(idx, BPI_RES_SBD, o->sbDelay().getResidual()*scale4Delay_);
2030  branch->data()->setElement(idx, BPI_RES_GRD, o->grDelay().getResidual()*scale4Delay_);
2031  branch->data()->setElement(idx, BPI_RES_PHD, o->phDelay().getResidual()*scale4Delay_);
2032  branch->data()->setElement(idx, BPI_RES_PHR, o->phDRate().getResidual()*scale4Rate_);
2033  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
2035  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
2037 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
2038  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
2039  o->activeDelay()->getResidualNorm():0.0);
2040  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
2041  branch->data()->setElement(idx, BPI_AMBIG_GR_NUMBER,
2042  o->grDelay().getNumOfAmbiguities());
2043  branch->data()->setElement(idx, BPI_AMBIG_PH_NUMBER,
2044  o->phDelay().getNumOfAmbiguities());
2045 #ifndef DEMO
2046  //branch->data()->setElement(idx, BPI_GRD_SBD, (o->grDelay().getValue() +
2047  // o->grDelay().ambiguity() +
2048  // o->grDelay().getIonoValue() - o->sbDelay().getValue())*scale4Delay_);
2049  //branch->data()->setElement(idx, BPI_Q_SBD, o->getSbdQ());
2050  //branch->data()->setElement(idx, BPI_Q_GRD, o->getGrdQ());
2051  //branch->data()->setElement(idx, BPI_Q_PHR, o->getPhrQ());
2052 #endif
2053  branch->data()->setElement(idx, BPI_TAUS, o->getTauS()*scale4Delay_);
2054  branch->data()->setElement(idx, BPI_TEST, o->getTest());
2055  };
2056  };
2057  };
2058  plot->dataContentChanged();
2059  labelsSig0_.at(iBand)->setText(QString("").
2060  sprintf("%.2f", band->getSigma2add(DT_DELAY)*scale4Delay_*1.0E3));
2061  };
2062  // plus estimated parameters:
2063  QMap<QString, SgVlbiAuxObservation*> *auxObservationsByScan=NULL;
2064  int stnIdx;
2065  plot = plot4Stations_;
2066  carrier = plotCarrier4Stations_;
2067  //
2068  QMap<QString, SgVlbiStationInfo*>::const_iterator it=session_->stationsByName().constBegin();
2069  for (stnIdx=0; it!=session_->stationsByName().constEnd(); ++it, stnIdx++)
2070  {
2071  SgVlbiStationInfo *stationInfo=it.value();
2072  SgPlotBranch *branch=carrier->listOfBranches()->at(stnIdx);
2073  auxObservationsByScan = stationInfo->auxObservationByScanId();
2074 
2075  QMap<QString, SgVlbiAuxObservation*>::const_iterator jt=auxObservationsByScan->constBegin();
2076  for (int idx=0; jt!=auxObservationsByScan->constEnd(); ++jt, idx++)
2077  {
2078  SgVlbiAuxObservation *auxObs=jt.value();
2079  if (!auxObs->isAttr(SgObservation::Attr_PROCESSED))
2081  else
2083 /*
2084  if (auxObs->isUsable())
2085  branch->delDataAttr(idx, SgPlotCarrier::DA_NONUSABLE);
2086  else
2087  branch->addDataAttr(idx, SgPlotCarrier::DA_NONUSABLE);
2088 */
2089  branch->data()->setElement(idx, SPI_EST_CLK, auxObs->getEstClocks());
2090  branch->data()->setElement(idx, SPI_EST_WZD, auxObs->getEstZenithDelay()*1.0e10/vLight);
2091  branch->data()->setElement(idx, SPI_EST_GRN, auxObs->getEstAtmGradN());
2092  branch->data()->setElement(idx, SPI_EST_GRE, auxObs->getEstAtmGradE());
2093  branch->data()->setElement(idx, SPI_TOT_ZDEL,(auxObs->getZenithDelayH() +
2094  auxObs->getZenithDelayW())*100.0 +
2095  auxObs->getEstZenithDelay());
2096  branch->data()->setElement(idx, SPI_SIG_EST_CLK, auxObs->getEstClocksSigma());
2097  branch->data()->setElement(idx, SPI_SIG_EST_WZD, auxObs->getEstZenithDelaySigma()*1.0e10/vLight);
2098  branch->data()->setElement(idx, SPI_SIG_EST_GRN, auxObs->getEstAtmGradNSigma());
2099  branch->data()->setElement(idx, SPI_SIG_EST_GRE, auxObs->getEstAtmGradESigma());
2100  branch->data()->setElement(idx, SPI_SIG_TOT_ZDEL,auxObs->getEstZenithDelaySigma());
2101 
2102 #ifndef DEMO
2103  SgVlbiObservation *obs=auxObs->getOwner();
2104  SgVlbiObservable *o=obs?obs->activeObs():NULL;
2105  if (o && obs->isAttr(SgObservation::Attr_PROCESSED))
2106  {
2107  branch->data()->setElement(idx, SPI_RES_GRD, o->grDelay().getResidual()*scale4Delay_*1.0e3);
2108  branch->data()->setElement(idx, SPI_SIG_GRD, o->grDelay().sigma2Apply()*scale4Delay_*1.0e3);
2109  }
2110  else
2111  {
2112  branch->data()->setElement(idx, SPI_RES_GRD, 0.0);
2113  branch->data()->setElement(idx, SPI_SIG_GRD, 0.0);
2114  };
2115 #endif
2116  };
2117  };
2118  plot->dataContentChanged();
2119  //
2120  //
2122 };
2123 
2124 
2125 
2126 //
2128 {
2129  SgPlot *plot=plot4Session_;
2131  QString keyUt1("EOP: dUT1, ms");
2132  QString keyPmx("EOP: P_x, mas");
2133  QString keyPmy("EOP: P_y, mas");
2134  const double scale4Ut1(parametersDescriptor_->getPolusUT1().getScale());
2135  const double scale4Pm(parametersDescriptor_->getPolusXY().getScale());
2136 
2137  SgPlotBranch *brArc=carrier->listOfBranches()->at(2);
2138  SgPlotBranch *brPwl=carrier->listOfBranches()->at(3);
2139  SgPlotBranch *brStc=carrier->listOfBranches()->at(4);
2140 
2141 
2142 // int numOfScans=0;
2143 // QList<SgMJD*> scans;
2144 // SgMJD t(tZero);
2145 // for (int i=0; i<session_->observations().size(); i++)
2146 // if (t != session_->observations().at(i)->getMJD())
2147 // {
2148 // t = session_->observations().at(i)->getMJD();
2149 // scans.append(new SgMJD(t));
2150 // numOfScans++;
2151 // };
2152 
2153  // 4Arc:
2154  SgArcStorage *arcUt1=NULL, *arcPmx=NULL, *arcPmy=NULL;
2155 
2156  // 4PWL:
2157  SgPwlStorage *pwlUt1=NULL, *pwlPmx=NULL, *pwlPmy=NULL;
2158 
2159  // 4Stoch:
2160  const QMap<QString, SgParameter*>
2161  *ut1ByEpoch=NULL, *pmxByEpoch=NULL, *pmyByEpoch=NULL;
2162  SgParameter *par;
2163 
2164 
2165  // Arc:
2166  if (reporter_->arcByName().contains(keyUt1))
2167  arcUt1 = reporter_->arcByName().value(keyUt1);
2168  if (reporter_->arcByName().contains(keyPmx))
2169  arcPmx = reporter_->arcByName().value(keyPmx);
2170  if (reporter_->arcByName().contains(keyPmy))
2171  arcPmy = reporter_->arcByName().value(keyPmy);
2172 
2173  // PWL:
2174  if (reporter_->pwlByName().contains(keyUt1))
2175  pwlUt1 = reporter_->pwlByName().value(keyUt1);
2176  if (reporter_->pwlByName().contains(keyPmx))
2177  pwlPmx = reporter_->pwlByName().value(keyPmx);
2178  if (reporter_->pwlByName().contains(keyPmy))
2179  pwlPmy = reporter_->pwlByName().value(keyPmy);
2180 
2181  // Stoch:
2182  if (reporter_->stcParByName()->contains(keyUt1))
2183  ut1ByEpoch = &(*reporter_->stcParByName())[keyUt1];
2184  if (reporter_->stcParByName()->contains(keyPmx))
2185  pmxByEpoch = &(*reporter_->stcParByName())[keyPmx];
2186  if (reporter_->stcParByName()->contains(keyPmy))
2187  pmyByEpoch = &(*reporter_->stcParByName())[keyPmy];
2188 
2189 
2190  for (int i=0; i<session_->scanEpochs().size(); i++)
2191  {
2192  const SgMJD *pt=session_->scanEpochs().at(i);
2193  QString timeTag(pt->toString(SgMJD::F_INTERNAL));
2194 
2195  // ARC:
2196  if (arcUt1)
2197  {
2198  brArc->data()->setElement(i, SNI_EST_UT1, arcUt1->calcSolution(*pt)*scale4Ut1);
2199  brArc->data()->setElement(i, SNI_SIG_UT1, arcUt1->calcSigma(*pt)*scale4Ut1);
2201  }
2202  else
2203  {
2204  brArc->data()->setElement(i, SNI_EST_UT1, 0.0);
2205  brArc->data()->setElement(i, SNI_SIG_UT1, 0.0);
2207  };
2208  if (arcPmx)
2209  {
2210  brArc->data()->setElement(i, SNI_EST_PMX, arcPmx->calcSolution(*pt)*scale4Pm);
2211  brArc->data()->setElement(i, SNI_SIG_PMX, arcPmx->calcSigma(*pt)*scale4Pm);
2213  }
2214  else
2215  {
2216  brArc->data()->setElement(i, SNI_EST_PMX, 0.0);
2217  brArc->data()->setElement(i, SNI_SIG_PMX, 0.0);
2219  };
2220  if (arcPmy)
2221  {
2222  brArc->data()->setElement(i, SNI_EST_PMY, arcPmy->calcSolution(*pt)*scale4Pm);
2223  brArc->data()->setElement(i, SNI_SIG_PMY, arcPmy->calcSigma(*pt)*scale4Pm);
2225  }
2226  else
2227  {
2228  brArc->data()->setElement(i, SNI_EST_PMY, 0.0);
2229  brArc->data()->setElement(i, SNI_SIG_PMY, 0.0);
2231  };
2232 
2233 
2234  // PWL:
2235  if (pwlUt1)
2236  {
2237  brPwl->data()->setElement(i, SNI_EST_UT1, pwlUt1->calcSolution (*pt)*scale4Ut1);
2238  brPwl->data()->setElement(i, SNI_SIG_UT1, pwlUt1->calcRateSigma(*pt)*scale4Ut1);
2240  }
2241  else
2242  {
2243  brPwl->data()->setElement(i, SNI_EST_UT1, 0.0);
2244  brPwl->data()->setElement(i, SNI_SIG_UT1, 0.0);
2246  };
2247  if (pwlPmx)
2248  {
2249  brPwl->data()->setElement(i, SNI_EST_PMX, pwlPmx->calcSolution (*pt)*scale4Pm);
2250  brPwl->data()->setElement(i, SNI_SIG_PMX, pwlPmx->calcRateSigma(*pt)*scale4Pm);
2252  }
2253  else
2254  {
2255  brPwl->data()->setElement(i, SNI_EST_PMX, 0.0);
2256  brPwl->data()->setElement(i, SNI_SIG_PMX, 0.0);
2258  };
2259  if (pwlPmy)
2260  {
2261  brPwl->data()->setElement(i, SNI_EST_PMY, pwlPmy->calcSolution (*pt)*scale4Pm);
2262  brPwl->data()->setElement(i, SNI_SIG_PMY, pwlPmy->calcRateSigma(*pt)*scale4Pm);
2264  }
2265  else
2266  {
2267  brPwl->data()->setElement(i, SNI_EST_PMY, 0.0);
2268  brPwl->data()->setElement(i, SNI_SIG_PMY, 0.0);
2270  };
2271 
2272 
2273  // Stoch:
2274  if (ut1ByEpoch && ut1ByEpoch->contains(timeTag) && (par=ut1ByEpoch->value(timeTag)))
2275  {
2276  brStc->data()->setElement(i, SNI_EST_UT1, par->getSolution()*scale4Ut1);
2277  brStc->data()->setElement(i, SNI_SIG_UT1, par->getSigma()*scale4Ut1);
2279  }
2280  else
2281  {
2282  brStc->data()->setElement(i, SNI_EST_UT1, 0.0);
2283  brStc->data()->setElement(i, SNI_SIG_UT1, 0.0);
2285  };
2286  if (pmxByEpoch && pmxByEpoch->contains(timeTag) && (par=pmxByEpoch->value(timeTag)))
2287  {
2288  brStc->data()->setElement(i, SNI_EST_PMX, par->getSolution()*scale4Pm);
2289  brStc->data()->setElement(i, SNI_SIG_PMX, par->getSigma()*scale4Pm);
2291  }
2292  else
2293  {
2294  brStc->data()->setElement(i, SNI_EST_PMX, 0.0);
2295  brStc->data()->setElement(i, SNI_SIG_PMX, 0.0);
2297  };
2298  if (pmyByEpoch && pmyByEpoch->contains(timeTag) && (par=pmyByEpoch->value(timeTag)))
2299  {
2300  brStc->data()->setElement(i, SNI_EST_PMY, par->getSolution()*scale4Pm);
2301  brStc->data()->setElement(i, SNI_SIG_PMY, par->getSigma()*scale4Pm);
2303  }
2304  else
2305  {
2306  brStc->data()->setElement(i, SNI_EST_PMY, 0.0);
2307  brStc->data()->setElement(i, SNI_SIG_PMY, 0.0);
2309  };
2310  };
2311 
2312  plot->dataContentChanged();
2313 };
2314 
2315 
2316 
2317 //
2319 {
2321  {
2322  if (QMessageBox::warning(this, "Novice User Warning",
2323  "It looks like ambiguities are not resolved for the session yet."
2324  "Do you want to evaluate ionosphere corrections?",
2325  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
2326  return;
2327  };
2328  //
2330  // replot:
2331  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2332  {
2333  SgPlot *plot = plots4Baselines_.at(iBand);
2334  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
2335  SgVlbiBand *band = session_->bands().at(iBand);
2336 
2337  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2338  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2339  {
2340  SgVlbiBaselineInfo* baselineInfo = i.value();
2341  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2342  {
2343  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2344  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
2345 
2346  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
2347  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
2348  {
2349  SgVlbiObservable *o=*j;
2350  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
2351  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
2352  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
2353  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
2354  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
2356  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
2362 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
2363  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
2364  o->activeDelay()->getResidualNorm():0.0);
2365  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
2366 #ifndef DEMO
2367  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
2368  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
2369  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
2370 #endif
2371  };
2372  };
2373  };
2374  plot->dataContentChanged();
2375  };
2376  emit dataChanged();
2379  ionoC_->setEnabled(false);
2380  iono0_->setEnabled(true);
2381 };
2382 
2383 
2384 
2385 //
2387 {
2388  //
2390  // replot:
2391  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2392  {
2393  SgPlot *plot = plots4Baselines_.at(iBand);
2394  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
2395  SgVlbiBand *band = session_->bands().at(iBand);
2396 
2397  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2398  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2399  {
2400  SgVlbiBaselineInfo* baselineInfo = i.value();
2401  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2402  {
2403  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2404  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
2405 
2406  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
2407  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
2408  {
2409  SgVlbiObservable *o=*j;
2410  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
2411  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
2412  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
2413  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
2414  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
2416  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
2422 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
2423  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
2424  o->activeDelay()->getResidualNorm():0.0);
2425  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
2426 #ifndef DEMO
2427  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
2428  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
2429  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
2430 #endif
2431  };
2432  };
2433  };
2434  plot->dataContentChanged();
2435  };
2436  emit dataChanged();
2439  ionoC_->setEnabled(true);
2440  iono0_->setEnabled(false);
2441 };
2442 
2443 
2444 
2445 //
2447 {
2448  /*
2449  session_->calculateBaselineClock_F1();
2450  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2451  {
2452  SgPlot *plot = plots4Baselines_.at(iBand);
2453  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
2454  SgVlbiBand *band = session_->bands().at(iBand);
2455 
2456  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2457  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2458  {
2459  SgVlbiBaselineInfo* baselineInfo = i.value();
2460  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2461  {
2462  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2463  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
2464 
2465  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
2466  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
2467  {
2468  SgVlbiObservable *o=*j;
2469  branch->data()->setElement(idx, BPI_CLK_1, o->owner()->getBaselineClock_F1() *scale4Delay_);
2470  branch->data()->setElement(idx, BPI_CLK_1L, o->owner()->getBaselineClock_F1l()*scale4Delay_);
2471  branch->data()->setElement(idx, BPI_CLK_1R, o->owner()->getBaselineClock_F1r()*scale4Delay_);
2472  };
2473  };
2474  };
2475  plot->dataContentChanged();
2476  };
2477  emit dataChanged();
2478  if (isNeed2SaveSir_ && setup.getAutoSavingMode()==NsSetup::AS_ALWAYS)
2479  saveIntermediateResults();
2480  */
2481 };
2482 
2483 
2484 
2485 //
2486 void NsSessionEditDialog::dispatchUserKey(SgPlot* plotter, Qt::KeyboardModifiers modifiers, int key)
2487 {
2488  switch (modifiers)
2489  {
2490  case Qt::ControlModifier:
2491  switch (key)
2492  {
2493  case Qt::Key_B:
2494  processClockBreakMarksNew(plotter);
2495  // std::cout << "processed New\n";
2496  break;
2497  case Qt::Key_F:
2498  generateRequest4Refringing(plotter);
2499  // std::cout << "processed New\n";
2500  break;
2501 // case Qt::Key_M:
2502 // adjustAmbiguityMultipliers();
2503  break;
2504  case Qt::Key_X:
2505  excludeMarkedPoints(plotter);
2506  break;
2507  case Qt::Key_Y:
2508  includeMarkedPoints(plotter);
2509  break;
2510  case Qt::Key_T:
2511  processTestFunctionN1(plotter);
2512  break;
2513  default:
2514  break;
2515  };
2516  break;
2517 
2518  case Qt::AltModifier:
2519  switch (key)
2520  {
2521  case Qt::Key_B:
2522  processClockBreakMarks(plotter);
2523  // std::cout << "processed Old\n";
2524  break;
2525  default:
2526  break;
2527  };
2528  break;
2529 /*
2530  case Qt::ShiftModifier:
2531  std::cout << " ++ got shift modifier\n";
2532  switch (key)
2533  {
2534  case Qt::Key_Equal:
2535  changeNumOfSubAmbig4MarkedPoints(plotter, 1);
2536  break;
2537  case Qt::Key_Minus:
2538  changeNumOfSubAmbig4MarkedPoints(plotter, -1);
2539  break;
2540  default:
2541  break;
2542  };
2543  std::cout << "Dispatch: key= " << key << ", modifiers=" << modifiers << "\n";
2544  break;
2545 */
2546  default:
2547  case Qt::NoModifier:
2548  switch (key)
2549  {
2550  case Qt::Key_Equal:
2552  break;
2553  case Qt::Key_Minus:
2555  break;
2556  case Qt::Key_Plus:
2558  break;
2559  case Qt::Key_Underscore:
2560  changeNumOfSubAmbig4MarkedPoints(plotter, -1);
2561  break;
2562  default:
2563  break;
2564  };
2565 // std::cout << "Dispatch: key= " << key << ", modifiers=" << modifiers << "\n";
2566  break;
2567  };
2568 };
2569 
2570 
2571 
2572 //
2574 {
2575  SgPlotCarrier* actualCarrier = plotter->carrier();
2576 
2577  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2578  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2579  {
2580  SgVlbiBand *band = session_->bands().at(iBand);
2581  BaselinesByName_it i=band->baselinesByName().begin();
2582  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
2583  {
2584  SgVlbiBaselineInfo* baselineInfo = i.value();
2585  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2586  {
2587  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2588  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2589 
2590  QList<SgVlbiObservable*>::iterator j = observables->begin();
2591  for (int idx=0; j!=observables->end(); ++j, idx++)
2592  {
2593  SgVlbiObservable *o=*j;
2594  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2595  {
2596  // change observation attribute
2599  else
2600  //obs->addAttr(SgVlbiObservation::Attr_NOT_VALID);
2601  o->owner()->modifyNotValidAttribute(true);
2604  // adjust plot data
2607  };
2608  };
2609  };
2610  };
2611  plotter->dataContentChanged();
2612  };
2613  //emit dataChanged();
2616 };
2617 
2618 
2619 
2620 //
2622 {
2623  SgPlotCarrier* actualCarrier = plotter->carrier();
2624 
2625  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2626  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2627  {
2628  SgVlbiBand *band = session_->bands().at(iBand);
2629  BaselinesByName_it i=band->baselinesByName().begin();
2630  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
2631  {
2632  SgVlbiBaselineInfo* baselineInfo = i.value();
2633  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2634  {
2635  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2636  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2637 
2638  QList<SgVlbiObservable*>::iterator j = observables->begin();
2639  for (int idx=0; j!=observables->end(); ++j, idx++)
2640  {
2641  SgVlbiObservable *o=*j;
2642  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2643  {
2644  // change observation attribute
2645  //obs->delAttr(SgVlbiObservation::Attr_NOT_VALID);
2646  if (o->owner()->modifyNotValidAttribute(false))
2647  {
2650  };
2653  };
2654  };
2655  };
2656  };
2657  plotter->dataContentChanged();
2658  };
2659  //emit dataChanged();
2662 };
2663 
2664 
2665 
2666 
2667 //
2669 {
2670  if (plotter->getNumOfYColumn() != BPI_RES_GRD)
2671  return;
2673  QMessageBox::warning(this,
2674  "Unable to proceed",
2675  "Cannot create the list of observations for refringing. Turn off ionosphere corrections and repeat");
2676 
2677 
2678 
2679  //
2680  //
2681  QList<SgVlbiObservable*> obsList;
2682  SgPlotCarrier *actualCarrier=plotter->carrier();
2683  //
2684  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2685  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2686  {
2687  SgVlbiBand *band=session_->bands().at(iBand);
2688  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
2689  for (int iBaseline=0; it!=band->baselinesByName().constEnd(); ++it, iBaseline++)
2690  {
2691  SgVlbiBaselineInfo *baselineInfo=it.value();
2692  if (baselineInfo)
2693  {
2695  *observables=&baselineInfo->observables();
2696  SgPlotBranch *branch=actualCarrier->listOfBranches()->at(iBaseline);
2697  for (int idx=0; idx<observables->size(); idx++)
2698  {
2699  SgVlbiObservable *o=observables->at(idx);
2700  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2701  {
2702  obsList << o;
2704  };
2705  };
2706  };
2707  };
2708  plotter->dataContentChanged();
2709  //
2710  };
2711 
2712  if (!obsList.size())
2713  return;
2714 
2715  QString bandKey(obsList.at(0)->getBandKey());
2716  QString str(setup.path2(setup.getPath2SpoolFileOutput()));
2717  QDir d(str);
2718  bool isOk;
2719  if (!d.exists())
2720  {
2721  isOk = d.mkpath("./");
2722  if (!isOk)
2723  {
2725  "::generateRequest4Refringing(): cannot create directory " + str);
2726  return;
2727  };
2728  };
2729  //
2730  QString fileName(session_->getName());
2731  if (fileName.at(0) == '$')
2732  fileName.remove(0, 1);
2733  fileName += ".b_" + bandKey + ".4FourFit";
2734  QFile f(str + "/" + fileName);
2735  if (!f.open(QIODevice::WriteOnly))
2736  {
2738  "::generateRequest4Refringing(): error opening output file: " + str + "/" + fileName);
2739  return;
2740  };
2741 
2742  double dInterval=1.5e-9; // 1.5 ns
2743  double wantedResid;
2744  if (bandKey == "S")
2745  dInterval = 3e-9; // was: 4ns
2746 
2747  QTextStream s(&f);
2748  for (int i=0; i<obsList.size(); i++)
2749  {
2750  SgVlbiObservable *o=obsList.at(i);
2751  wantedResid = o->grDelay().getResidualFringeFitting() -
2752  (o->grDelay().getResidual() /*+ o->grDelay().ambiguity()*/);
2753  if (wantedResid < -o->grDelay().getAmbiguitySpacing()/2.0)
2754  wantedResid += o->grDelay().getAmbiguitySpacing();
2755  if (o->grDelay().getAmbiguitySpacing()/2.0 < wantedResid)
2756  wantedResid -= o->grDelay().getAmbiguitySpacing();
2757 
2758  str = "fourfit -c " + o->getFourfitControlFile() +
2759  " -b " + o->owner()->stn_1()->getCid() + o->owner()->stn_2()->getCid() + ":" + o->getBandKey() +
2760  " " + o->owner()->getScanName() + " set mb_win " +
2761  QString("").sprintf("%.6f %.6f", (wantedResid - dInterval)*1.0e6, (wantedResid + dInterval)*1.0e6);
2762 
2763  s << str << "\n";
2764  };
2765  //
2766  s.setDevice(NULL);
2767  f.close();
2768  obsList.clear();
2769 
2771  "::generateRequest4Refringing(): the file \"" + f.fileName() + "\" has been created");
2772 };
2773 
2774 
2775 
2776 //
2778 {
2780  {
2781  if (QMessageBox::warning(this, "Novice User Warning",
2782  "The ionosphere corrections are evaluated and taken into account."
2783  "Modifications of ambiguity multiplier numbers will lead to unexpected results."
2784  "Do you want to continue?",
2785  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
2786  return;
2787  };
2788 
2789  SgPlotCarrier *actualCarrier=plotter->carrier();
2790  bool isDataModified(false);
2791  //
2792  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2793  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2794  {
2795  // group delays:
2796  if (plotter->getNumOfYColumn()==BPI_RES_GRD || // this is a group delay residuals
2797  plotter->getNumOfYColumn()==BPI_AMBIG_GR_NUMBER // or ambig numbers
2798  //|| plotter->getNumOfYColumn()==BPI_GRD_SBD
2799  )
2800  {
2801  SgVlbiBand *band=session_->bands().at(iBand);
2802  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2803  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2804  {
2805  SgVlbiBaselineInfo* baselineInfo = i.value();
2806  if (baselineInfo)
2807  {
2808  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2809  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2810 
2811  QList<SgVlbiObservable*>::iterator j = observables->begin();
2812  for (int idx=0; j!=observables->end(); ++j, idx++)
2813  {
2814  SgVlbiObservable *o=*j;
2815  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2816  {
2817  // change observation attribute
2819 //--> // adjust residual (can be used somewhere else before a user will make another iteration)
2820  o->grDelay().setResidual(o->grDelay().getResidual() +
2821  o->grDelay().getAmbiguitySpacing()*inc);
2822  // adjust plot data
2823  branch->data()->setElement(idx, BPI_RES_GRD,
2824  branch->data()->getElement(idx, BPI_RES_GRD) +
2827 #ifndef DEMO
2828  //branch->data()->setElement(idx, BPI_GRD_SBD,
2829  // ( o->grDelay().getValue() +
2830  // o->grDelay().ambiguity() +
2831  // o->grDelay().getIonoValue() - o->sbDelay().getValue() )*scale4Delay_);
2832 #endif
2834  isDataModified = true;
2836  };
2837  };
2838  };
2839  };
2840  plotter->dataContentChanged();
2841  };
2842  //
2843  // phase delays:
2844  if (plotter->getNumOfYColumn()==BPI_RES_PHD || // this is a group delay residuals
2845  plotter->getNumOfYColumn()==BPI_AMBIG_PH_NUMBER ) // or ambig numbers
2846  {
2847  SgVlbiBand *band=session_->bands().at(iBand);
2848  QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=band->baselinesByName().constBegin();
2849  for (int iBaseline=0; it!=band->baselinesByName().constEnd(); ++it, iBaseline++)
2850  {
2851  SgVlbiBaselineInfo *baselineInfo=it.value();
2852  if (baselineInfo)
2853  {
2854  QList<SgVlbiObservable*> *observables=&baselineInfo->observables();
2855  SgPlotBranch *branch=actualCarrier->listOfBranches()->at(iBaseline);
2856 
2857  QList<SgVlbiObservable*>::iterator j=observables->begin();
2858  for (int idx=0; j!=observables->end(); ++j, idx++)
2859  {
2860  SgVlbiObservable *o=*j;
2861  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2862  {
2863  // change observation attribute
2865  // adjust plot data
2866  branch->data()->setElement(idx, BPI_RES_PHD,
2867  branch->data()->getElement(idx, BPI_RES_PHD) +
2871  isDataModified = true;
2872  };
2873  };
2874  };
2875  };
2876  plotter->dataContentChanged();
2877  };
2878  //
2879  };
2880  //emit dataChanged();
2881  if (isDataModified)
2885 };
2886 
2887 
2888 
2889 //
2891 {
2892  SgPlotCarrier *actualCarrier=plotter->carrier();
2893 // bool isDataModified(false);
2894  //
2895  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2896  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2897  {
2898  // group delays only:
2899  if (plotter->getNumOfYColumn()==BPI_RES_GRD)
2900  {
2901  SgVlbiBand *band=session_->bands().at(iBand);
2902  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
2903  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
2904  {
2905  SgVlbiBaselineInfo* baselineInfo = i.value();
2906  if (baselineInfo)
2907  {
2908  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2909  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2910 
2911  QList<SgVlbiObservable*>::iterator j = observables->begin();
2912  for (int idx=0; j!=observables->end(); ++j, idx++)
2913  {
2914  SgVlbiObservable *o=*j;
2915  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2916  {
2917  // change observation attribute
2919  // adjust plot data
2920  branch->data()->setElement(idx, BPI_RES_GRD,
2921  branch->data()->getElement(idx, BPI_RES_GRD) +
2924 // isDataModified = true;
2926  };
2927  };
2928  };
2929  };
2930  plotter->dataContentChanged();
2931  };
2932  };
2935 };
2936 
2937 
2938 
2939 //
2941  QList<SgVlbiBaselineInfo*>& markedBaselines, SgVlbiBand*& band,
2942  SgMJD& tBreak, SgVlbiStationInfo*& stnBreak)
2943 {
2944  SgPlotCarrier *actualCarrier=plotter->carrier();
2945  QList<SgVlbiObservable*> obsAtBreak;
2946  QList<SgVlbiObservable*> obsNextToBreak;
2947  bool isOK=false;
2948 
2949  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
2950  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
2951  {
2952  band = session_->bands().at(iBand);
2953  isOK = true;
2954  };
2955 
2956  if (!isOK)
2957  return isOK;
2958 
2959  BaselinesByName_it i=band->baselinesByName().begin();
2960  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
2961  {
2962  SgVlbiBaselineInfo* baselineInfo = i.value();
2963  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
2964  {
2965  //---------- collect marked points:
2966  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
2967  SgPlotBranch *branch = actualCarrier->listOfBranches()->at(iBaseline);
2968  bool hasMatched=false;
2969  for (int idx=observables->size()-2; idx>=0; idx--)
2970  if (branch->getDataAttr(idx) & SgPlotCarrier::DA_SELECTED)
2971  {
2972  if (!hasMatched)
2973  {
2974  hasMatched = true;
2975  SgVlbiObservable *o=observables->at(idx);
2976  markedBaselines.append(baselineInfo);
2977  int j=idx+1;
2978  while (j<observables->size() && branch->getDataAttr(j) & SgPlotCarrier::DA_REJECTED)
2979  j++;
2980  if (j<observables->size() && !(branch->getDataAttr(j) & SgPlotCarrier::DA_REJECTED))
2981  {
2982  SgVlbiObservable *obsNext=observables->at(j);
2983  obsAtBreak.append(o);
2984  obsNextToBreak.append(obsNext);
2985  };
2986  };
2987  // discard selection marks:
2989  };
2990  };
2991  };
2992  // perform some checks:
2993  if (!obsAtBreak.size()) // that's ok, user just occasionally pressed keys, nothing to do
2994  return false;
2995  if (obsAtBreak.size() != obsNextToBreak.size())
2996  {
2998  ": findClockBreakEvent(): number of points in the aux lists are not equal: " +
2999  QString("").sprintf("%d vs %d", obsAtBreak.size(), obsNextToBreak.size()));
3000  return false;
3001  };
3002  if (obsAtBreak.size() == 1 && band->baselinesByName().size()>1)
3003  {
3005  ": findClockBreakEvent(): not enough points to detect a clock break");
3006  QMessageBox::warning(this, "Clock Breaks detector", "Not enough points to detect a clock break");
3007  return false;
3008  };
3009  // guess a clock break:
3010  // count frequencies:
3011  QMap<QString, int> numByName;
3012  for (int i=0; i<obsAtBreak.size(); i++)
3013  {
3014  numByName[obsAtBreak.at(i)->stn_1()->getKey()]++;
3015  numByName[obsAtBreak.at(i)->stn_2()->getKey()]++;
3016  };
3017  // get maximum:
3018  QMap<QString, int>::iterator iAux=numByName.begin();
3019  int minN=iAux.value(), maxN=iAux.value();
3020  QString stnName=iAux.key();
3021  for (; iAux!=numByName.end(); ++iAux)
3022  {
3023  int n=iAux.value();
3024  if (minN>n)
3025  minN = n;
3026  if (maxN<n)
3027  {
3028  maxN = n;
3029  stnName = iAux.key();
3030  };
3031  };
3032  // determine proper station and epoch:
3033  if (maxN!=minN || (maxN==1 && minN==1))
3034  {
3035  stnBreak = NULL;
3036  tBreak = session_->getTStart();
3037  if (session_->stationsByName().contains(stnName))
3038  {
3039  SgVlbiObservable *obsBreak=NULL;
3040  stnBreak = session_->stationsByName().value(stnName);
3041  for (int i=0; i<obsAtBreak.size(); i++)
3042  if (tBreak < obsAtBreak.at(i)->epoch())
3043  {
3044  obsBreak = obsAtBreak.at(i);
3045  tBreak = obsBreak->epoch();
3046  };
3047  }
3048  else
3049  {
3051  ": findClockBreakEvent(): stnName " + stnName + " is not in session_->stationsByName()");
3052  isOK = false;
3053  };
3054  }
3055  else
3056  {
3058  ": findClockBreakEvent(): impossible to guess the station name: maxN==minN");
3059  isOK = false;
3060  };
3063  return isOK;
3064 };
3065 
3066 
3067 
3068 //
3070 {
3071  SgMJD tBreak=tZero;
3072  QList<SgVlbiBaselineInfo*> markedBaselines;
3073  SgVlbiStationInfo *stnBreak=NULL;
3074  SgVlbiBand *band=NULL;
3075 
3076  // parse user marks, determine station and epoch of the break (plus some aux variables):
3077  if (!findClockBreakEvent(plotter, markedBaselines, band, tBreak, stnBreak))
3078  return;
3079  if (!markedBaselines.size() || !band || tBreak==tZero || !stnBreak)
3080  return;
3081 
3082  // determine parameters of the break:
3083  double shift, sigma;
3084  session_->calculateClockBreakParameter(tBreak, stnBreak, band, shift, sigma);
3086  shift = round(1.0E9*shift); // round to ns
3089  shift = round(1.0E12*shift)*1.0E-3; // round to ps
3090  sigma *= 1.0E9;
3091 
3092  if (fabs(shift) > 3.0*sigma) // 3sigma threshold (otherwise, do it by hands):
3093  {
3094  // ok, let user know
3096  ": processClockBreakMarks(): detected clock break at " + stnBreak->getKey() +
3097  " station on " + tBreak.toString() + "; the shift is " +
3098  QString("").sprintf("%.4f ns", shift));
3099  // adjust station information concerning the clock break:
3100  session_->correctClockBreak(band, stnBreak, tBreak, shift, sigma, true);
3101  // replot residuals:
3102  updateResiduals();
3103  // emit dataChanged();
3104  }
3105  else // just print out what was found:
3107  ": processClockBreakMarks(): here could be a clock break at " + stnBreak->getKey() +
3108  " station on " + tBreak.toString() + "; however, its value is small, about " +
3109  QString("").sprintf("%.4f (+/- %.4f) ns", shift, sigma));
3112 };
3113 
3114 
3115 
3116 //
3118 {
3119  SgMJD tBreak=tZero;
3120  QList<SgVlbiBaselineInfo*> markedBaselines;
3121  SgVlbiStationInfo *stnBreak=NULL;
3122  SgVlbiBand *band=NULL;
3123  SgClockBreakAgent *cbAgent=NULL;
3124  QList<SgClockBreakAgent*> cbAgents;
3125 
3126  // collect previously detected clock breaks:
3127  QMap<QString, SgVlbiStationInfo*> *stationsByName;
3128  if (!config_->getUseDynamicClockBreaks() &&
3129  (plotter->getNumOfYColumn()==BPI_RES_GRD || plotter->getNumOfYColumn()==BPI_RES_PHD) )
3130  stationsByName = &session_->bands().at(activeBand_)->stationsByName();
3131  else
3132  stationsByName = &session_->stationsByName();
3133  StationsByName_it it=stationsByName->begin();
3134  for (int idx=0; it!=stationsByName->end(); ++it, idx++)
3135  {
3136  SgVlbiStationInfo *stn=it.value();
3137  SgBreakModel &breakModel=stn->clockBreaks();
3138  for (int brkIdx=0; brkIdx<breakModel.size(); brkIdx++)
3139  {
3140  SgParameterBreak *brk=breakModel.at(brkIdx);
3141  cbAgent = new SgClockBreakAgent;
3142  cbAgent->epoch_ = *brk;
3143  cbAgent->stn_ = stn;
3144  cbAgents.append(cbAgent);
3145  };
3146  };
3148  ": processClockBreakMarksNew(): got " + QString("").setNum(cbAgents.size()) +
3149  " entries in cbAgents");
3150 
3151  // parse user marks, determine station and epoch of the break (plus some aux variables):
3152  if (findClockBreakEvent(plotter, markedBaselines, band, tBreak, stnBreak) &&
3153  markedBaselines.size() && band && tBreak!=tZero && stnBreak )
3154  {
3155  // first, check for clock break, it may be already in the list:
3156  bool doesExist=false;
3157  for (int i=0; i<cbAgents.size(); i++)
3158  {
3159  cbAgent = cbAgents.at(i);
3160  if (fabs(cbAgent->epoch_ - tBreak)<5.5E-6 && cbAgent->stn_->getKey()==stnBreak->getKey())
3161  doesExist = true;
3162  };
3163  // if it is a new entry, append it:
3164  if (!doesExist)
3165  {
3166  cbAgent = new SgClockBreakAgent;
3167  cbAgent->epoch_ = tBreak;
3168  cbAgent->stn_ = stnBreak;
3169  cbAgents.append(cbAgent);
3170  };
3171  }; // All in all it's just another break in the clocks.
3172 
3173  if (!cbAgents.size()) // nothing to evaluate, perhaps, a user pressed the keys by accident.
3174  {
3176  ": processClockBreakMarksNew(): the size of clock break agents list is zero, nothing to do");
3177  return;
3178  };
3179 
3180  // determine parameters of the breaks:
3181  session_->calculateClockBreaksParameters(cbAgents, band);
3182 
3183  // std::cout << "Evaluated clock breaks:\n";
3184  for (int idx=0; idx<cbAgents.size(); idx++)
3185  {
3186  cbAgent = cbAgents.at(idx);
3187  double shift, sigma;
3188  tBreak = cbAgent->epoch_;
3189  stnBreak = cbAgent->stn_;
3190  shift = cbAgent->shift_;
3191  sigma = cbAgent->sigma_;
3192 
3194  shift = round(1.0E9*shift); // round to ns
3197  shift = round(1.0E12*shift)*1.0E-3; // round to ps
3198  sigma *= 1.0E9;
3199  //
3200  // std::cout << qPrintable(stnBreak->getKey() + " " + tBreak.toString() ) << " "
3201  // << shift << " +/-" << sigma << "\n";
3202  //
3203  if (fabs(shift) > 3.0*sigma) // 3sigma threshold (otherwise, do it by hands):
3204  {
3205  // ok, let user know
3207  ": processClockBreakMarksNew(): detected clock break at " + stnBreak->getKey() +
3208  " station on " + tBreak.toString() + "; shift on " +
3209  QString("").sprintf("%.4f ns", shift));
3210  // adjust station information concerning the clock break:
3211  session_->correctClockBreak(band, stnBreak, tBreak, shift, sigma, true);
3212  // replot residuals:
3213  updateResiduals();
3214  }
3215  else // just print out what was found:
3217  ": processClockBreakMarksNew(): here could be a clock break at " + stnBreak->getKey() +
3218  " station on " + tBreak.toString() + "; however, its value is small, about " +
3219  QString("").sprintf("%.4f (+/- %.4f) ns", shift, sigma));
3220  // free the allocated memory:
3221  delete cbAgent;
3222  };
3225 };
3226 
3227 
3228 
3229 //
3231 {
3232  SgVlbiBand *band=NULL;
3233  SgPlotCarrier *actualCarrier=plotter->carrier();
3234  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3235  if (plotCarriers4Baselines_.at(iBand) == actualCarrier) // points to the same object
3236  band = session_->bands().at(iBand);
3237  if (!band)
3238  return;
3239 
3240  QString stnName("");
3241  SgMJD tBreak(tZero);
3242  if (session_->detectClockBreaks_mode1(band, stnName, tBreak))
3243  {
3245  ": processTestFunctionN1(): detected clock break at " +
3246  stnName + " on " + tBreak.toString());
3247  };
3248 };
3249 
3250 
3251 
3252 //
3254 {
3256  ": adjustAmbiguityMultipliers(): starting adjusting of ambiguity multipliers");
3257 
3258  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3259  {
3260  SgVlbiBand *band=session_->bands().at(iBand);
3261  BaselinesByName_it i=band->baselinesByName().begin();
3262  for (int iBaseline=0; i!=band->baselinesByName().end(); ++i, iBaseline++)
3263  {
3264  SgVlbiBaselineInfo* baselineInfo=i.value();
3265  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
3266  {
3267  QList<SgVlbiObservable*> *observables=&baselineInfo->observables();
3268  for (int idx=0; idx<observables->size(); idx++)
3269  {
3270  SgVlbiObservable *o=observables->at(idx);
3271  double diff=o->sbDelay().getResidual() + o->sbDelay().getIonoValue() -
3272  ( o->grDelay().getResidual() + o->grDelay().ambiguity() +
3273  o->grDelay().getIonoValue());
3275  o->grDelay().getNumOfAmbiguities() + rint(diff/o->grDelay().getAmbiguitySpacing()));
3276  };
3277  };
3278  };
3279  };
3282 
3283 };
3284 
3285 
3286 
3287 //
3289 {
3291  return;
3292 
3294  {
3295  if (QMessageBox::warning(this, "Novice User Warning",
3296  "The ionosphere corrections are evaluated and taken into account."
3297  "Modifications of ambiguity multiplier numbers will lead to unexpected results."
3298  "Do you want to continue?",
3299  QMessageBox::Yes | QMessageBox::No, QMessageBox::No)==QMessageBox::No)
3300  return;
3301  };
3302 
3304  ": scanAmbiguityMultipliers(): starting scanning of ambiguity multipliers");
3305 
3306  blockInput();
3308  updateResiduals();
3309  restoreInput();
3310  emit dataChanged();
3314 };
3315 
3316 
3317 
3318 //
3320 {
3322  ": detectAndProcessClockBreaks(): clock break correction procedure initiated");
3323 
3325 
3326  updateResiduals();
3327  emit dataChanged();
3330 };
3331 
3332 
3333 
3334 //
3336 {
3338  ": processRmOutButton(): outliers detect procedure initiated");
3339 
3340  // show "wait" cursor:
3341  blockInput();
3342 
3344  {
3347  else
3349  }
3350  else
3352 
3353  updateResiduals();
3354  emit dataChanged();
3355  // restore cursor:
3356  restoreInput();
3359 };
3360 
3361 
3362 
3363 //
3365 {
3366  if (QMessageBox::warning(this, "Warning",
3367  "Are you sure to wipe out all changes you made for the session?",
3368  QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
3369  return;
3370 
3372  ": clearAllEditings(): starting clear of all edit information");
3373 
3374  zeroIono();
3376 
3377  updateResiduals();
3380  emit dataChanged();
3383 };
3384 
3385 
3386 
3387 //
3389 {
3390  if (session_)
3392  emit dataChanged();
3395 };
3396 
3397 
3398 
3399 //
3401  int /*xColIdx*/, int /*yColIdx*/)
3402 {
3403  SgVlbiBand *band=session_->bands().at(activeBand_);
3404  QString blName=branch->getName();
3405  SgVlbiBaselineInfo *baseline=NULL;
3406  if (band->baselinesByName().contains(blName))
3407  {
3408  baseline = band->baselinesByName().find(blName).value();
3409  SgVlbiObservable *o=baseline->observables().at(idx);
3410  if (o)
3411  {
3412  QMessageBox msgBox(this);
3413  QString str2copy, str2copyBlName(""), strQCs(""), strSnrs(""), strECs("");
3414  QString str4usability("");
3415  QString blnStat(""), srcStat(""), stn1Stat(""), stn2Stat("");
3416  if (session_->baselinesByName().size()>1)
3417  str2copyBlName = " " + o->baseline()->getKey() + ",";
3418  str2copy.sprintf("observation %d,%s %s, %s, which fits at %.2f +/- %.2f ps",
3419  o->getMediaIdx()+1, qPrintable(str2copyBlName),
3420  qPrintable(o->src()->getKey()), qPrintable(o->epoch().toString(SgMJD::F_HHMMSS)),
3421  o->activeDelay()->getResidual()*scale4Delay_*1.0e3,
3422  o->activeDelay()->sigma2Apply()*scale4Delay_*1.0e3);
3423 /*
3424  o->measurement(config_)->getResidual()*scale4Delay_*1.0e3,
3425  o->measurement(config_)->sigma2Apply()*scale4Delay_*1.0e3);
3426 */
3427 // o->measurement(config_)->getSigma()*scale4Delay_*1.0e3);
3428 
3429  SgVlbiObservation *obs=o->owner();
3430  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3431  it_obs!=obs->observableByKey().end(); ++it_obs)
3432  {
3433  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ", ";
3434  strSnrs+= it_obs.key() + ":" + QString("").sprintf("%.2g", it_obs.value()->getSnr()) + ", ";
3435  strECs += it_obs.key() + ":\"" + it_obs.value()->getErrorCode() + "\", ";
3436  };
3437  if (strQCs.size()>1)
3438  strQCs = strQCs.left(strQCs.size() - 2);
3439  if (strSnrs.size()>1)
3440  strSnrs = strSnrs.left(strSnrs.size() - 2);
3441  if (strECs.size()>1)
3442  strECs = strECs.left(strECs.size() - 2);
3443 
3444  str4usability = "";
3445  if (!o->isUsable())
3446  {
3448  str4usability += "Low quality factor. ";
3450  str4usability += "Deselected source. ";
3452  str4usability += "Deselected station. ";
3454  str4usability += "Deselected baseline. ";
3456  str4usability += "Not mated. ";
3458  str4usability += "Not enough used channels. ";
3460  str4usability += "Low quality factor on another band. ";
3462  str4usability += "Not enough used channels on another band. ";
3463  str4usability.chop(1);
3464 
3465  str4usability = "<dt>Reason(s) of non-usability:</dt><dd>" + str4usability + "</dd>";
3466  };
3467 // blnStat.sprintf(" Nums: %d/%d/%d, WRMS=%.2fps",
3468  blnStat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps</ul></small>",
3469  o->baseline()->numTotal(DT_DELAY),
3470  o->baseline()->numUsable(DT_DELAY),
3472  o->baseline()->wrms(DT_DELAY)*1.0e12);
3473 // srcStat.sprintf(" Nums: %d/%d/%d, WRMS=%.2fps",
3474  srcStat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps</ul></small>",
3475  o->src()->numTotal(DT_DELAY),
3476  o->src()->numUsable(DT_DELAY),
3477  o->src()->numProcessed(DT_DELAY),
3478  o->src()->wrms(DT_DELAY)*1.0e12);
3479  //stn1Stat.sprintf("Nums: %d/%d/%d, WRMS=%.2fps",
3480  stn1Stat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps"
3481  "<li>Azimuth %.1f(degree)<li>Elevation %.1f(degree)</ul></small>",
3482  o->stn_1()->numTotal(DT_DELAY),
3483  o->stn_1()->numUsable(DT_DELAY),
3484  o->stn_1()->numProcessed(DT_DELAY),
3485  o->stn_1()->wrms(DT_DELAY)*1.0e12,
3486  obs->auxObs_1()->getAzimuthAngle()*RAD2DEG,
3487  obs->auxObs_1()->getElevationAngle()*RAD2DEG);
3488  stn2Stat.sprintf("<small><ul><li>Numbers (T/U/P): %d/%d/%d<li>WRMS %.2fps"
3489  "<li>Azimuth %.1f(degree)<li>Elevation %.1f(degree)</ul></small>",
3490  o->stn_2()->numTotal(DT_DELAY),
3491  o->stn_2()->numUsable(DT_DELAY),
3492  o->stn_2()->numProcessed(DT_DELAY),
3493  o->stn_2()->wrms(DT_DELAY)*1.0e12,
3494  obs->auxObs_2()->getAzimuthAngle()*RAD2DEG,
3495  obs->auxObs_2()->getElevationAngle()*RAD2DEG);
3496  msgBox.setIcon(QMessageBox::Information);
3497  msgBox.setText("<b>Inquired observation</b>");
3498  msgBox.setInformativeText("<p>You have selected an observation of " +
3499  o->src()->getKey() + " radio source on the baseline " +
3500  o->baseline()->getKey() + ". Its attributes are:"
3501  "<ul>"
3502  "<li>baseline: <b>" + o->baseline()->getKey() + "</b>" + blnStat +
3503  "<li>radio source: <b>" + o->src()->getKey() + "</b>" + srcStat +
3504  "<li>reference station: <b>" + o->stn_1()->getKey() + "</b>" + stn1Stat +
3505  "<li>remote station: <b>" + o->stn_2()->getKey() + "</b>" + stn2Stat +
3506  "<li>band: <b>" + o->getBandKey() + "</b>" +
3507  "<li>observation # " + QString("").setNum(o->getMediaIdx()) +
3508  ", baseline idx: " + QString("").setNum(idx) + "</li>" +
3509  "<li>epoch: " + o->epoch().toString() + "</li>" +
3510  "<li>scan name: " + obs->getScanName() + "</li>" +
3511  "<li>fourfit file name: " + o->getFourfitOutputFName() + "</li>" +
3512  "<li>" + o->activeDelay()->getName() +
3513  QString("").sprintf(" residual: %.4f +/- %.4fps (applied: %.4fps) </li>",
3514  o->activeDelay()->getResidual()*scale4Delay_*1.0e3,
3515  o->activeDelay()->getSigma()*scale4Delay_*1.0e3,
3516  o->activeDelay()->sigma2Apply()*scale4Delay_*1.0e3) +
3517  "<li>Attributes:<dl>"
3518  "<dt>Quality code(s):</dt><dd>{" + strQCs + "}</dd>"
3519  "<dt>SNR(s):</dt><dd>{" + strSnrs + "}</dd>"
3520 
3521  "<dt>Usable:</dt><dd>" + (o->isUsable()?QString("<b>Yes</b>"):QString("No")) + "</dd>" +
3522  str4usability +
3523  "<dt>Excluded:</dt><dd>" +
3524  (obs->isAttr(SgVlbiObservation::Attr_NOT_VALID)?"<b>Yes</b>":"No") + "</dd>" +
3525  "<dt>Processed:</dt><dd>" +
3526  (obs->isAttr(SgVlbiObservation::Attr_PROCESSED)?"<b>Yes</b>":"No") + "</dd>" +
3527 
3528  "<dt>Fringe error code(s):</dt><dd>{" + strECs + "}</dd></dl></ul></p><p>"
3529  "Cut and copy string for reports:<br>" +
3530  str2copy + "</p>");
3531 
3532  msgBox.exec();
3533  };
3534  };
3535 };
3536 
3537 
3538 
3539 //
3541 {
3542  QString dirName=setup.path2(setup.getPath2IntermediateResults());
3543  bool isOk(true);
3544  SgMJD startEpoch(SgMJD::currentMJD());
3545  // check for existance:
3546  QDir d(dirName);
3547  if (!d.exists())
3548  {
3549  isOk = d.mkpath("./"); // Qt, wtf?
3550  if (isOk)
3552  ": saveIntermediateResults(): the directory " + dirName + " has been created");
3553  else
3554  {
3556  ": saveIntermediateResults(): cannot create directory " + dirName +
3557  "; saving the intermediate results has failed");
3558  setup.setLnfsFileName("");
3560  return;
3561  };
3562  };
3563  if (dirName.size()>0)
3564  dirName += "/";
3565  QString fileName(session_->name4SirFile(setup.getHave2UpdateCatalog()));
3566  QFile file(dirName + fileName);
3567  if (!file.open(QIODevice::WriteOnly))
3568  {
3570  ": saveIntermediateResults(): cannot open file " + file.fileName() +
3571  "; saving the intermediate results has failed");
3572  setup.setLnfsFileName("");
3574  return;
3575  };
3576  QDataStream s(&file);
3577  if ((isOk=session_->saveIntermediateResults(s)))
3578  {
3579  SgMJD finisEpoch(SgMJD::currentMJD());
3581  ": saveIntermediateResults(): the intermediate results have been saved in the file " +
3582  file.fileName() + ", elapsed time: " +
3583  QString("").sprintf("%.2f", (finisEpoch - startEpoch)*86400000.0) + " ms");
3584  }
3585  else
3586  {
3588  ": saveIntermediateResults(): saving the intermediate results in the file " +
3589  file.fileName() + " has failed");
3590  setup.setLnfsFileName("");
3592  };
3593  s.setDevice(NULL);
3594  file.close();
3595  return;
3596 };
3597 
3598 
3599 
3600 //
3602 {
3603  QString dirName=setup.path2(setup.getPath2IntermediateResults());
3604  bool isOk(true);
3605  SgMJD startEpoch(SgMJD::currentMJD());
3606  // check for existance:
3607  QDir d(dirName);
3608  if (!d.exists())
3609  return false;
3610  if (dirName.size()>0)
3611  dirName += "/";
3612  QString fileName(session_->name4SirFile(setup.getHave2UpdateCatalog()));
3613  QFile file(dirName + fileName);
3614  if (!file.exists())
3615  {
3617  ": loadIntermediateResults(): nothing to read, the file " + file.fileName() + " does not exist");
3618  return false;
3619  };
3620  if (!file.open(QIODevice::ReadOnly))
3621  {
3623  ": loadIntermediateResults(): cannot read file " + file.fileName() +
3624  "; loading the intermediate results has failed");
3625  return false;
3626  };
3627  // ok, it is exist and we can read the file. Ask user:
3628  if (need2notify &&
3629  QMessageBox::question(this,
3630  "Found unsaved data",
3631  "There are intermediate results for this session, should we load them?\n"
3632  "If you say No, you'll start a session from the scratch, also the intermediate results "
3633  "will be overwritten.",
3634  QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)==QMessageBox::No)
3635  {
3636  file.close();
3637  file.remove();
3638  return false;
3639  };
3640  QDataStream s(&file);
3641  if ((isOk=session_->loadIntermediateResults(s)))
3642  {
3643  SgMJD finisEpoch(SgMJD::currentMJD());
3645  ": loadIntermediateResults(): the intermediate results have been loaded from the file " +
3646  file.fileName() + ", elapsed time: " +
3647  QString("").sprintf("%.2f", (finisEpoch - startEpoch)*86400000.0) + " ms");
3648  }
3649  else
3651  ": loadIntermediateResults(): loading the intermediate results from the file " +
3652  file.fileName() + " has failed");
3653  s.setDevice(NULL);
3654  file.close();
3655  return isOk;
3656 };
3657 
3658 
3659 
3660 //
3662 {
3663  blockInput();
3665 
3666 /*
3667  // put here an action to test:
3668  session_->calculateIonoCorrections(NULL);
3669  for (int iBand=0; iBand<session_->numberOfBands(); iBand++)
3670  {
3671  SgPlot *plot = plots4Baselines_.at(iBand);
3672  SgPlotCarrier *carrier = plotCarriers4Baselines_.at(iBand);
3673  SgVlbiBand *band = session_->bands().at(iBand);
3674 
3675  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i=band->baselinesByName().constBegin();
3676  for (int iBaseline=0; i!=band->baselinesByName().constEnd(); ++i, iBaseline++)
3677  {
3678  SgVlbiBaselineInfo* baselineInfo = i.value();
3679  if (baselineInfo && !baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
3680  {
3681  QList<SgVlbiObservable*> *observables = &baselineInfo->observables();
3682  SgPlotBranch *branch = carrier->listOfBranches()->at(iBaseline);
3683 
3684  QList<SgVlbiObservable*>::const_iterator j = observables->constBegin();
3685  for (int idx=0; j!=observables->constEnd(); ++j, idx++)
3686  {
3687  SgVlbiObservable *o=*j;
3688  branch->data()->setElement(idx, BPI_ION_SBD, o->sbDelay().getIonoValue()*scale4Delay_);
3689  branch->data()->setElement(idx, BPI_ION_GRD, o->grDelay().getIonoValue()*scale4Delay_);
3690  branch->data()->setElement(idx, BPI_ION_PHD, o->phDelay().getIonoValue()*scale4Delay_);
3691  branch->data()->setElement(idx, BPI_ION_PHR, o->phDRate().getIonoValue()*scale4Rate_);
3692  branch->data()->setElement(idx, BPI_SIG_DEL_APPLIED,
3693  o->grDelay().sigma2Apply()*scale4Delay_);
3694  branch->data()->setElement(idx, BPI_SIG_RAT_APPLIED,
3695  o->phDRate().sigma2Apply()*scale4Rate_);
3696  branch->data()->setElement(idx, BPI_SIG_ION_SBD, o->sbDelay().getIonoSigma()*scale4Delay_);
3697  branch->data()->setElement(idx, BPI_SIG_ION_GRD, o->grDelay().getIonoSigma()*scale4Delay_);
3698  branch->data()->setElement(idx, BPI_SIG_ION_PHD, o->phDelay().getIonoSigma()*scale4Delay_);
3699  branch->data()->setElement(idx, BPI_SIG_ION_PHR, o->phDRate().getIonoSigma()*scale4Rate_);
3700 // branch->data()->setElement(idx, BPI_NORM_RESID, o->activeMeasurement()->getResidualNorm());
3701  branch->data()->setElement(idx, BPI_RES_NORM_DEL, o->activeDelay()?
3702  o->activeDelay()->getResidualNorm():0.0);
3703  branch->data()->setElement(idx, BPI_RES_NORM_RAT, o->phDRate().getResidualNorm());
3704 #ifndef DEMO
3705  //branch->data()->setElement(idx, BPI_S_DIFF, o->getSbdDiffBand()*scale4Delay_);
3706  //branch->data()->setElement(idx, BPI_X_DIFF, o->getGrdDiffBand()*scale4Delay_);
3707  //branch->data()->setElement(idx, BPI_R_DIFF, o->getPhrDiffBand());
3708 #endif
3709  };
3710  };
3711  };
3712  plot->dataContentChanged();
3713  };
3714 */
3715 
3716  emit dataChanged();
3717 
3720 
3722  ": executeTestAction(): done");
3723  restoreInput();
3724 };
3725 
3726 
3727 
3728 //
3729 //
3731 {
3732  // collect info and display it:
3733  QList<SgVlbiObservation*> deselectedObs;
3734  QList<SgVlbiObservation*> nonUsableObs;
3735  QList<NsDeselectedObsInfo*> deselectedObservations;
3736  QList<NsNotUsedObsInfo*> nonUsableObservations;
3737 
3738  for (int i=0; i<session_->observations().size(); i++)
3739  {
3740  SgVlbiObservation *obs=session_->observations().at(i);
3741  if (obs->activeObs() && !obs->activeObs()->isUsable())
3742  nonUsableObs << obs;
3743  else if (obs->isAttr(SgVlbiObservation::Attr_NOT_VALID) &&
3744  obs->activeObs() && obs->activeObs()->isUsable() )
3745  deselectedObs << obs;
3746  };
3747  QString str("");
3748  for (int i=0; i<deselectedObs.size(); i++)
3749  {
3750  QString strQCs("");
3751  SgVlbiObservation *obs=deselectedObs.at(i);
3752  SgVlbiObservable *o=obs->activeObs(); // can be NULL
3753  if (o)
3754  {
3755  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3756  it_obs!=obs->observableByKey().end(); ++it_obs)
3757  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ",";
3758  strQCs.chop(1);
3760  obs->stn_1()->getKey(), obs->stn_2()->getKey(), obs->src()->getKey(),
3761  obs->toString(SgMJD::F_HHMMSS), strQCs,
3762  o->activeDelay()->getResidual()*1.0e12,
3763  o->activeDelay()->sigma2Apply()*1.0e12,
3765  );
3766  deselectedObservations << obsInfo;
3767  };
3768  };
3769  for (int i=0; i<nonUsableObs.size(); i++)
3770  {
3771  QString strReasons("");
3772  QString strQCs("");
3773  SgVlbiObservation *obs=nonUsableObs.at(i);
3774  SgVlbiObservable *o=obs->activeObs(); // can be NULL
3775  if (o)
3776  {
3777  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3778  it_obs!=obs->observableByKey().end(); ++it_obs)
3779  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ",";
3780  strQCs.chop(1);
3781 
3783  strReasons += "Low quality factor. ";
3785  strReasons += "Deselected source. ";
3787  strReasons += "Deselected station. ";
3789  strReasons += "Deselected baseline. ";
3791  strReasons += "Not mated. ";
3793  strReasons += "Not enough used channels. ";
3795  strReasons += "Low quality factor on another band. ";
3797  strReasons += "Not enough used channels on another band. ";
3798  strReasons.chop(1);
3799 
3800  NsNotUsedObsInfo *obsInfo=new NsNotUsedObsInfo(o->getMediaIdx(), obs->stn_1()->getKey(),
3801  obs->stn_2()->getKey(), obs->src()->getKey(), obs->toString(SgMJD::F_HHMMSS), strQCs,
3802  strReasons);
3803 
3804  nonUsableObservations << obsInfo;
3805  };
3806  };
3807  //
3808  NsBrowseNotUsedObsDialog *browser;
3809  browser = new NsBrowseNotUsedObsDialog(nonUsableObservations, deselectedObservations, reporter_, this);
3810  browser->setModal(false);
3811  browser->setSizeGripEnabled(true);
3812  browser->setWindowModality(Qt::NonModal);
3813  browser->setWindowFlags(Qt::Window);
3814  browser->resize(0.8*size());
3815  browser->show();
3816  browser->raise();
3817  browser->activateWindow();
3818 
3819 };
3820 
3821 
3822 
3823 //
3825 {
3826  // collect info and diplay it:
3827  QList<SgVlbiObservation*> listOfExcludedObs;
3828  for (int i=0; i<session_->observations().size(); i++)
3829  {
3830  SgVlbiObservation *obs=session_->observations().at(i);
3831 // if (obs->minQualityFactor() >= config_->getQualityCodeThreshold() &&
3832 // obs->isAttr(SgVlbiObservation::Attr_NOT_VALID))
3834  obs->activeObs() && obs->activeObs()->isUsable() )
3835  listOfExcludedObs << obs;
3836  };
3837  QString lstOfObs("");
3838  QString str2copy("");
3839  for (int i=0; i<listOfExcludedObs.size(); i++)
3840  {
3841  QString str2copyBlName(""), strQCs("");
3842  SgVlbiObservation *obs=listOfExcludedObs.at(i);
3843  SgVlbiObservable *o=obs->primeObs();
3844  // need to specify a baseline:
3845  if (session_->baselinesByName().size() > 1)
3846  str2copyBlName = " " + obs->baseline()->getKey() + ",";
3847  for (QMap<QString, SgVlbiObservable*>::iterator it_obs=obs->observableByKey().begin();
3848  it_obs!=obs->observableByKey().end(); ++it_obs)
3849  strQCs += it_obs.key() + ":" + QString("").setNum(it_obs.value()->getQualityFactor()) + ",";
3850  if (strQCs.size()>1)
3851  strQCs = strQCs.left(strQCs.size() - 1);
3852  str2copy.sprintf("observation %d,%s %s, %s, QC=(%s) which fits at %.2f +/- %.2f ps",
3853  o->getMediaIdx()+1, qPrintable(str2copyBlName),
3854  qPrintable(o->src()->getKey()), qPrintable(o->epoch().toString(SgMJD::F_HHMMSS)),
3855  qPrintable(strQCs),
3856  o->activeDelay()->getResidual()*1.0e12,
3857  o->activeDelay()->sigma2Apply()*1.0e12);
3858 // lstOfObs += str2copy + "<br>";
3859  lstOfObs += str2copy + "\n";
3860  };
3861 // QMessageBox msgBox(NULL);
3862  QMessageBox msgBox(QMessageBox::Information, "", "",
3863  QMessageBox::Ok, NULL, Qt::Window);
3864 
3865 
3866  msgBox.setIcon(QMessageBox::Information);
3867  msgBox.setText("<b>The list of potentially good observations that were excluded from data analysis "
3868  "for the session " + session_->getName() + ":</b>");
3869  msgBox.setInformativeText("Total amount: " + QString("").setNum(listOfExcludedObs.size()));
3870  msgBox.setDetailedText(
3871 // "<p>The observations are:</p>"
3872 // "<p>" + lstOfObs + "</p>");
3873  "The observations are:\n" + lstOfObs);
3874  msgBox.setSizeGripEnabled(true);
3875  msgBox.exec();
3876 };
3877 
3878 
3879 
3880 
3881 
3882 
3883 //
3885 {
3886  if (setup.getExternalCommand().size() == 0)
3887  {
3889  "::runExternalCommand(): no command specified");
3890  return;
3891  };
3892 /*
3893  QFileInfo fi(setup.getExternalCommand());
3894  if (!fi.exists())
3895  {
3896  logger->write(SgLogger::ERR, SgLogger::RUN, className() +
3897  "::runExternalCommand(): the file \"" + setup.getExternalCommand() + "\" does not exist");
3898  return;
3899  };
3900  if (!fi.isExecutable())
3901  {
3902  logger->write(SgLogger::ERR, SgLogger::RUN, className() +
3903  "::runExternalCommand(): the file \"" + setup.getExternalCommand() + "\" is not not executable");
3904  return;
3905  };
3906 */
3907  int rc;
3908  QString command(setup.getExternalCommand());
3909  command += " '" + session_->getName() + "' '" +
3910  session_->getSessionCode() + "' '" + session_->getOfficialName() + "' '" +
3912 
3914  "::runExternalCommand(): executing the command \"" + command + "\"");
3915 
3916  rc = system(qPrintable(command));
3918  "::runExternalCommand(): the command \"" + command +
3919  "\" has been executed with rc=" + QString("").setNum(rc));
3920 };
3921 /*=====================================================================================================*/
3922 
3923 
3924 
3925 
3926 
3927 
3928 
3929 
3930 
3931 
3932 
3933 /*=====================================================================================================*/
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:33
SgLogger * logger
Definition: SgLogger.cpp:231
QString interval2Str(double days)
Definition: SgMJD.cpp:1370
const SgMJD tZero(1957, 10, 4)
#define RAD2MAS
radians to ms:
Definition: SgMathSupport.h:60
#define DAY2SEC
radians to mas:
Definition: SgMathSupport.h:56
#define RAD2DEG
< radians to degrees:
Definition: SgMathSupport.h:32
@ 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:1007
double toDouble() const
Definition: SgMJD.h:533
static SgMJD currentMJD()
Definition: SgMJD.cpp:118
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:603
bool getHave2ApplyNutationHFContrib() const
Definition: SgTaskConfig.h:374
bool getIsObservableFollowsPlot() const
bool getHave2ApplyOldPoleTideContrib() const
Definition: SgTaskConfig.h:381
void setHave2ApplyEarthTideContrib(bool b)
Definition: SgTaskConfig.h:598
void setHave2ApplyOceanPoleTideContrib(bool b)
Definition: SgTaskConfig.h:608
void setHave2ApplyTiltRemvrContrib(bool b)
Definition: SgTaskConfig.h:610
VlbiDelayType getUseDelayType() const
Definition: SgTaskConfig.h:857
bool getHave2ApplyEarthTideContrib() const
Definition: SgTaskConfig.h:367
bool getHave2ApplyPyContrib() const
Definition: SgTaskConfig.h:366
QMap< QString, AutomaticProcessing > & apByNetId()
Definition: SgTaskConfig.h:623
bool getHave2ApplyOceanTideContrib() const
Definition: SgTaskConfig.h:368
void setActiveBandIdx(int)
VlbiRateType getUseRateType() const
Definition: SgTaskConfig.h:865
bool getHave2ApplyUt1OceanTideHFContrib() const
Definition: SgTaskConfig.h:372
bool getIsNoviceUser() const
Definition: SgTaskConfig.h:282
bool getContribsAreFromDatabase() const
Definition: SgTaskConfig.h:364
bool getHave2ApplyPxyOceanTideHFContrib() const
Definition: SgTaskConfig.h:373
void setHave2ApplyOceanTideContrib(bool b)
Definition: SgTaskConfig.h:599
bool getHave2ApplyOldOceanTideContrib() const
Definition: SgTaskConfig.h:380
bool getHave2ApplyPoleTideContrib() const
Definition: SgTaskConfig.h:369
void setHave2ApplyPoleTideContrib(bool b)
Definition: SgTaskConfig.h:600
void setHave2ApplyOldPoleTideContrib(bool b)
Definition: SgTaskConfig.h:612
bool getIsActiveBandFollowsTab() const
bool getHave2ApplyPxyLibrationContrib() const
Definition: SgTaskConfig.h:376
void setHave2ApplyPxyOceanTideHFContrib(bool b)
Definition: SgTaskConfig.h:604
bool getHave2ApplyTiltRemvrContrib() const
Definition: SgTaskConfig.h:379
bool getUseDynamicClockBreaks() const
Definition: SgTaskConfig.h:905
void setHave2ApplyOldOceanTideContrib(bool b)
Definition: SgTaskConfig.h:611
bool getHave2ApplyPxContrib() const
Definition: SgTaskConfig.h:365
bool getHave2ApplyOceanPoleTideContrib() const
Definition: SgTaskConfig.h:377
void setHave2ApplyPxyLibrationContrib(bool b)
Definition: SgTaskConfig.h:607
void setUseDelayType(VlbiDelayType)
void setHave2ApplyPyContrib(bool b)
Definition: SgTaskConfig.h:597
void setHave2ApplyPxContrib(bool b)
Definition: SgTaskConfig.h:596
void setHave2ApplyFeedCorrContrib(bool b)
Definition: SgTaskConfig.h:609
void setHave2ApplyNutationHFContrib(bool b)
Definition: SgTaskConfig.h:605
void setHave2ApplyUt1LibrationContrib(bool b)
Definition: SgTaskConfig.h:606
bool getHave2ApplyFeedCorrContrib() const
Definition: SgTaskConfig.h:378
bool getHave2ApplyUt1LibrationContrib() const
Definition: SgTaskConfig.h:375
OutliersProcessingAction getOpAction() const
Definition: SgTaskConfig.h:969
double getElement(unsigned int i) const
Definition: SgVector.h:362
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
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()
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 & getSessionCode() const
const SgMJD & getTMean() const
const SgMJD & getTCreation() const
SgVlbiBand * primaryBand()
int numberOfBands() 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 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()
void checkBandForClockBreaks(int, bool)
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;
SgParameterCfg * pcZenith()
SgParameterCfg * pcClocks()
SgBreakModel & clockBreaks()
NsSetup setup
Definition: nuSolve.cpp:61
SgTaskConfig config
Definition: nuSolve.cpp:59
SgParametersDescriptor parametersDescriptor
Definition: nuSolve.cpp:60