General Purpose Geodetic Library
SgVlbiSessionIoKomb.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2015-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #include <iostream>
24 #include <stdlib.h>
25 
26 
27 
28 #include <QtCore/QDateTime>
29 #include <QtCore/QDir>
30 #include <QtCore/QFile>
31 #include <QtCore/QFileInfo>
32 #include <QtCore/QList>
33 #include <QtCore/QMap>
34 #include <QtCore/QRegularExpression>
35 #include <QtCore/QTextStream>
36 #include <QtCore/QVector>
37 
38 
39 
40 #include <SgVlbiSession.h>
41 
42 #include <SgConstants.h>
43 #include <SgKombFormat.h>
44 #include <SgLogger.h>
45 #include <SgVersion.h>
46 #include <SgVlbiBand.h>
47 #include <SgVlbiObservation.h>
48 
49 
50 
51 
52 
53 
54 
55 /*=======================================================================================================
56 *
57 * Auxiliary data structures
58 *
59 *======================================================================================================*/
60 
61 
62 
63 
64 
65 // these two variables are declared in SgVlbiSessionIoFringes.cpp:
66 extern QMap<QString, QString> stn2stn;
67 extern QMap<QString, QString> src2src;
68 
69 
70 /*=======================================================================================================
71 *
72 * I/O utilities:
73 *
74 *======================================================================================================*/
75 //
76 bool SgVlbiSession::getDataFromKombFiles(const QString& path2data,
77  const QString& altDatabaseName, const QString& altCorrelatorName,
78  const QString& historyFileName, const QString& mapFileName, bool need2correctRefClocks)
79 {
80  bool isOk=false;
81  QDir dir(path2data);
82  QList<QString> files2read;
83  QStringList entryList;
84  QRegExp reKombFileName("B[0-9]{2,}");
85  int idx;
86  QString correlatorComments(historyFileName);
87  // for name maps:
88  QMap<QString, QString> stn2stn;
89  QMap<QString, QString> src2src;
90  QMap<QString, QString> bnd2bnd;
91  QRegularExpression reOldDbName("(\\d{2})([A-Z]{3})(\\d{2})([A-Z0-9]{1,2})");
92  QRegularExpression reNewDbName("(\\d{8})-([\\S]{2,12})");
93  QRegularExpressionMatch match;
94 
95  //
96  if (need2correctRefClocks)
98 
99  //
100  files2read = dir.entryList(QDir::Files | QDir::Readable | QDir::NoDotAndDotDot, QDir::Name);
101  if (files2read.size() == 0)
102  {
104  "::getDataFromKombFiles(): nothing to read");
105  return isOk;
106  };
107 
108  // get the maps:
109  //
110  importMapFile(mapFileName, stn2stn, src2src, bnd2bnd);
111  if (stn2stn.size())
113  "::getDataFromKombFiles(): loaded " + QString("").setNum(stn2stn.size()) +
114  " entries for station name maps");
115  if (src2src.size())
117  "::getDataFromKombFiles(): loaded " + QString("").setNum(src2src.size()) +
118  " entries for source name maps");
119  if (bnd2bnd.size())
121  "::getDataFromKombFiles(): loaded " + QString("").setNum(bnd2bnd.size()) +
122  " entries for band code maps");
123  //
124  //
125  for (int i=0; i<files2read.size(); i++)
126  if (files2read.at(i).contains(reKombFileName))
127  entryList << files2read.at(i);
129  "::getDataFromKombFiles(): filtered " + QString("").setNum(entryList.size()) +
130  " scan entries from " + QString("").setNum(files2read.size()) + " total number of directories");
131 
132  //
133  //
134  for (int i=0; i<entryList.size(); i++)
135  {
136  const QString &inKombFileName=entryList.at(i);
137  QFileInfo fi(path2data + "/" + inKombFileName);
138  int kombFileSize=QFileInfo(path2data + "/" + inKombFileName).size();
139  if (kombFileSize%256 != 0)
141  "::getDataFromKombFiles(): unexpected size of the file " + path2data + "/" + inKombFileName +
142  ": " + QString("").setNum(kombFileSize) + ", skipped");
143  else
144  processKombFile(path2data, inKombFileName, stn2stn, src2src, bnd2bnd);
145  };
146  //
147  //
148  // check did we read something at all:
149  if (!bands_.size())
150  {
152  "::getDataFromKombFiles(): nothing useful found");
153  return false;
154  };
155  //
156  //
157  setOriginType(OT_KOMB); // flag it
158  setCorrelatorType("GSI ");
160  //
161  if (cppsSoft_ == CPPS_UNKNOWN)
163  //
164  //
165  // set global stuff here:
166  //
167  if (2 < altDatabaseName.size())
168  {
169  if ((match=reOldDbName.match(altDatabaseName)).hasMatch())
170  {
171  setName(altDatabaseName);
172  setNetworkSuffix(altDatabaseName.at(8));
173  setOfficialName("UNKN");
174  setSubmitterName("UNKN");
175  setSchedulerName("UNKN");
177  "::getDataFromKombFiles(): database name was explicitly set to " + altDatabaseName +
178  ", a version 1 database name pattern");
179  }
180  else if ((match=reNewDbName.match(altDatabaseName)).hasMatch())
181  {
182  setName(altDatabaseName);
183  setNetworkSuffix("-");
184  setOfficialName("UNKN");
185  setSubmitterName("UNKN");
186  setSchedulerName("UNKN");
188  "::getDataFromFringeFiles(): database name was explicitly set to " + altDatabaseName +
189  ", a version 2 database name pattern");
190  }
191  else
193  "::getDataFromKombFiles(): the provided database name, " + altDatabaseName +
194  ", does not fit any known pattern and was ignored");
195  };
196  //
197  //
198  QMap<double, SgVlbiBand*> bandByFreq;
199  QString str("");
200  for (int i=0; i<bands_.size(); i++)
201  {
202  SgVlbiBand *band=bands_.at(i);
203  QString bandKey=band->getKey();
204  band->setTCreation(SgMJD::currentMJD().toUtc());
205  band->setInputFileName(path2data + "/*");
206  band->setInputFileVersion(0);
207  //
208  // quick'n'dirty:
209  idx = 0;
210  SgVlbiObservable *o=observations_.at(idx)->observable(bandKey);
211  while (!o && idx<observations_.size())
212  o = observations_.at(idx++)->observable(bandKey);
213  if (o)
215  else
217  "::getDataFromKombFiles(): cannot set up a frequency for " + bandKey + "-band");
218  if (bandByFreq.contains(band->getFrequency()))
219  {
221  "::getDataFromKombFiles(): the frequency " + QString("").setNum(band->getFrequency()) +
222  " is already registered");
223  }
224  else
225  bandByFreq.insert(band->getFrequency(), band);
226  };
227  //
228  //
229  // load correlator's comments for history records:
230  //
231  if (correlatorComments.size()==0)
232  {
233  dir.setPath(path2data + "/../control/");
234  str = "";
235  if (!dir.exists())
237  "::getDataFromKombFiles(): cannot get correlator comments, the directory does not exist: " +
238  dir.path());
239  else
240  {
241  entryList.clear();
242  entryList = dir.entryList(QStringList() << "*.corr",
243  QDir::Files | QDir::NoDotAndDotDot | QDir::Readable, QDir::Name);
244  if (entryList.size() == 0)
245  {
247  "::getDataFromKombFiles(): cannot get correlator comments, no any *.corr file found: " +
248  dir.path());
249  }
250  else if (entryList.size() > 1)
251  {
253  "::getDataFromKombFiles(): found more than one file with correlator comments:");
254  for (int j=0; j<entryList.size(); j++)
256  "::getDataFromKombFiles(): " + entryList.at(j));
257  str = entryList.at(0);
259  "::getDataFromKombFiles(): picked up this one: " + str);
260  }
261  else
262  str = entryList.at(0);
263  };
264  if (str.size())
265  correlatorComments = path2data + "/../control/" + str;
266  };
267  if (correlatorComments.size())
268  getCorrelatorHistory(correlatorComments);
269  else
270  {
271  for (int i=0; i<bands_.size(); i++)
272  {
273  bands_.at(i)->history().addHistoryRecord("== The correlator report was not provided. ==",
274  SgMJD::currentMJD().toUtc());
275  bands_.at(i)->history().addHistoryRecord("== ", SgMJD::currentMJD().toUtc());
276  };
278  "::getDataFromKombFiles(): the correlator report was not provided.");
279  };
280  //
281  //
282  // set up a primary band:
283  // standard IVS case:
284  QString primeBandKey;
285  if (bandByKey_.size()==2 && bandByKey_.contains("X") && bandByKey_.contains("S"))
286  {
288  "::getDataFromKombFiles(): importing typical IVS session");
289  primaryBand_ = bandByKey_.value("X");
290  }
291  else
292  {
294  "::getDataFromKombFiles(): importing a foreign session setup");
295  if (bandByFreq.size() > 1)
296  primaryBand_ = bandByFreq.begin().value();
297  else
298  primaryBand_ = bands_.at(0);
299  };
301  primeBandKey = primaryBand_->getKey();
302  //
303  // remove observations that are not in the primary band:
304  int num;
305  idx = num = 0;
306  while (idx<observations_.size())
307  {
308  SgVlbiObservation *obs=observations_.at(idx);
309  if (!obs->observable(primeBandKey))
310  {
311  observationByKey_.remove(obs->getKey());
312  observations_.removeAt(idx);
313  idx--;
314  num++;
315  delete obs;
316  };
317  idx++;
318  };
319  if (num)
321  "::getDataFromKombFiles(): " + QString("").setNum(num) +
322  " second-band-only observation" + (num==1?"":"s") + " were removed");
323  //
324  //
325  if (selfCheck(false))
327  "::getDataFromKombFiles(): session selfcheck complete");
328  else
329  {
331  "::getDataFromKombFiles(): the selfcheck for the session failed");
332  return false;
333  };
334  //
335  // overwrite correlator name with user-provided info:
336  if (altCorrelatorName.size())
337  {
338  setCorrelatorName(altCorrelatorName);
340  "::getDataFromKombFiles(): correlator name was explicitly set to " + altCorrelatorName);
341  };
342  //
343  // calculate aux data:
344  for (int i=0; i<observations_.size(); i++)
345  {
346  SgVlbiObservation *obs=observations_.at(i);
347  for (QMap<QString, SgVlbiObservable*>::iterator it=obs->observableByKey().begin();
348  it!=obs->observableByKey().end(); ++it)
349  {
350  SgVlbiObservable *o=it.value();
351  o->calcPhaseCalDelay();
352  };
353  };
355  "::getDataFromKombFiles(): phase cal delays were calculated");
356  //
357  //
358  //
359  return true;
360 };
361 
362 
363 
364 //
365 void SgVlbiSession::processKombFile(const QString& path2file, const QString& kombFileName,
366  const QMap<QString, QString>& stn2stn, const QMap<QString, QString>& src2src,
367  const QMap<QString, QString>& bnd2bnd)
368 {
369  SgKombReader kombReader;
370  QString str("");
371 
373  "::processKombFile(): reading KOMB file " + kombFileName);
374  kombReader.readFile(path2file + "/" + kombFileName);
375  if (!kombReader.isOk())
376  {
378  "::processKombFile(): the KOMB file " + kombFileName + " is not Ok; skipped");
379  return;
380  };
381 
382 // what need to be checked:
383 // stationInfo->setSid('-', '-'); ?
384 
385  SgVlbiBand *band=NULL;
386  //
387  QString bandKey("");
388  QString station1Name, station2Name, sourceName, baselineName;
389  QString scanName, scanId, obsKey;
390  int obsIdx;
391  int nTmp;
392  double f;
393  SgMJD epoch;
394  SgVlbiStationInfo *station1Info, *station2Info;
395  SgVlbiStationInfo *bandStation1Info, *bandStation2Info;
396  SgVlbiSourceInfo *sourceInfo, *bandSourceInfo;
397  SgVlbiBaselineInfo *baselineInfo, *bandBaselineInfo;
398  SgVlbiObservation *obs=NULL;
399  SgVlbiObservable *o=NULL;
400  SgVlbiAuxObservation *auxObs_1=NULL, *auxObs_2=NULL;
401 
402  double refFreq=0.0;
403  bool isSbdSigmaNan, isSbdSigmaInf;
404  bool isGrdSigmaNan, isGrdSigmaInf;
405  bool isPhrSigmaNan, isPhrSigmaInf;
406  bool isTmp;
407  int numOfChannels;
408  double effFreq4GR=0.0, effFreq4PH=0.0, effFreq4RT=0.0;
409  bool need2adjust4clocks=isAttr(Attr_REF_CLOCKS_ADJUSTED);
410  double ap_0, ap_1, ap_2, ap_3, prtOffset;
411  ap_0 = ap_1 = ap_2 = ap_3 = 0.0;
412  prtOffset = 0.0;
413 
414  // check experiment code:
415  str = QString(kombReader.experimentCode()).simplified();
416  if (sessionCode_=="UNKN")
417  setSessionCode(str);
418  else if (str != sessionCode_)
419  {
421  "::processKombFile(): the KOMB file " + kombFileName + " is belong to another session, " + str +
422  " ours is " + sessionCode_ + "; skipped");
423  return;
424  };
425 
426 
427  for (QMap<QString, QString>::const_iterator it=kombReader.mapOfBands().begin();
428  it!=kombReader.mapOfBands().end(); ++it)
429  {
430  bandKey = QString(it.key()).simplified();
431  //
432  if (bnd2bnd.size())
433  {
434  if (!check4NameMap(bnd2bnd, bandKey))
435  {
437  "::processKombFile(): skipping the observation " + kombFileName +
438  ": the band \"" + bandKey + "\" have to be skipped");
439  continue;
440  };
441  };
442  //
443  if (bandByKey_.contains(bandKey))
444  band = bandByKey_.value(bandKey);
445  else
446  {
447  band = new SgVlbiBand;
448  band->setKey(bandKey);
449  bands_.append(band);
450  bandByKey_.insert(bandKey, band);
451  };
452  const SgKombOb01Record *ob01=&kombReader.ob01();
453  //const SgKombOb02Record *ob02=&kombReader.ob02();
454  const SgKombOb03Record *ob03=&kombReader.ob03();
455  const SgKombBd01Record *bd01=kombReader.bd01(it.key()); // it.key() contains a space char
456  const SgKombBd02Record *bd02=kombReader.bd02(it.key());
457  const SgKombBd03Record *bd03=kombReader.bd03(it.key());
458  const SgKombBd04Record *bd04=kombReader.bd04(it.key());
459  const SgKombBd05Record *bd05=kombReader.bd05(it.key());
460  if (!bd01)
461  {
463  "::processKombFile(): the KOMB file " + kombFileName + ": BD01 record is NULL for the " +
464  bandKey + "-band; skipped");
465  return;
466  };
467  if (!bd02)
468  {
470  "::processKombFile(): the KOMB file " + kombFileName + ": BD02 record is NULL for the " +
471  bandKey + "-band; skipped");
472  return;
473  };
474  if (!bd03)
475  {
477  "::processKombFile(): the KOMB file " + kombFileName + ": BD03 record is NULL for the " +
478  bandKey + "-band; skipped");
479  return;
480  };
481  if (!bd04)
482  {
484  "::processKombFile(): the KOMB file " + kombFileName + ": BD04 record is NULL for the " +
485  bandKey + "-band; skipped");
486  return;
487  };
488  if (!bd05)
489  {
491  "::processKombFile(): the KOMB file " + kombFileName + ": BD05 record is NULL for the " +
492  bandKey + "-band; skipped");
493  return;
494  };
495  //
496  epoch = ob01->tRefer();
497  station1Name.sprintf("%-8s", ob01->station1Name());
498  station2Name.sprintf("%-8s", ob01->station2Name());
499  sourceName .sprintf("%-8s", ob01->sourceName());
500  //
501  // map the names:
502  if (stn2stn.size())
503  {
504  if (!check4NameMap(stn2stn, station1Name))
505  {
507  "::processKombFile(): skipping the observation " + kombFileName +
508  ": the station \"" + station1Name + "\" have to be skipped");
509  return;
510  };
511  if (!check4NameMap(stn2stn, station2Name))
512  {
514  "::processKombFile(): skipping the observation " + kombFileName +
515  ": the station \"" + station2Name + "\" have to be skipped");
516  return;
517  };
518  };
519  if (src2src.size())
520  {
521  if (!check4NameMap(src2src, sourceName))
522  {
524  "::processKombFile(): skipping the observation " + kombFileName +
525  ": the source \"" + sourceName + "\" have to be skipped");
526  return;
527  };
528  };
529  //
530  //
531  baselineName = station1Name + ":" + station2Name;
532  // set up scanId and scanName (KOMB files do not contain scan names):
533  scanId = epoch.toString(SgMJD::F_INTERNAL) + "@" + sourceName;
534  scanName.sprintf("%03d-%02d%02d ",
535  ob01->tStart().calcDayOfYear(), ob01->tStart().calcHour(), ob01->tStart().calcMin());
536 // epoch.calcDayOfYear(), epoch.calcHour(), epoch.calcMin());
537  //
538  obsKey.sprintf("%s",
539  qPrintable(epoch.toString(SgMJD::F_INTERNAL) + "-" + baselineName + "@" + sourceName));
540  //
541  //
542  // check for NaN in delay and rate:
543  f = bd05->obsDelayAtReferEpoch();
544  if (isinf(f) != 0 || isnan(f) != 0)
545  {
547  "::processKombFile(): an observation from KOMB input file \"" + kombFileName +
548  "\" (the baseline " + baselineName +
549  " observing " + sourceName + " source at " + epoch.toString(SgMJD::F_YYYYMMDDHHMMSSSS) +
550  ") contains wrong group delay (NaN or Inf); the observation is skipped", true);
551  return;
552  };
553  f = bd05->obsDelayRateAtReferEpoch();
554  if (isinf(f) != 0 || isnan(f) != 0)
555  {
557  "::processKombFile(): an observation from KOMB input file \"" + kombFileName +
558  "\" (the baseline " + baselineName +
559  " observing " + sourceName + " source at " + epoch.toString(SgMJD::F_YYYYMMDDHHMMSSSS) +
560  ") contains wrong delay rate (NaN or Inf); the observation is skipped", true);
561  return;
562  };
563  // ...continue:
564  //
565  if (observationByKey_.contains(obsKey))
566  obs = observationByKey_.value(obsKey);
567  else
568  {
569  obs = new SgVlbiObservation(this);
570  obs->setMJD(epoch);
571  obs->setScanName(scanName);
572  obs->setScanId(scanId);
574  obs->setKey(obsKey);
575  obs->setMediaIdx(observations_.size());
576  observations_.append(obs);
577  observationByKey_.insert(obsKey, obs);
578  };
579  // pick up or create an observation:
580  o = new SgVlbiObservable(obs, band);
581  obsIdx = obs->getMediaIdx();
582  o->setMediaIdx(obsIdx);
583  obs->addObservable(bandKey, o);
584  obs->setupActiveObservable(bandKey);
585  // determine number of channels:
586  numOfChannels = bd01->totalNumOfProcChannels();
587  o->allocateChannelsSetupStorages(numOfChannels);
588  //
589  //
590  // station #1:
591  if (stationsByName_.contains(station1Name))
592  station1Info = stationsByName_.value(station1Name);
593  else // new station, add it to the container and register its index:
594  {
595  station1Info = new SgVlbiStationInfo(stationsByName_.size(), station1Name);
596  stationsByName_.insert(station1Info->getKey(), station1Info);
597  stationsByIdx_.insert(station1Info->getIdx(), station1Info);
598  station1Info->setCid(*ob01->baselineId());
599  station1Info->setSid('-', '-');
600  };
601  // station #2:
602  if (stationsByName_.contains(station2Name))
603  station2Info = stationsByName_.value(station2Name);
604  else // new station, add it to the container and register its index:
605  {
606  station2Info = new SgVlbiStationInfo(stationsByName_.size(), station2Name);
607  stationsByName_.insert(station2Info->getKey(), station2Info);
608  stationsByIdx_.insert(station2Info->getIdx(), station2Info);
609  station2Info->setCid(*(ob01->baselineId()+1));
610  station2Info->setSid('-', '-');
611  };
612  // source:
613  if (sourcesByName_.contains(sourceName))
614  sourceInfo = sourcesByName_.value(sourceName);
615  else // new source, add it to the container and register its index:
616  {
617  sourceInfo = new SgVlbiSourceInfo(sourcesByName_.size(), sourceName);
618  sourcesByName_.insert(sourceInfo->getKey(), sourceInfo);
619  sourcesByIdx_.insert(sourceInfo->getIdx(), sourceInfo);
620  };
621  // baseline:
622  if (baselinesByName_.contains(baselineName))
623  baselineInfo = baselinesByName_.value(baselineName);
624  else // new baseline, add it to the container and register its index:
625  {
626  baselineInfo = new SgVlbiBaselineInfo(baselinesByName_.size(), baselineName);
627  baselinesByName_.insert(baselineInfo->getKey(), baselineInfo);
628  baselinesByIdx_.insert(baselineInfo->getIdx(), baselineInfo);
629  };
630  // 4band:
631  // band's station #1:
632  if (band->stationsByName().contains(station1Name))
633  bandStation1Info = band->stationsByName().value(station1Name);
634  else // new station, add it to the container:
635  {
636  bandStation1Info = new SgVlbiStationInfo(station1Info->getIdx(), station1Name);
637  band->stationsByName().insert(bandStation1Info->getKey(), bandStation1Info);
638  band->stationsByIdx().insert(bandStation1Info->getIdx(), bandStation1Info);
639  };
640  // band's station #2:
641  if (band->stationsByName().contains(station2Name))
642  bandStation2Info = band->stationsByName().value(station2Name);
643  else // new station, add it to the container:
644  {
645  bandStation2Info = new SgVlbiStationInfo(station2Info->getIdx(), station2Name);
646  band->stationsByName().insert(bandStation2Info->getKey(), bandStation2Info);
647  band->stationsByIdx().insert(bandStation2Info->getIdx(), bandStation2Info);
648  };
649  // band's source:
650  if (band->sourcesByName().contains(sourceName))
651  bandSourceInfo = band->sourcesByName().value(sourceName);
652  else // new source, add it to the container:
653  {
654  bandSourceInfo = new SgVlbiSourceInfo(sourceInfo->getIdx(), sourceName);
655  band->sourcesByName().insert(bandSourceInfo->getKey(), bandSourceInfo);
656  band->sourcesByIdx().insert(bandSourceInfo->getIdx(), bandSourceInfo);
657  };
658  // band's baselines:
659  if (band->baselinesByName().contains(baselineName))
660  bandBaselineInfo = band->baselinesByName().value(baselineName);
661  else // new baseline, add it to the container and register its index:
662  {
663  bandBaselineInfo = new SgVlbiBaselineInfo(baselineInfo->getIdx(), baselineName);
664  band->baselinesByName().insert(bandBaselineInfo->getKey(), bandBaselineInfo);
665  band->baselinesByIdx().insert(bandBaselineInfo->getIdx(), bandBaselineInfo);
666  };
667  //
668  obs->setStation1Idx(station1Info->getIdx());
669  obs->setStation2Idx(station2Info->getIdx());
670  obs->setSourceIdx(sourceInfo->getIdx());
671  obs->setBaselineIdx(baselineInfo->getIdx());
672  //
673  // plus additional info:
674  o->setFourfitOutputFName(kombFileName);
675  //
676  //
677  ap_0 = ob01->aPrioriObses(0);
678  ap_1 = ob01->aPrioriObses(1);
679  ap_2 = ob01->aPrioriObses(2);
680  ap_3 = ob01->aPrioriObses(3);
681  prtOffset = ob01->aPrioriRefClockOffset();
682  //
683  // collect observables:
684  // single band delay:
685  o->sbDelay().setValue(bd05->obsCoarseDelayAtReferEpoch()); // [s]
686  //
687  if (need2adjust4clocks)
688  {
689  // correct the observables:
690  // group delay:
691  double dDel;
692  dDel = ap_1*prtOffset + 1.0/2.0*ap_2*prtOffset*prtOffset +
693  1.0/6.0*ap_3*prtOffset*prtOffset*prtOffset;
694  o->grDelay().setValue(bd05->obsDelayAtReferEpoch() + dDel); // [s]
695  // delay rate:
696  double dRat;
697  dRat = ap_2*prtOffset + 1.0/2.0*ap_3*prtOffset*prtOffset;
698  o->phDRate().setValue(bd05->obsDelayRateAtReferEpoch() + dRat); // [s/s]
699  //
700  // store original correlator data as "alternate" values:
701  o->grDelay().setAlternateValue(bd05->obsDelayAtReferEpoch()); // [s]
702  // delay rate:
703  o->phDRate().setAlternateValue(bd05->obsDelayRateAtReferEpoch()); // [s/s]
704  }
705  else
706  {
707  o->grDelay().setValue(bd05->obsDelayAtReferEpoch()); // [s]
708  // delay rate:
709  o->phDRate().setValue(bd05->obsDelayRateAtReferEpoch()); // [s/s]
710  };
711  //
712  //
713  // workaround the correlator "feature" (not sure we need it for GSI):
714  isSbdSigmaNan = isSbdSigmaInf = isGrdSigmaNan = isGrdSigmaInf = isPhrSigmaNan =
715  isPhrSigmaInf = false;
716  // single band delay sigma (in sec):
717  f = bd05->obsCoarseDelaySigma();
718  if (isinf(f) != 0)
719  {
721  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
722  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
724  " contains wrong sigma (inf) for the single band delay", true);
725  isSbdSigmaInf = true;
726  f = 1.0;
727  };
728  if (isnan(f) != 0)
729  {
731  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
732  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
734  " contains wrong sigma (nan) for the single band delay", true);
735  isSbdSigmaNan = true;
736  f = 1.0;
737  };
738  o->sbDelay().setSigma(f);
739  //
740  // group delay sigma (in seconds):
741  f = bd05->obsDelaySigma();
742  if (isinf(f) != 0)
743  {
745  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
746  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
748  " contains wrong sigma (inf) for the group delay", true);
749  isGrdSigmaInf = true;
750  f = 1.0e-6;
751  };
752  if (isnan(f) != 0)
753  {
755  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
756  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
758  " contains wrong sigma (nan) for the group delay", true);
759  isGrdSigmaNan = true;
760  f = 1.0e-6;
761  };
762  o->grDelay().setSigma(f);
763  //
764  // delay rate sigma:
765  f = bd05->obsDelayRateSigma();
766  if (isinf(f) != 0)
767  {
769  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
770  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
772  " contains wrong sigma (inf) for the group delay", true);
773  isPhrSigmaInf = true;
774  f = 1.0e-6;
775  };
776  if (isnan(f) != 0)
777  {
779  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
780  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
782  " contains wrong sigma (nan) for the group delay", true);
783  isPhrSigmaNan = true;
784  f = 1.0e-6;
785  };
786  o->phDRate().setSigma(f);
787  // complain:
788  if (isSbdSigmaNan || isSbdSigmaInf ||
789  isGrdSigmaNan || isGrdSigmaInf ||
790  isPhrSigmaNan || isPhrSigmaInf )
791  {
792  QString s1(""), s2(""), s3("");
793  s1 = (isSbdSigmaNan || isGrdSigmaNan || isPhrSigmaNan)?"(nan)":"(inf)";
794  if (isSbdSigmaNan || isSbdSigmaInf)
795  s2 = "single band delay, ";
796  if (isGrdSigmaNan || isGrdSigmaInf)
797  s2+= "group delay, ";
798  if (isPhrSigmaNan || isPhrSigmaInf)
799  s2+= "delay rate, ";
800  s2 = s2.left(s2.size() - 2);
801  if (o->getFourfitOutputFName().size())
802  s3 = obs->getScanName().trimmed() + "/" + o->getFourfitOutputFName();
804  "::processKombFile(): The observation #" + QString("").setNum(obsIdx) +
805  ", " + s3 + " contains wrong sigma " + s1 + " for " + s2 + ".");
806  };
807  //
808  // single band:
810  // group delay:
811  o->grDelay().setResidualFringeFitting(bd05->obsDelayResid()); // sec
812  // delay rate:
813  o->phDRate().setResidualFringeFitting(bd05->obsDelayRateResid()); // sec per sec
814  // bd05->obsCoarseDelayRateResid() ?
815  //
816  //
818  // KOMB mix quality code and error code in one field:
819  str = bd02->kombQualityCode();
820  nTmp = str.toInt(&isTmp);
821  o->setQualityFactor(isTmp ? nTmp : 0);
822  o->setErrorCode(isTmp ? "" : str);
823 
824 //std::cout << " ---- i=" << obsIdx << " KOMBf= [" << qPrintable(kombFileName) << "]"
825 //<< " errorCode: [" << qPrintable(o->getErrorCode()) << "]\n";
826  //
828  //
829  o->setReferenceFrequency((refFreq=bd01->procRefFreq()*1.0e-6)); // Hz->MHz
831  o->setTotalPhase(bd02->obsTotalPhaseAtReferEpoch()*DEG2RAD); // in radians
834  o->setSnr(bd05->snr());
838 
839  o->setAprioriDra(0, ap_0);
840  o->setAprioriDra(1, ap_1);
841  o->setAprioriDra(2, ap_2);
842  // undefined:
843  // single band:
844  o->sbDelay().setGeocenterValue(0.0);
845  // group delay:
846  o->grDelay().setGeocenterValue(0.0);
847  // delay rate:
848  o->phDRate().setGeocenterValue(0.0);
849  //
850  //
851  // alloc auxiliary data:
852  if (!station1Info->auxObservationByScanId()->contains(scanId)) // new scan, insert data:
853  {
854  auxObs_1 = new SgVlbiAuxObservation;
855  auxObs_1->setMJD(epoch);
856  station1Info->auxObservationByScanId()->insert(scanId, auxObs_1);
857  }
858  else
859  auxObs_1 = station1Info->auxObservationByScanId()->value(scanId);
860  if (!station2Info->auxObservationByScanId()->contains(scanId)) // new scan, insert data:
861  {
862  auxObs_2 = new SgVlbiAuxObservation;
863  auxObs_2->setMJD(epoch);
864  station2Info->auxObservationByScanId()->insert(scanId, auxObs_2);
865  }
866  else
867  auxObs_2 = station2Info->auxObservationByScanId()->value(scanId);
868  //
869  if (auxObs_1->getRefClockOffset() != 0.0 &&
870  auxObs_1->getRefClockOffset() != ob01->aPrioriRefClockOffset())
871  {
873  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
874  " extracted from the KOMB file " + kombFileName +
875  " at the baseline " + baselineName + " observing " + sourceName + " at " +
876  epoch.toString(SgMJD::F_YYYYMMDDHHMMSSSS) + " contains a reference clock offset (" +
877  QString("").setNum(ob01->aPrioriRefClockOffset()) +
878  ") that differs from previous data value (" +
879  QString("").setNum( auxObs_1->getRefClockOffset()) + "), diff=" +
880  QString("").setNum((auxObs_1->getRefClockOffset() - ob01->aPrioriRefClockOffset())*1.0e9) +
881  "ns");
882  };
883  if (prtOffset != 0.0)
884  auxObs_1->setRefClockOffset(prtOffset);
885  //
886  //
887  // aux data:
888  // undefined in KOMB files:
889  o->setStartOffset(0);
890  o->setStopOffset (0);
891  o->setCentrOffset(0.0);
893  o->setAcceptedRatio(0.0);
894  o->setDiscardRatio(bd02->rejectionRate());
895 
896  // set up epochs of events:
897  // correlation:
899  // fringing:
901  // nominal scan time:
902  o->setEpochOfScan(tZero);
903  //
904  // "central" scan epoch:
905  o->setEpochCentral(bd02->tObsCentral());
906  // and another couple of epochs:
907  // "start":
908  o->setTstart(ob01->tStart());
909  // "stop":
910  o->setTstop(ob01->tFinis());
911  //
912  // ?
913  o->setSampleRate(ob01->videoBandWidth()*2.0); // Hz
914  //
915 // o->setBitsPerSample(si_1.bits_sample_); ???
916  //
917  // collect data necessary to evaluate the effective frequencies (for ionospheric correction):
918  for (int i=0; i<numOfChannels; i++)
919  {
920  // "Yes the NPP data in USB and LSB order in the komb file":
923  /*
924  o->numOfAccPeriodsByChan_LSB()->setElement(i, bd02->procPpNumTable(i, 0));
925  o->numOfAccPeriodsByChan_USB()->setElement(i, bd02->procPpNumTable(i, 1));
926  */
927  //
928  // just no weights here:
929  o->numOfSamplesByChan_USB() ->setElement(i, 0.0);
930  o->numOfSamplesByChan_LSB() ->setElement(i, 0.0);
931  o->refFreqByChan() ->setElement(i, bd01->rfFreqs(i)*1.0e-6); // ->MHz
932  //(*o->polarization_1ByChan())[i] = ;
933  //(*o->polarization_2ByChan())[i] = ;
934  o->fringeAmplitudeByChan() ->setElement(i, bd05->fringeAmpPhase(i, 0));
935  o->fringePhaseByChan() ->setElement(i, bd05->fringeAmpPhase(i, 1)*DEG2RAD);
936  //
937  // phase calibration data:
938  // phase cal data: amplitude, phase, freq, offset and error rate:
939  o->phaseCalData_1ByChan() ->setElement(0,i, bd03->phaseCalAmpPhase1(i, 0)*1.0e4);
940  o->phaseCalData_2ByChan() ->setElement(0,i, bd04->phaseCalAmpPhase2(i, 0)*1.0e4);
941  // phases:
942  o->phaseCalData_1ByChan() ->setElement(1,i, bd03->phaseCalAmpPhase1(i, 1)*DEG2RAD);
943  o->phaseCalData_2ByChan() ->setElement(1,i, bd04->phaseCalAmpPhase2(i, 1)*DEG2RAD);
944  // freqs:
945  o->phaseCalData_1ByChan() ->setElement(2,i, ob03->phCalFreqs(i)*1.0e-3);
946  o->phaseCalData_2ByChan() ->setElement(2,i, ob03->phCalFreqs(i)*1.0e-3);
947  // offsets (there are no phase cal offsets in KOMB files)
948  o->phaseCalData_1ByChan() ->setElement(3,i, 0.0);
949  o->phaseCalData_2ByChan() ->setElement(3,i, 0.0);
950  // error rates (there are no error rates in KOMB files too):
951  o->phaseCalData_1ByChan() ->setElement(4,i, 0.0);
952  o->phaseCalData_2ByChan() ->setElement(4,i, 0.0);
953  //
954  //(*o->chanIdByChan()) [i] = ;
955  //(*o->corelIndexNumG())[i] = ;
956  //(*o->corelIndexNumLSB())[i] = ;
957  // o->loFreqByChan_1()->setElement(i, ??);
958  //(*o->bbcIdxByChan_1())[i] = ??;
959  // o->loFreqByChan_2()->setElement(i, ??);
960  //(*o->bbcIdxByChan_2())[i] = ??;
961  };
962  //
963  // check and rescale phase cal data
964  //
965  for (int i=0; i<numOfChannels; i++)
966  {
967  for (int j=0; j<5; j++)
968  {
969  if (isnan(o->phaseCalData_1ByChan()->getElement (j,i)))
970  {
972  "::processKombFile(): st1 one of phase cal values is NAN " +
973  QString("").sprintf("(chan=%d:dat=%d)", i, j) + " from the scan " + obs->getScanName() +
974  " KOMB file " + kombFileName);
975  o->phaseCalData_1ByChan()->setElement (j,i, -100.0);
976  };
977  if (isnan(o->phaseCalData_2ByChan()->getElement (j,i)))
978  {
980  "::processKombFile(): st2 one of phase cal values is NAN " +
981  QString("").sprintf("(chan=%d:dat=%d)", i, j) + " from the scan " + obs->getScanName() +
982  " KOMB file " + kombFileName);
983  o->phaseCalData_2ByChan()->setElement (j,i, -100.0);
984  };
985  };
986  };
987  //
989  *o->refFreqByChan(), *o->fringeAmplitudeByChan(),
991  o->getSampleRate(), refFreq, numOfChannels,
992  effFreq4GR, effFreq4PH, effFreq4RT, getCorrelatorType(), o->strId());
993  o->grDelay().setEffFreq(effFreq4GR);
994  o->phDelay().setEffFreq(effFreq4PH);
995  o->phDRate().setEffFreq(effFreq4RT);
996 // o->setPhaseCalModes(t207->pcal_mode);
997  //
998  //
999 // o->setFourfitVersion(0, t204->ff_version[0]);
1000 // o->setFourfitVersion(1, t204->ff_version[1]);
1001 // o->setFourfitControlFile(t204->control_file);
1002 // o->setFourfitCommandOverride(t204->override);
1003  //
1004 // o->setPhaseCalRates(0, bd03->phaseCalRate1()*1.0e6); // sec->usec
1005 // o->setPhaseCalRates(1, bd03->phaseCalRate2()*1.0e6); // sec->usec
1006  o->setPhaseCalRates(0, bd03->phaseCalRate1()); // sec
1007  o->setPhaseCalRates(1, bd03->phaseCalRate2()); // sec
1008 // o->setUvFrPerAsec(0, t202->u);
1009 // o->setUvFrPerAsec(1, t202->v);
1010 // o->setUrVr(0, t202->uf);
1011 // o->setUrVr(1, t202->vf);
1012 // o->setCorrClocks(0, 0, t202->ref_clock*1.0e-6); // musec -> sec
1013 // o->setCorrClocks(0, 1, t202->rem_clock*1.0e-6); // musec -> sec
1014 // o->setCorrClocks(1, 0, t202->ref_clockrate);
1015 // o->setCorrClocks(1, 1, t202->rem_clockrate);
1016 // o->setInstrDelay(0, t202->ref_idelay*1.0e-6); // musec -> sec
1017 // o->setInstrDelay(1, t202->rem_idelay*1.0e-6); // musec -> sec
1018 // o->setNlags(t202->nlags);
1019  o->setCentrOffset((ob01->tRefer() - bd02->tObsCentral())*DAY2SEC); // DELTAEPO
1021  o->vDlys()->setElement(1, bd05->phaseDelayAtReferEpoch());
1023  o->vAuxData()->setElement(0, ob01->aPrioriClockError()*1.0e6); // APCLOFST sec->usec
1024  o->vAuxData()->setElement(1, bd02->obsTotalPhaseAtCentrlEpoch()*DEG2RAD); // TOTPCENT
1025  o->vAuxData()->setElement(2, bd02->obsDelayRateAtCentrlEpoch()); // RATOBSVM
1026  o->vAuxData()->setElement(3, bd02->obsDelayAtCentrlEpoch()); // DELOBSVM
1027 
1028  o->setFourfitSearchParameters(0, bd02->searchWndCoarseDelay(0)*1.0e6); // sec->usec
1029  o->setFourfitSearchParameters(1, bd02->searchWndCoarseDelay(1)*1.0e6); // sec->usec
1030  o->setFourfitSearchParameters(2, bd02->searchWndFineDelay(0)*1.0e6); // sec->usec
1031  o->setFourfitSearchParameters(3, bd02->searchWndFineDelay(1)*1.0e6); // sec->usec
1032  o->setFourfitSearchParameters(4, bd02->searchWndFineDelayRate(0)*1.0e6);// sec->usec
1033  o->setFourfitSearchParameters(5, bd02->searchWndFineDelayRate(1)*1.0e6);// sec->usec
1034  //
1035  // per band statistics:
1036  bandStation1Info->incNumTotal(DT_DELAY);
1037  bandStation2Info->incNumTotal(DT_DELAY);
1038  bandSourceInfo->incNumTotal(DT_DELAY);
1039  bandBaselineInfo->incNumTotal(DT_DELAY);
1040 
1041  bandStation1Info->incNumTotal(DT_RATE);
1042  bandStation2Info->incNumTotal(DT_RATE);
1043  bandSourceInfo->incNumTotal(DT_RATE);
1044  bandBaselineInfo->incNumTotal(DT_RATE);
1045  };
1046 };
1047 /*=====================================================================================================*/
1048 
1049 
1050 
1051 
1052 
1053 
1054 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
#define DAY2SEC
radians to mas:
Definition: SgMathSupport.h:69
#define DEG2RAD
degrees to seconds:
Definition: SgMathSupport.h:49
QMap< QString, QString > src2src
QMap< QString, QString > stn2stn
void evaluateEffectiveFreqs(const SgVector &numOfAccPeriodsByChan_USB, const SgVector &numOfAccPeriodsByChan_LSB, const SgVector &refFreqByChan, const SgVector &fringeAmplitudeByChan, const SgVector &numOfSamplesByChan_USB, const SgVector &numOfSamplesByChan_LSB, double sampleRate, double refFreq, int numOfChannels, double &effFreq4GR, double &effFreq4PH, double &effFreq4RT, const QString &correlatorType, const QString &oId, bool useEqualWeights=false)
@ DT_DELAY
Definition: SgWrmsable.h:44
@ DT_RATE
Definition: SgWrmsable.h:45
bool isAttr(uint a) const
Definition: SgAttribute.h:226
void addAttr(uint a)
Definition: SgAttribute.h:202
const char * tapeQualityCode() const
Definition: SgKombFormat.h:420
double rfFreqs(int i) const
Definition: SgKombFormat.h:422
short totalNumOfProcChannels() const
Definition: SgKombFormat.h:418
const SgMJD & tProcByKomb() const
Definition: SgKombFormat.h:423
double procRefFreq() const
Definition: SgKombFormat.h:421
const char * kombQualityCode() const
Definition: SgKombFormat.h:489
double obsDelayRateAtCentrlEpoch() const
Definition: SgKombFormat.h:499
float obsTotalPhaseAtReferEpoch() const
Definition: SgKombFormat.h:505
float obsTotalPhaseAtEarthCenterEpoch() const
Definition: SgKombFormat.h:506
short procPpNumTable(int i, int j) const
Definition: SgKombFormat.h:492
float searchWndCoarseDelay(int i) const
Definition: SgKombFormat.h:501
double obsDelayAtCentrlEpoch() const
Definition: SgKombFormat.h:498
float obsResidPhaseAtEarthCenterEpoch() const
Definition: SgKombFormat.h:507
float searchWndFineDelay(int i) const
Definition: SgKombFormat.h:502
float searchWndFineDelayRate(int i) const
Definition: SgKombFormat.h:503
float obsTotalPhaseAtCentrlEpoch() const
Definition: SgKombFormat.h:500
float effectiveIntegrationPeriod() const
Definition: SgKombFormat.h:495
const SgMJD & tObsCentral() const
Definition: SgKombFormat.h:508
float rejectionRate() const
Definition: SgKombFormat.h:496
float phaseCalAmpPhase1(int i, int j) const
Definition: SgKombFormat.h:581
double phaseCalRate2() const
Definition: SgKombFormat.h:580
double phaseCalRate1() const
Definition: SgKombFormat.h:579
float phaseCalAmpPhase2(int i, int j) const
Definition: SgKombFormat.h:638
float obsDelaySigma() const
Definition: SgKombFormat.h:700
double obsCoarseDelayResid() const
Definition: SgKombFormat.h:706
float fringeAmpPhase(int i, int j) const
Definition: SgKombFormat.h:712
double obsDelayResid() const
Definition: SgKombFormat.h:699
double phaseDelayAtReferEpoch() const
Definition: SgKombFormat.h:709
double phaseDelayAtReferEpochPlus_1sec() const
Definition: SgKombFormat.h:710
double phaseDelayAtReferEpochMinus_1sec() const
Definition: SgKombFormat.h:711
double obsDelayRateResid() const
Definition: SgKombFormat.h:703
float obsDelayAmbiguity() const
Definition: SgKombFormat.h:701
float falseDetectionProbability() const
Definition: SgKombFormat.h:697
double obsDelayRateAtReferEpoch() const
Definition: SgKombFormat.h:702
float snr() const
Definition: SgKombFormat.h:695
float fineSearchFringeAmplitude() const
Definition: SgKombFormat.h:693
double obsCoarseDelayAtReferEpoch() const
Definition: SgKombFormat.h:705
float obsCoarseDelaySigma() const
Definition: SgKombFormat.h:707
float incohFringeAmplitude() const
Definition: SgKombFormat.h:696
float coarseSearchFringeAmplitude() const
Definition: SgKombFormat.h:694
float obsDelayRateSigma() const
Definition: SgKombFormat.h:704
double obsDelayAtReferEpoch() const
Definition: SgKombFormat.h:698
const SgMJD & tStart() const
Definition: SgKombFormat.h:229
float videoBandWidth() const
Definition: SgKombFormat.h:219
const char * station1Name() const
Definition: SgKombFormat.h:222
const SgMJD & tRefer() const
Definition: SgKombFormat.h:231
double aPrioriObses(int i) const
Definition: SgKombFormat.h:224
double aPrioriClockError() const
Definition: SgKombFormat.h:225
const SgMJD & tProcByCorr() const
Definition: SgKombFormat.h:232
double aPrioriRefClockOffset() const
Definition: SgKombFormat.h:226
const char * station2Name() const
Definition: SgKombFormat.h:223
const SgMJD & tFinis() const
Definition: SgKombFormat.h:230
const char * sourceName() const
Definition: SgKombFormat.h:221
const char * baselineId() const
Definition: SgKombFormat.h:209
const char * correlatorFileName() const
Definition: SgKombFormat.h:213
float phCalFreqs(int i) const
Definition: SgKombFormat.h:362
const SgKombOb03Record & ob03() const
Definition: SgKombFormat.h:786
const SgKombBd03Record * bd03(const QString &bandKey) const
Definition: SgKombFormat.h:799
bool isOk() const
Definition: SgKombFormat.h:805
const SgKombBd04Record * bd04(const QString &bandKey) const
Definition: SgKombFormat.h:801
const SgKombBd05Record * bd05(const QString &bandKey) const
Definition: SgKombFormat.h:803
const SgKombBd01Record * bd01(const QString &bandKey) const
Definition: SgKombFormat.h:795
const SgKombBd02Record * bd02(const QString &bandKey) const
Definition: SgKombFormat.h:797
const SgKombOb01Record & ob01() const
Definition: SgKombFormat.h:784
void readFile(const QString &fileName)
const char * experimentCode() const
Definition: SgKombFormat.h:810
const QMap< QString, QString > & mapOfBands() const
Definition: SgKombFormat.h:793
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_BIN
Definition: SgLogger.h:64
@ IO_DBH
Definition: SgLogger.h:67
Definition: SgMJD.h:59
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
Definition: SgMJD.h:67
@ F_INTERNAL
Digits, date and time: 20100402.71.
Definition: SgMJD.h:72
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1008
int calcHour() const
Definition: SgMJD.h:493
int calcDayOfYear() const
Definition: SgMJD.cpp:238
static SgMJD currentMJD()
Definition: SgMJD.cpp:119
int calcMin() const
Definition: SgMJD.h:500
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
void setKey(const QString &key)
Definition: SgObjectInfo.h:447
int getIdx() const
Definition: SgObjectInfo.h:335
void incNumTotal(DataType, int=1)
Definition: SgObjectInfo.h:519
const QString & getKey() const
Definition: SgObjectInfo.h:319
virtual int getMediaIdx() const
virtual void setMediaIdx(int idx)
virtual void setMJD(const SgMJD &)
void setElement(unsigned int i, double d)
Definition: SgVector.h:348
double getRefClockOffset() const
void setRefClockOffset(double d)
void setFrequency(double f)
Definition: SgVlbiBand.h:402
void setTCreation(const SgMJD &t)
Definition: SgVlbiBand.h:410
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
Definition: SgVlbiBand.h:376
QMap< QString, SgVlbiStationInfo * > & stationsByName()
Definition: SgVlbiBand.h:368
void setInputFileName(const QString &fileName)
Definition: SgVlbiBand.h:418
void setInputFileVersion(int version)
Definition: SgVlbiBand.h:426
QMap< int, SgVlbiBaselineInfo * > & baselinesByIdx()
Definition: SgVlbiBand.h:304
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
Definition: SgVlbiBand.h:384
QMap< int, SgVlbiSourceInfo * > & sourcesByIdx()
Definition: SgVlbiBand.h:312
double getFrequency() const
Definition: SgVlbiBand.h:320
QMap< int, SgVlbiStationInfo * > & stationsByIdx()
Definition: SgVlbiBand.h:296
@ Attr_PRIMARY
the band is a primary band;
Definition: SgVlbiBand.h:60
void setAmbiguitySpacing(double)
void setEffFreq(double)
void setResidualFringeFitting(double r)
void setGeocenterValue(double)
void setAlternateValue(double)
void setEpochOfCorrelation(const SgMJD &)
const QString & getFourfitOutputFName() const
void setEpochCentral(const SgMJD &)
void setTstart(const SgMJD &t)
void setTotalPhase(double)
double getSampleRate() const
void setIncohSegmAddAmp(double d)
SgMatrix * phaseCalData_2ByChan()
void setAcceptedRatio(double d)
void setTstop(const SgMJD &t)
void setEpochOfFourfitting(const SgMJD &)
SgVector * numOfAccPeriodsByChan_LSB()
void setIncohChanAddAmp(double d)
void setCentrOffset(double offset)
void setEffIntegrationTime(double d)
void setFourfitOutputFName(const QString &)
SgVector * numOfAccPeriodsByChan_USB()
SgVlbiMeasurement & phDRate()
void setGeocenterResidPhase(double d)
void setSnr(double)
void setProbabOfFalseDetection(double d)
void setQualityFactor(int)
QString strId() const
void setGeocenterTotalPhase(double d)
void setDiscardRatio(double d)
SgVector * fringeAmplitudeByChan()
void setCorrCoeff(double)
SgVector * vAuxData()
void setEpochOfScan(const SgMJD &)
SgVector * numOfSamplesByChan_LSB()
void setAprioriDra(int i, double d)
void setPhaseCalRates(int i, double d)
void setStopOffset(int offset)
SgVector * vDlys()
void setErrorCode(const QString &)
SgMatrix * phaseCalData_1ByChan()
SgVector * numOfSamplesByChan_USB()
void setReferenceFrequency(double)
double getReferenceFrequency() const
void allocateChannelsSetupStorages(int numOfChans)
SgVlbiMeasurement & phDelay()
void setTapeQualityCode(const QString &code)
SgVlbiMeasurement & grDelay()
void setStartOffset(int offset)
SgVlbiMeasurement & sbDelay()
SgVector * fringePhaseByChan()
SgVector * refFreqByChan()
void setFourfitSearchParameters(int i, double d)
void setSampleRate(double sr)
void setStation1Idx(short int idx)
void setScanId(const QString &sId)
void setSourceIdx(short int idx)
bool addObservable(const QString &, const SgVlbiObservable &)
void setScanName(const QString &sName)
void setupActiveObservable(const QString &)
void setCorrRootFileName(const QString &sName)
void setStation2Idx(short int idx)
SgVlbiObservable * observable(const QString &)
const QString & getScanName() const
QMap< QString, SgVlbiObservable * > & observableByKey()
const QString & getKey()
void setBaselineIdx(short int idx)
void setKey(const QString &)
const QString & getCorrelatorType() const
void setOfficialName(const QString &name)
void setSchedulerName(const QString &name)
void setSessionCode(const QString &code)
@ OT_KOMB
observations are from KOMB output (generated by NICT, Japan);
void setName(const QString &name)
void setCorrelatorType(const QString &name)
CorrelatorPostProcSoftware cppsSoft_
@ Attr_FF_CREATED
the session has been imported from correlator;//vgosDbMake
@ CPPS_UNKNOWN
unknown (=all others);
void setNetworkSuffix(const QString &suffix)
QString sessionCode_
official session code (from Masterfile);
void setSubmitterName(const QString &name)
void setCorrelatorName(const QString &name)
void setOriginType(OriginType type)
StationsByName stationsByName_
QMap< QString, SgVlbiObservation * > observationByKey_
QList< SgVlbiBand * > bands_
bool getDataFromKombFiles(const QString &path2, const QString &altDatabaseName, const QString &altCorrelatorName, const QString &historyFileName, const QString &mapFileName, bool need2correctRefClocks)
bool selfCheck(bool guiExpected)
void processKombFile(const QString &path2file, const QString &kombFileName, const QMap< QString, QString > &stn2stn, const QMap< QString, QString > &src2src, const QMap< QString, QString > &bnd2bnd)
QMap< QString, SgVlbiBand * > bandByKey_
QList< SgVlbiObservation * > observations_
bool getCorrelatorHistory(const QString &fileName)
QMap< int, SgVlbiStationInfo * > stationsByIdx_
void importMapFile(const QString &mapFileName, QMap< QString, QString > &map4Stn, QMap< QString, QString > &map4Src, QMap< QString, QString > &map4Bnd)
BaselinesByName baselinesByName_
SgVlbiBand * primaryBand_
static QString className()
QMap< int, SgVlbiBaselineInfo * > baselinesByIdx_
SourcesByName sourcesByName_
bool check4NameMap(const QMap< QString, QString > &map, QString &name)
QMap< int, SgVlbiSourceInfo * > sourcesByIdx_
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
void setSid(char c1, char c2)