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/QTextStream>
35 #include <QtCore/QVector>
36 
37 
38 
39 #include <SgVlbiSession.h>
40 
41 #include <SgConstants.h>
42 #include <SgKombFormat.h>
43 #include <SgLogger.h>
44 #include <SgVersion.h>
45 #include <SgVlbiBand.h>
46 #include <SgVlbiObservation.h>
47 
48 
49 
50 
51 
52 
53 
54 /*=======================================================================================================
55 *
56 * Auxiliary data structures
57 *
58 *======================================================================================================*/
59 
60 
61 
62 
63 
64 // these two variables are declared in SgVlbiSessionIoFringes.cpp:
65 extern QMap<QString, QString> stn2stn;
66 extern QMap<QString, QString> src2src;
67 
68 
69 /*=======================================================================================================
70 *
71 * I/O utilities:
72 *
73 *======================================================================================================*/
74 //
75 bool SgVlbiSession::getDataFromKombFiles(const QString& path2data,
76  const QString& altDatabaseName, const QString& altCorrelatorName,
77  const QString& historyFileName, const QString& mapFileName, bool need2correctRefClocks)
78 {
79  bool isOk=false;
80  QDir dir(path2data);
81  QList<QString> files2read;
82  QStringList entryList;
83  QRegExp reKombFileName("B[0-9]{2,}");
84  int idx;
85  QString correlatorComments(historyFileName);
86  // for name maps:
87  QMap<QString, QString> stn2stn;
88  QMap<QString, QString> src2src;
89  QMap<QString, QString> bnd2bnd;
90 
91  //
92  if (need2correctRefClocks)
94 
95  //
96  files2read = dir.entryList(QDir::Files | QDir::Readable | QDir::NoDotAndDotDot, QDir::Name);
97  if (files2read.size() == 0)
98  {
100  "::getDataFromKombFiles(): nothing to read");
101  return isOk;
102  };
103 
104  // get the maps:
105  //
106  importMapFile(mapFileName, stn2stn, src2src, bnd2bnd);
107  if (stn2stn.size())
109  "::getDataFromKombFiles(): loaded " + QString("").setNum(stn2stn.size()) +
110  " entries for station name maps");
111  if (src2src.size())
113  "::getDataFromKombFiles(): loaded " + QString("").setNum(src2src.size()) +
114  " entries for source name maps");
115  if (bnd2bnd.size())
117  "::getDataFromKombFiles(): loaded " + QString("").setNum(bnd2bnd.size()) +
118  " entries for band code maps");
119  //
120  //
121  for (int i=0; i<files2read.size(); i++)
122  if (files2read.at(i).contains(reKombFileName))
123  entryList << files2read.at(i);
125  "::getDataFromKombFiles(): filtered " + QString("").setNum(entryList.size()) +
126  " scan entries from " + QString("").setNum(files2read.size()) + " total number of directories");
127 
128  //
129  //
130  for (int i=0; i<entryList.size(); i++)
131  {
132  const QString &inKombFileName=entryList.at(i);
133  QFileInfo fi(path2data + "/" + inKombFileName);
134  int kombFileSize=QFileInfo(path2data + "/" + inKombFileName).size();
135  if (kombFileSize%256 != 0)
137  "::getDataFromKombFiles(): unexpected size of the file " + path2data + "/" + inKombFileName +
138  ": " + QString("").setNum(kombFileSize) + ", skipped");
139  else
140  processKombFile(path2data, inKombFileName, stn2stn, src2src, bnd2bnd);
141  };
142  //
143  //
144  // check did we read something at all:
145  if (!bands_.size())
146  {
148  "::getDataFromKombFiles(): nothing useful found");
149  return false;
150  };
151  //
152  //
153  setOriginType(OT_KOMB); // flag it
154  setCorrelatorType("GSI ");
156  //
157  if (cppsSoft_ == CPPS_UNKNOWN)
159  //
160  //
161  // set global stuff here:
162  //
163  if (altDatabaseName.size() == 9)
164  {
165  setName(altDatabaseName);
166  setNetworkSuffix(altDatabaseName.at(8));
167  setOfficialName("UNKN");
168  if (altCorrelatorName.size())
169  {
170  setCorrelatorName(altCorrelatorName);
172  "::getDataFromKombFiles(): correlator name was explicitly set to " + altCorrelatorName);
173  };
174  setSubmitterName("UNKN");
175  setSchedulerName("UNKN");
177  "::getDataFromKombFiles(): the database name was explicitly set to " + altDatabaseName);
178  }
179  else if (altDatabaseName.size() && altDatabaseName.size()!=9)
181  "::getDataFromKombFiles(): the provided database name, " + altDatabaseName +
182  ", was ignored");
183  //
184  //
185  QMap<double, SgVlbiBand*> bandByFreq;
186  QString str("");
187  for (int i=0; i<bands_.size(); i++)
188  {
189  SgVlbiBand *band=bands_.at(i);
190  QString bandKey=band->getKey();
191  band->setTCreation(SgMJD::currentMJD().toUtc());
192  band->setInputFileName(path2data + "/*");
193  band->setInputFileVersion(0);
194  //
195  // quick'n'dirty:
196  idx = 0;
197  SgVlbiObservable *o=observations_.at(idx)->observable(bandKey);
198  while (!o && idx<observations_.size())
199  o = observations_.at(idx++)->observable(bandKey);
200  if (o)
202  else
204  "::getDataFromKombFiles(): cannot set up a frequency for " + bandKey + "-band");
205  if (bandByFreq.contains(band->getFrequency()))
206  {
208  "::getDataFromKombFiles(): the frequency " + QString("").setNum(band->getFrequency()) +
209  " is already registered");
210  }
211  else
212  bandByFreq.insert(band->getFrequency(), band);
213  };
214  //
215  //
216  // load correlator's comments for history records:
217  //
218  if (correlatorComments.size()==0)
219  {
220  dir.setPath(path2data + "/../control/");
221  str = "";
222  if (!dir.exists())
224  "::getDataFromKombFiles(): cannot get correlator comments, the directory does not exist: " +
225  dir.path());
226  else
227  {
228  entryList.clear();
229  entryList = dir.entryList(QStringList() << "*.corr",
230  QDir::Files | QDir::NoDotAndDotDot | QDir::Readable, QDir::Name);
231  if (entryList.size() == 0)
232  {
234  "::getDataFromKombFiles(): cannot get correlator comments, no any *.corr file found: " +
235  dir.path());
236  }
237  else if (entryList.size() > 1)
238  {
240  "::getDataFromKombFiles(): found more than one file with correlator comments:");
241  for (int j=0; j<entryList.size(); j++)
243  "::getDataFromKombFiles(): " + entryList.at(j));
244  str = entryList.at(0);
246  "::getDataFromKombFiles(): picked up this one: " + str);
247  }
248  else
249  str = entryList.at(0);
250  };
251  if (str.size())
252  correlatorComments = path2data + "/../control/" + str;
253  };
254  if (correlatorComments.size())
255  getCorrelatorHistory(correlatorComments);
256  else
257  {
258  for (int i=0; i<bands_.size(); i++)
259  {
260  bands_.at(i)->history().addHistoryRecord("== The correlator report was not provided. ==",
261  SgMJD::currentMJD().toUtc());
262  bands_.at(i)->history().addHistoryRecord("== ", SgMJD::currentMJD().toUtc());
263  };
265  "::getDataFromKombFiles(): the correlator report was not provided.");
266  };
267  //
268  //
269  // set up a primary band:
270  // standard IVS case:
271  QString primeBandKey;
272  if (bandByKey_.size()==2 && bandByKey_.contains("X") && bandByKey_.contains("S"))
273  {
275  "::getDataFromKombFiles(): importing typical IVS session");
276  primaryBand_ = bandByKey_.value("X");
277  }
278  else
279  {
281  "::getDataFromKombFiles(): importing a foreign session setup");
282  if (bandByFreq.size() > 1)
283  primaryBand_ = bandByFreq.begin().value();
284  else
285  primaryBand_ = bands_.at(0);
286  };
288  primeBandKey = primaryBand_->getKey();
289  //
290  // remove observations that are not in the primary band:
291  int num;
292  idx = num = 0;
293  while (idx<observations_.size())
294  {
295  SgVlbiObservation *obs=observations_.at(idx);
296  if (!obs->observable(primeBandKey))
297  {
298  observationByKey_.remove(obs->getKey());
299  observations_.removeAt(idx);
300  idx--;
301  num++;
302  delete obs;
303  };
304  idx++;
305  };
306  if (num)
308  "::getDataFromKombFiles(): " + QString("").setNum(num) +
309  " second-band-only observation" + (num==1?"":"s") + " were removed");
310  //
311  //
312  if (selfCheck(false))
314  "::getDataFromKombFiles(): session selfcheck complete");
315  else
316  {
318  "::getDataFromKombFiles(): the selfcheck for the session failed");
319  return false;
320  };
321  // calculate aux data:
322  for (int i=0; i<observations_.size(); i++)
323  {
324  SgVlbiObservation *obs=observations_.at(i);
325  for (QMap<QString, SgVlbiObservable*>::iterator it=obs->observableByKey().begin();
326  it!=obs->observableByKey().end(); ++it)
327  {
328  SgVlbiObservable *o=it.value();
329  o->calcPhaseCalDelay();
330  };
331  };
333  "::getDataFromKombFiles(): phase cal delays were calculated");
334  //
335  //
336  //
337  return true;
338 };
339 
340 
341 
342 //
343 void SgVlbiSession::processKombFile(const QString& path2file, const QString& kombFileName,
344  const QMap<QString, QString>& stn2stn, const QMap<QString, QString>& src2src,
345  const QMap<QString, QString>& bnd2bnd)
346 {
347  SgKombReader kombReader;
348  QString str("");
349 
351  "::processKombFile(): reading KOMB file " + kombFileName);
352  kombReader.readFile(path2file + "/" + kombFileName);
353  if (!kombReader.isOk())
354  {
356  "::processKombFile(): the KOMB file " + kombFileName + " is not Ok; skipped");
357  return;
358  };
359 
360 // what need to be checked:
361 // stationInfo->setSid('-', '-'); ?
362 
363  SgVlbiBand *band=NULL;
364  //
365  QString bandKey("");
366  QString station1Name, station2Name, sourceName, baselineName;
367  QString scanName, scanId, obsKey;
368  int obsIdx;
369  int nTmp;
370  double f;
371  SgMJD epoch;
372  SgVlbiStationInfo *station1Info, *station2Info;
373  SgVlbiStationInfo *bandStation1Info, *bandStation2Info;
374  SgVlbiSourceInfo *sourceInfo, *bandSourceInfo;
375  SgVlbiBaselineInfo *baselineInfo, *bandBaselineInfo;
376  SgVlbiObservation *obs=NULL;
377  SgVlbiObservable *o=NULL;
378  SgVlbiAuxObservation *auxObs_1=NULL, *auxObs_2=NULL;
379 
380  double refFreq=0.0;
381  bool isSbdSigmaNan, isSbdSigmaInf;
382  bool isGrdSigmaNan, isGrdSigmaInf;
383  bool isPhrSigmaNan, isPhrSigmaInf;
384  bool isTmp;
385  int numOfChannels;
386  double effFreq4GR=0.0, effFreq4PH=0.0, effFreq4RT=0.0;
387  bool need2adjust4clocks=isAttr(Attr_REF_CLOCKS_ADJUSTED);
388  double ap_0, ap_1, ap_2, ap_3, prtOffset;
389  ap_0 = ap_1 = ap_2 = ap_3 = 0.0;
390  prtOffset = 0.0;
391 
392  // check experiment code:
393  str = QString(kombReader.experimentCode()).simplified();
394  if (sessionCode_=="UNKN")
395  setSessionCode(str);
396  else if (str != sessionCode_)
397  {
399  "::processKombFile(): the KOMB file " + kombFileName + " is belong to another session, " + str +
400  " ours is " + sessionCode_ + "; skipped");
401  return;
402  };
403 
404 
405  for (QMap<QString, QString>::const_iterator it=kombReader.mapOfBands().begin();
406  it!=kombReader.mapOfBands().end(); ++it)
407  {
408  bandKey = QString(it.key()).simplified();
409  //
410  if (bnd2bnd.size())
411  {
412  if (!check4NameMap(bnd2bnd, bandKey))
413  {
415  "::processKombFile(): skipping the observation " + kombFileName +
416  ": the band \"" + bandKey + "\" have to be skipped");
417  continue;
418  };
419  };
420  //
421  if (bandByKey_.contains(bandKey))
422  band = bandByKey_.value(bandKey);
423  else
424  {
425  band = new SgVlbiBand;
426  band->setKey(bandKey);
427  bands_.append(band);
428  bandByKey_.insert(bandKey, band);
429  };
430  const SgKombOb01Record *ob01=&kombReader.ob01();
431  //const SgKombOb02Record *ob02=&kombReader.ob02();
432  const SgKombOb03Record *ob03=&kombReader.ob03();
433  const SgKombBd01Record *bd01=kombReader.bd01(it.key()); // it.key() contains a space char
434  const SgKombBd02Record *bd02=kombReader.bd02(it.key());
435  const SgKombBd03Record *bd03=kombReader.bd03(it.key());
436  const SgKombBd04Record *bd04=kombReader.bd04(it.key());
437  const SgKombBd05Record *bd05=kombReader.bd05(it.key());
438  if (!bd01)
439  {
441  "::processKombFile(): the KOMB file " + kombFileName + ": BD01 record is NULL for the " +
442  bandKey + "-band; skipped");
443  return;
444  };
445  if (!bd02)
446  {
448  "::processKombFile(): the KOMB file " + kombFileName + ": BD02 record is NULL for the " +
449  bandKey + "-band; skipped");
450  return;
451  };
452  if (!bd03)
453  {
455  "::processKombFile(): the KOMB file " + kombFileName + ": BD03 record is NULL for the " +
456  bandKey + "-band; skipped");
457  return;
458  };
459  if (!bd04)
460  {
462  "::processKombFile(): the KOMB file " + kombFileName + ": BD04 record is NULL for the " +
463  bandKey + "-band; skipped");
464  return;
465  };
466  if (!bd05)
467  {
469  "::processKombFile(): the KOMB file " + kombFileName + ": BD05 record is NULL for the " +
470  bandKey + "-band; skipped");
471  return;
472  };
473  //
474  epoch = ob01->tRefer();
475  station1Name.sprintf("%-8s", ob01->station1Name());
476  station2Name.sprintf("%-8s", ob01->station2Name());
477  sourceName .sprintf("%-8s", ob01->sourceName());
478  //
479  // map the names:
480  if (stn2stn.size())
481  {
482  if (!check4NameMap(stn2stn, station1Name))
483  {
485  "::processKombFile(): skipping the observation " + kombFileName +
486  ": the station \"" + station1Name + "\" have to be skipped");
487  return;
488  };
489  if (!check4NameMap(stn2stn, station2Name))
490  {
492  "::processKombFile(): skipping the observation " + kombFileName +
493  ": the station \"" + station2Name + "\" have to be skipped");
494  return;
495  };
496  };
497  if (src2src.size())
498  {
499  if (!check4NameMap(src2src, sourceName))
500  {
502  "::processKombFile(): skipping the observation " + kombFileName +
503  ": the source \"" + sourceName + "\" have to be skipped");
504  return;
505  };
506  };
507  //
508  //
509  baselineName = station1Name + ":" + station2Name;
510  // set up scanId and scanName (KOMB files do not contain scan names):
511  scanId = epoch.toString(SgMJD::F_INTERNAL) + "@" + sourceName;
512  scanName.sprintf("%03d-%02d%02d ",
513  ob01->tStart().calcDayOfYear(), ob01->tStart().calcHour(), ob01->tStart().calcMin());
514 // epoch.calcDayOfYear(), epoch.calcHour(), epoch.calcMin());
515  //
516  obsKey.sprintf("%s",
517  qPrintable(epoch.toString(SgMJD::F_INTERNAL) + "-" + baselineName + "@" + sourceName));
518  //
519  //
520  // check for NaN in delay and rate:
521  f = bd05->obsDelayAtReferEpoch();
522  if (isinf(f) != 0 || isnan(f) != 0)
523  {
525  "::processKombFile(): an observation from KOMB input file \"" + kombFileName +
526  "\" (the baseline " + baselineName +
527  " observing " + sourceName + " source at " + epoch.toString(SgMJD::F_YYYYMMDDHHMMSSSS) +
528  ") contains wrong group delay (NaN or Inf); the observation is skipped", true);
529  return;
530  };
531  f = bd05->obsDelayRateAtReferEpoch();
532  if (isinf(f) != 0 || isnan(f) != 0)
533  {
535  "::processKombFile(): an observation from KOMB input file \"" + kombFileName +
536  "\" (the baseline " + baselineName +
537  " observing " + sourceName + " source at " + epoch.toString(SgMJD::F_YYYYMMDDHHMMSSSS) +
538  ") contains wrong delay rate (NaN or Inf); the observation is skipped", true);
539  return;
540  };
541  // ...continue:
542  //
543  if (observationByKey_.contains(obsKey))
544  obs = observationByKey_.value(obsKey);
545  else
546  {
547  obs = new SgVlbiObservation(this);
548  obs->setMJD(epoch);
549  obs->setScanName(scanName);
550  obs->setScanId(scanId);
552  obs->setKey(obsKey);
553  obs->setMediaIdx(observations_.size());
554  observations_.append(obs);
555  observationByKey_.insert(obsKey, obs);
556  };
557  // pick up or create an observation:
558  o = new SgVlbiObservable(obs, band);
559  obsIdx = obs->getMediaIdx();
560  o->setMediaIdx(obsIdx);
561  obs->addObservable(bandKey, o);
562  obs->setupActiveObservable(bandKey);
563  // determine number of channels:
564  numOfChannels = bd01->totalNumOfProcChannels();
565  o->allocateChannelsSetupStorages(numOfChannels);
566  //
567  //
568  // station #1:
569  if (stationsByName_.contains(station1Name))
570  station1Info = stationsByName_.value(station1Name);
571  else // new station, add it to the container and register its index:
572  {
573  station1Info = new SgVlbiStationInfo(stationsByName_.size(), station1Name);
574  stationsByName_.insert(station1Info->getKey(), station1Info);
575  stationsByIdx_.insert(station1Info->getIdx(), station1Info);
576  station1Info->setCid(*ob01->baselineId());
577  station1Info->setSid('-', '-');
578  };
579  // station #2:
580  if (stationsByName_.contains(station2Name))
581  station2Info = stationsByName_.value(station2Name);
582  else // new station, add it to the container and register its index:
583  {
584  station2Info = new SgVlbiStationInfo(stationsByName_.size(), station2Name);
585  stationsByName_.insert(station2Info->getKey(), station2Info);
586  stationsByIdx_.insert(station2Info->getIdx(), station2Info);
587  station2Info->setCid(*(ob01->baselineId()+1));
588  station2Info->setSid('-', '-');
589  };
590  // source:
591  if (sourcesByName_.contains(sourceName))
592  sourceInfo = sourcesByName_.value(sourceName);
593  else // new source, add it to the container and register its index:
594  {
595  sourceInfo = new SgVlbiSourceInfo(sourcesByName_.size(), sourceName);
596  sourcesByName_.insert(sourceInfo->getKey(), sourceInfo);
597  sourcesByIdx_.insert(sourceInfo->getIdx(), sourceInfo);
598  };
599  // baseline:
600  if (baselinesByName_.contains(baselineName))
601  baselineInfo = baselinesByName_.value(baselineName);
602  else // new baseline, add it to the container and register its index:
603  {
604  baselineInfo = new SgVlbiBaselineInfo(baselinesByName_.size(), baselineName);
605  baselinesByName_.insert(baselineInfo->getKey(), baselineInfo);
606  baselinesByIdx_.insert(baselineInfo->getIdx(), baselineInfo);
607  };
608  // 4band:
609  // band's station #1:
610  if (band->stationsByName().contains(station1Name))
611  bandStation1Info = band->stationsByName().value(station1Name);
612  else // new station, add it to the container:
613  {
614  bandStation1Info = new SgVlbiStationInfo(station1Info->getIdx(), station1Name);
615  band->stationsByName().insert(bandStation1Info->getKey(), bandStation1Info);
616  band->stationsByIdx().insert(bandStation1Info->getIdx(), bandStation1Info);
617  };
618  // band's station #2:
619  if (band->stationsByName().contains(station2Name))
620  bandStation2Info = band->stationsByName().value(station2Name);
621  else // new station, add it to the container:
622  {
623  bandStation2Info = new SgVlbiStationInfo(station2Info->getIdx(), station2Name);
624  band->stationsByName().insert(bandStation2Info->getKey(), bandStation2Info);
625  band->stationsByIdx().insert(bandStation2Info->getIdx(), bandStation2Info);
626  };
627  // band's source:
628  if (band->sourcesByName().contains(sourceName))
629  bandSourceInfo = band->sourcesByName().value(sourceName);
630  else // new source, add it to the container:
631  {
632  bandSourceInfo = new SgVlbiSourceInfo(sourceInfo->getIdx(), sourceName);
633  band->sourcesByName().insert(bandSourceInfo->getKey(), bandSourceInfo);
634  band->sourcesByIdx().insert(bandSourceInfo->getIdx(), bandSourceInfo);
635  };
636  // band's baselines:
637  if (band->baselinesByName().contains(baselineName))
638  bandBaselineInfo = band->baselinesByName().value(baselineName);
639  else // new baseline, add it to the container and register its index:
640  {
641  bandBaselineInfo = new SgVlbiBaselineInfo(baselineInfo->getIdx(), baselineName);
642  band->baselinesByName().insert(bandBaselineInfo->getKey(), bandBaselineInfo);
643  band->baselinesByIdx().insert(bandBaselineInfo->getIdx(), bandBaselineInfo);
644  };
645  //
646  obs->setStation1Idx(station1Info->getIdx());
647  obs->setStation2Idx(station2Info->getIdx());
648  obs->setSourceIdx(sourceInfo->getIdx());
649  obs->setBaselineIdx(baselineInfo->getIdx());
650  //
651  // plus additional info:
652  o->setFourfitOutputFName(kombFileName);
653  //
654  //
655  ap_0 = ob01->aPrioriObses(0);
656  ap_1 = ob01->aPrioriObses(1);
657  ap_2 = ob01->aPrioriObses(2);
658  ap_3 = ob01->aPrioriObses(3);
659  prtOffset = ob01->aPrioriRefClockOffset();
660  //
661  // collect observables:
662  // single band delay:
663  o->sbDelay().setValue(bd05->obsCoarseDelayAtReferEpoch()); // [s]
664  //
665  if (need2adjust4clocks)
666  {
667  // correct the observables:
668  // group delay:
669  double dDel;
670  dDel = ap_1*prtOffset + 1.0/2.0*ap_2*prtOffset*prtOffset +
671  1.0/6.0*ap_3*prtOffset*prtOffset*prtOffset;
672  o->grDelay().setValue(bd05->obsDelayAtReferEpoch() + dDel); // [s]
673  // delay rate:
674  double dRat;
675  dRat = ap_2*prtOffset + 1.0/2.0*ap_3*prtOffset*prtOffset;
676  o->phDRate().setValue(bd05->obsDelayRateAtReferEpoch() + dRat); // [s/s]
677  //
678  // store original correlator data as "alternate" values:
679  o->grDelay().setAlternateValue(bd05->obsDelayAtReferEpoch()); // [s]
680  // delay rate:
681  o->phDRate().setAlternateValue(bd05->obsDelayRateAtReferEpoch()); // [s/s]
682  }
683  else
684  {
685  o->grDelay().setValue(bd05->obsDelayAtReferEpoch()); // [s]
686  // delay rate:
687  o->phDRate().setValue(bd05->obsDelayRateAtReferEpoch()); // [s/s]
688  };
689  //
690  //
691  // workaround the correlator "feature" (not sure we need it for GSI):
692  isSbdSigmaNan = isSbdSigmaInf = isGrdSigmaNan = isGrdSigmaInf = isPhrSigmaNan =
693  isPhrSigmaInf = false;
694  // single band delay sigma (in sec):
695  f = bd05->obsCoarseDelaySigma();
696  if (isinf(f) != 0)
697  {
699  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
700  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
702  " contains wrong sigma (inf) for the single band delay", true);
703  isSbdSigmaInf = true;
704  f = 1.0;
705  };
706  if (isnan(f) != 0)
707  {
709  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
710  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
712  " contains wrong sigma (nan) for the single band delay", true);
713  isSbdSigmaNan = true;
714  f = 1.0;
715  };
716  o->sbDelay().setSigma(f);
717  //
718  // group delay sigma (in seconds):
719  f = bd05->obsDelaySigma();
720  if (isinf(f) != 0)
721  {
723  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
724  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
726  " contains wrong sigma (inf) for the group delay", true);
727  isGrdSigmaInf = true;
728  f = 1.0e-6;
729  };
730  if (isnan(f) != 0)
731  {
733  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
734  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
736  " contains wrong sigma (nan) for the group delay", true);
737  isGrdSigmaNan = true;
738  f = 1.0e-6;
739  };
740  o->grDelay().setSigma(f);
741  //
742  // delay rate sigma:
743  f = bd05->obsDelayRateSigma();
744  if (isinf(f) != 0)
745  {
747  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
748  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
750  " contains wrong sigma (inf) for the group delay", true);
751  isPhrSigmaInf = true;
752  f = 1.0e-6;
753  };
754  if (isnan(f) != 0)
755  {
757  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
758  " at the baseline " + baselineName + " observing " + sourceName + " source at " +
760  " contains wrong sigma (nan) for the group delay", true);
761  isPhrSigmaNan = true;
762  f = 1.0e-6;
763  };
764  o->phDRate().setSigma(f);
765  // complain:
766  if (isSbdSigmaNan || isSbdSigmaInf ||
767  isGrdSigmaNan || isGrdSigmaInf ||
768  isPhrSigmaNan || isPhrSigmaInf )
769  {
770  QString s1(""), s2(""), s3("");
771  s1 = (isSbdSigmaNan || isGrdSigmaNan || isPhrSigmaNan)?"(nan)":"(inf)";
772  if (isSbdSigmaNan || isSbdSigmaInf)
773  s2 = "single band delay, ";
774  if (isGrdSigmaNan || isGrdSigmaInf)
775  s2+= "group delay, ";
776  if (isPhrSigmaNan || isPhrSigmaInf)
777  s2+= "delay rate, ";
778  s2 = s2.left(s2.size() - 2);
779  if (o->getFourfitOutputFName().size())
780  s3 = obs->getScanName().trimmed() + "/" + o->getFourfitOutputFName();
782  "::processKombFile(): The observation #" + QString("").setNum(obsIdx) +
783  ", " + s3 + " contains wrong sigma " + s1 + " for " + s2 + ".");
784  };
785  //
786  // single band:
788  // group delay:
789  o->grDelay().setResidualFringeFitting(bd05->obsDelayResid()); // sec
790  // delay rate:
791  o->phDRate().setResidualFringeFitting(bd05->obsDelayRateResid()); // sec per sec
792  // bd05->obsCoarseDelayRateResid() ?
793  //
794  //
796  // KOMB mix quality code and error code in one field:
797  str = bd02->kombQualityCode();
798  nTmp = str.toInt(&isTmp);
799  o->setQualityFactor(isTmp ? nTmp : 0);
800  o->setErrorCode(isTmp ? "" : str);
801 
802 //std::cout << " ---- i=" << obsIdx << " KOMBf= [" << qPrintable(kombFileName) << "]"
803 //<< " errorCode: [" << qPrintable(o->getErrorCode()) << "]\n";
804  //
806  //
807  o->setReferenceFrequency((refFreq=bd01->procRefFreq()*1.0e-6)); // Hz->MHz
809  o->setTotalPhase(bd02->obsTotalPhaseAtReferEpoch()*DEG2RAD); // in radians
812  o->setSnr(bd05->snr());
816 
817  o->setAprioriDra(0, ap_0);
818  o->setAprioriDra(1, ap_1);
819  o->setAprioriDra(2, ap_2);
820  // undefined:
821  // single band:
822  o->sbDelay().setGeocenterValue(0.0);
823  // group delay:
824  o->grDelay().setGeocenterValue(0.0);
825  // delay rate:
826  o->phDRate().setGeocenterValue(0.0);
827  //
828  //
829  // alloc auxiliary data:
830  if (!station1Info->auxObservationByScanId()->contains(scanId)) // new scan, insert data:
831  {
832  auxObs_1 = new SgVlbiAuxObservation;
833  auxObs_1->setMJD(epoch);
834  station1Info->auxObservationByScanId()->insert(scanId, auxObs_1);
835  }
836  else
837  auxObs_1 = station1Info->auxObservationByScanId()->value(scanId);
838  if (!station2Info->auxObservationByScanId()->contains(scanId)) // new scan, insert data:
839  {
840  auxObs_2 = new SgVlbiAuxObservation;
841  auxObs_2->setMJD(epoch);
842  station2Info->auxObservationByScanId()->insert(scanId, auxObs_2);
843  }
844  else
845  auxObs_2 = station2Info->auxObservationByScanId()->value(scanId);
846  //
847  if (auxObs_1->getRefClockOffset() != 0.0 &&
848  auxObs_1->getRefClockOffset() != ob01->aPrioriRefClockOffset())
849  {
851  "::processKombFile(): the observation #" + QString("").setNum(obsIdx) +
852  " extracted from the KOMB file " + kombFileName +
853  " at the baseline " + baselineName + " observing " + sourceName + " at " +
854  epoch.toString(SgMJD::F_YYYYMMDDHHMMSSSS) + " contains a reference clock offset (" +
855  QString("").setNum(ob01->aPrioriRefClockOffset()) +
856  ") that differs from previous data value (" +
857  QString("").setNum( auxObs_1->getRefClockOffset()) + "), diff=" +
858  QString("").setNum((auxObs_1->getRefClockOffset() - ob01->aPrioriRefClockOffset())*1.0e9) +
859  "ns");
860  };
861  if (prtOffset != 0.0)
862  auxObs_1->setRefClockOffset(prtOffset);
863  //
864  //
865  // aux data:
866  // undefined in KOMB files:
867  o->setStartOffset(0);
868  o->setStopOffset (0);
869  o->setCentrOffset(0.0);
871  o->setAcceptedRatio(0.0);
872  o->setDiscardRatio(bd02->rejectionRate());
873 
874  // set up epochs of events:
875  // correlation:
877  // fringing:
879  // nominal scan time:
880  o->setEpochOfScan(tZero);
881  //
882  // "central" scan epoch:
883  o->setEpochCentral(bd02->tObsCentral());
884  // and another couple of epochs:
885  // "start":
886  o->setTstart(ob01->tStart());
887  // "stop":
888  o->setTstop(ob01->tFinis());
889  //
890  // ?
891  o->setSampleRate(ob01->videoBandWidth()*2.0); // Hz
892  //
893 // o->setBitsPerSample(si_1.bits_sample_); ???
894  //
895  // collect data necessary to evaluate the effective frequencies (for ionospheric correction):
896  for (int i=0; i<numOfChannels; i++)
897  {
898  // "Yes the NPP data in USB and LSB order in the komb file":
901  /*
902  o->numOfAccPeriodsByChan_LSB()->setElement(i, bd02->procPpNumTable(i, 0));
903  o->numOfAccPeriodsByChan_USB()->setElement(i, bd02->procPpNumTable(i, 1));
904  */
905  //
906  // just no weights here:
907  o->numOfSamplesByChan_USB() ->setElement(i, 0.0);
908  o->numOfSamplesByChan_LSB() ->setElement(i, 0.0);
909  o->refFreqByChan() ->setElement(i, bd01->rfFreqs(i)*1.0e-6); // ->MHz
910  //(*o->polarization_1ByChan())[i] = ;
911  //(*o->polarization_2ByChan())[i] = ;
912  o->fringeAmplitudeByChan() ->setElement(i, bd05->fringeAmpPhase(i, 0));
913  o->fringePhaseByChan() ->setElement(i, bd05->fringeAmpPhase(i, 1)*DEG2RAD);
914  //
915  // phase calibration data:
916  // phase cal data: amplitude, phase, freq, offset and error rate:
917  o->phaseCalData_1ByChan() ->setElement(0,i, bd03->phaseCalAmpPhase1(i, 0)*1.0e4);
918  o->phaseCalData_2ByChan() ->setElement(0,i, bd04->phaseCalAmpPhase2(i, 0)*1.0e4);
919  // phases:
920  o->phaseCalData_1ByChan() ->setElement(1,i, bd03->phaseCalAmpPhase1(i, 1)*DEG2RAD);
921  o->phaseCalData_2ByChan() ->setElement(1,i, bd04->phaseCalAmpPhase2(i, 1)*DEG2RAD);
922  // freqs:
923  o->phaseCalData_1ByChan() ->setElement(2,i, ob03->phCalFreqs(i)*1.0e-3);
924  o->phaseCalData_2ByChan() ->setElement(2,i, ob03->phCalFreqs(i)*1.0e-3);
925  // offsets (there are no phase cal offsets in KOMB files)
926  o->phaseCalData_1ByChan() ->setElement(3,i, 0.0);
927  o->phaseCalData_2ByChan() ->setElement(3,i, 0.0);
928  // error rates (there are no error rates in KOMB files too):
929  o->phaseCalData_1ByChan() ->setElement(4,i, 0.0);
930  o->phaseCalData_2ByChan() ->setElement(4,i, 0.0);
931  //
932  //(*o->chanIdByChan()) [i] = ;
933  //(*o->corelIndexNumG())[i] = ;
934  //(*o->corelIndexNumLSB())[i] = ;
935  // o->loFreqByChan_1()->setElement(i, ??);
936  //(*o->bbcIdxByChan_1())[i] = ??;
937  // o->loFreqByChan_2()->setElement(i, ??);
938  //(*o->bbcIdxByChan_2())[i] = ??;
939  };
940  //
941  // check and rescale phase cal data
942  //
943  for (int i=0; i<numOfChannels; i++)
944  {
945  for (int j=0; j<5; j++)
946  {
947  if (isnan(o->phaseCalData_1ByChan()->getElement (j,i)))
948  {
950  "::processKombFile(): st1 one of phase cal values is NAN " +
951  QString("").sprintf("(chan=%d:dat=%d)", i, j) + " from the scan " + obs->getScanName() +
952  " KOMB file " + kombFileName);
953  o->phaseCalData_1ByChan()->setElement (j,i, -100.0);
954  };
955  if (isnan(o->phaseCalData_2ByChan()->getElement (j,i)))
956  {
958  "::processKombFile(): st2 one of phase cal values is NAN " +
959  QString("").sprintf("(chan=%d:dat=%d)", i, j) + " from the scan " + obs->getScanName() +
960  " KOMB file " + kombFileName);
961  o->phaseCalData_2ByChan()->setElement (j,i, -100.0);
962  };
963  };
964  };
965  //
967  *o->refFreqByChan(), *o->fringeAmplitudeByChan(),
969  o->getSampleRate(), refFreq, numOfChannels,
970  effFreq4GR, effFreq4PH, effFreq4RT, getCorrelatorType(), o->strId());
971  o->grDelay().setEffFreq(effFreq4GR);
972  o->phDelay().setEffFreq(effFreq4PH);
973  o->phDRate().setEffFreq(effFreq4RT);
974 // o->setPhaseCalModes(t207->pcal_mode);
975  //
976  //
977 // o->setFourfitVersion(0, t204->ff_version[0]);
978 // o->setFourfitVersion(1, t204->ff_version[1]);
979 // o->setFourfitControlFile(t204->control_file);
980 // o->setFourfitCommandOverride(t204->override);
981  //
982 // o->setPhaseCalRates(0, bd03->phaseCalRate1()*1.0e6); // sec->usec
983 // o->setPhaseCalRates(1, bd03->phaseCalRate2()*1.0e6); // sec->usec
984  o->setPhaseCalRates(0, bd03->phaseCalRate1()); // sec
985  o->setPhaseCalRates(1, bd03->phaseCalRate2()); // sec
986 // o->setUvFrPerAsec(0, t202->u);
987 // o->setUvFrPerAsec(1, t202->v);
988 // o->setUrVr(0, t202->uf);
989 // o->setUrVr(1, t202->vf);
990 // o->setCorrClocks(0, 0, t202->ref_clock*1.0e-6); // musec -> sec
991 // o->setCorrClocks(0, 1, t202->rem_clock*1.0e-6); // musec -> sec
992 // o->setCorrClocks(1, 0, t202->ref_clockrate);
993 // o->setCorrClocks(1, 1, t202->rem_clockrate);
994 // o->setInstrDelay(0, t202->ref_idelay*1.0e-6); // musec -> sec
995 // o->setInstrDelay(1, t202->rem_idelay*1.0e-6); // musec -> sec
996 // o->setNlags(t202->nlags);
997  o->setCentrOffset((ob01->tRefer() - bd02->tObsCentral())*DAY2SEC); // DELTAEPO
999  o->vDlys()->setElement(1, bd05->phaseDelayAtReferEpoch());
1001  o->vAuxData()->setElement(0, ob01->aPrioriClockError()*1.0e6); // APCLOFST sec->usec
1002  o->vAuxData()->setElement(1, bd02->obsTotalPhaseAtCentrlEpoch()*DEG2RAD); // TOTPCENT
1003  o->vAuxData()->setElement(2, bd02->obsDelayRateAtCentrlEpoch()); // RATOBSVM
1004  o->vAuxData()->setElement(3, bd02->obsDelayAtCentrlEpoch()); // DELOBSVM
1005 
1006  o->setFourfitSearchParameters(0, bd02->searchWndCoarseDelay(0)*1.0e6); // sec->usec
1007  o->setFourfitSearchParameters(1, bd02->searchWndCoarseDelay(1)*1.0e6); // sec->usec
1008  o->setFourfitSearchParameters(2, bd02->searchWndFineDelay(0)*1.0e6); // sec->usec
1009  o->setFourfitSearchParameters(3, bd02->searchWndFineDelay(1)*1.0e6); // sec->usec
1010  o->setFourfitSearchParameters(4, bd02->searchWndFineDelayRate(0)*1.0e6);// sec->usec
1011  o->setFourfitSearchParameters(5, bd02->searchWndFineDelayRate(1)*1.0e6);// sec->usec
1012  //
1013  // per band statistics:
1014  bandStation1Info->incNumTotal(DT_DELAY);
1015  bandStation2Info->incNumTotal(DT_DELAY);
1016  bandSourceInfo->incNumTotal(DT_DELAY);
1017  bandBaselineInfo->incNumTotal(DT_DELAY);
1018 
1019  bandStation1Info->incNumTotal(DT_RATE);
1020  bandStation2Info->incNumTotal(DT_RATE);
1021  bandSourceInfo->incNumTotal(DT_RATE);
1022  bandBaselineInfo->incNumTotal(DT_RATE);
1023  };
1024 };
1025 /*=====================================================================================================*/
1026 
1027 
1028 
1029 
1030 
1031 
1032 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
#define DAY2SEC
radians to mas:
Definition: SgMathSupport.h:56
#define DEG2RAD
hours to radians:
Definition: SgMathSupport.h:40
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:1007
int calcHour() const
Definition: SgMJD.h:495
int calcDayOfYear() const
Definition: SgMJD.cpp:237
static SgMJD currentMJD()
Definition: SgMJD.cpp:118
int calcMin() const
Definition: SgMJD.h:502
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)