General Purpose Geodetic Library
SgIoAgvDriver.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #include <iostream>
24 #include <stdlib.h>
25 
26 #include <QtCore/QFile>
27 #include <QtCore/QList>
28 #include <QtCore/QRegExp>
29 #include <QtCore/QTextStream>
30 
31 
32 
33 #include <Sg3dVector.h>
34 #include <SgConstants.h>
35 #include <SgEccRec.h>
36 #include <SgIdentities.h>
37 #include <SgLogger.h>
38 #include <SgVersion.h>
39 #include <SgVgosDb.h>
40 #include <SgVlbiBand.h>
41 #include <SgVlbiObservation.h>
42 #include <SgVlbiSession.h>
43 #include <SgVlbiStationInfo.h>
44 
45 #include <SgIoAgvDriver.h>
46 
47 
48 //#define LOCAL_DEBUG
49 
50 extern const QString sCalList[], sFclList[];
51 
52 
53 /*=====================================================================================================*/
54 /* */
55 /* SgAgvDriver implementation */
56 /* */
57 /*=====================================================================================================*/
59  : SgIoDriver(ids, dv),
60  path2File_(""),
61  fileName_(""),
62  numOfChansByBand_(),
63  numOfObsByStn_(),
64  numOfObsBySidx_(),
65  stnIdxByKey_(),
66  srcIdxByKey_(),
67  bndIdxByKey_(),
68  scanIdxByObsIdx_(),
69  scanSrcNames_(),
70  epochByScanFullName_(),
71  scanNames_(),
72  scanFullNames_(),
73  crootFileNames_(),
74  stnNames_(),
75  startEpoch_(tZero),
76  datumByKey_(),
77  mandatoryDatumByKey_(),
78  knownKeys_(),
79  c1Data_(), i2Data_(), i4Data_(), i8Data_(), r4Data_(), r8Data_(),
80 
81  adNobsSta_(adNobsSta), adNumbObs_(adNumbObs), adNumbSca_(adNumbSca), adNumbSta_(adNumbSta),
82  adObsTab_(adObsTab), adSiteNames_(adSiteNames), adBandNames_(adBandNames), adCorrPlace_(adCorrPlace),
83  adCorrType_(adCorrType), adExpCode_(adExpCode), adExpDesc_(adExpDesc), adExpName_(adExpName),
84  adMk3DbName_(adMk3DbName), adPiName_(adPiName), adRecMode_(adRecMode), adSrcName_(adSrcName),
85  adScanNames_(adScanNames), adQualCodes_(adQualCodes), adExpSerNo_(adExpSerNo), adNumSrc_(adNumSrc),
86  adNumBands_(adNumBands), adNumChnTot_(adNumChnTot), adNumChnBnd_(adNumChnBnd),
87  adNumAvaBnd_(adNumAvaBnd), adMjdObs_(adMjdObs), adSrcIdx_(adSrcIdx), adStnIdx_(adStnIdx),
88  adStnCoord_(adStnCoord), adSkyFrqChn_(adSkyFrqChn), adSrcCoord_(adSrcCoord), adUtcMtai_(adUtcMtai),
89  adUtcObs_(adUtcObs), adDelRate_(adDelRate), adGrDelAmbg_(adGrDelAmbg), adGrDelErr_(adGrDelErr),
90  adGrDelVal_(adGrDelVal), adGrDelIonV_(adGrDelIonV), adGrDelIonE_(adGrDelIonE),
91  adPhRatIonV_(adPhRatIonV), adPhRatIonE_(adPhRatIonE), adPhRatErr_(adPhRatErr), adRefFreq_(adRefFreq),
92  adSbDelErr_(adSbDelErr), adSbDelVal_(adSbDelVal), adSnr_(adSnr), adTotPhase_(adTotPhase),
93  adInterval4_(adInterval4), adCorrelatn_(adCorrelatn), adCrootFnam_(adCrootFnam),
94  adFScanName_(adFScanName), adNumLags_(adNumLags), adUvf_Asec_(adUvf_Asec), adApLength_(adApLength),
95  adFourfCmd_(adFourfCmd), adFourfCtrl_(adFourfCtrl), adUnPhaseCl_(adUnPhaseCl),
96  adBitsSampl_(adBitsSampl), adNusedChnl_(adNusedChnl), adSamplRate_(adSamplRate),
97  adIonCorr_(adIonCorr), adIonRms_(adIonRms), adIonDtFlg_(adIonDtFlg), adEffFreq_(adEffFreq),
98  adEffFrew_(adEffFrew), adIonoBits_(adIonoBits), adDelayFlag_(adDelayFlag), adRateFlag_(adRateFlag),
99  adPhaseFlag_(adPhaseFlag), adUAcSup_(adUAcSup), adNumGrAmbg_(adNumGrAmbg),
100  adAtmInterv_(adAtmInterv), adAtmConstr_(adAtmConstr), adClkInterv_(adClkInterv),
101  adClkConstr_(adClkConstr), adRefClocks_(adRefClocks), adErrorK_(adErrorK), adErrorBl_(adErrorBl),
102  adSrcStatus_(adSrcStatus), adBlnStatus_(adBlnStatus), adBlnClocks_(adBlnClocks),
103  adCbrNumber_(adCbrNumber), adCbrSite_(adCbrSite), adCbrImjd_(adCbrImjd), adCbrTime_(adCbrTime),
104  adObsCalFlg_(adObsCalFlg), adStnCalFlg_(adStnCalFlg), adFlybyFlg_(adFlybyFlg),
105  adObsCalNam_(adObsCalNam), adStnCalNam_(adStnCalNam), adFlyCalNam_(adFlyCalNam),
106  adAirTemp_(adAirTemp), adAirPress_(adAirPress), adRelHumd_(adRelHumd), adCableDel_(adCableDel),
107  adFourfErr_(adFourfErr), adFourfFile_(adFourfFile), adStrtOffst_(adStrtOffst),
108  adStopOffst_(adStopOffst), adHopsVer_(adHopsVer), adFourFtVer_(adFourFtVer), adScanUtc_(adScanUtc),
109  adUtcMtag_(adUtcMtag), adCorrUtc_(adCorrUtc), adFourUtc_(adFourUtc), adTapQcode_(adTapQcode),
110  adQbFactor_(adQbFactor), adDiscard_(adDiscard), adDeltaEpo_(adDeltaEpo), adStartSec_(adStartSec),
111  adStopSec_(adStopSec), adSbResid_(adSbResid), adRtResid_(adRtResid), adEffDura_(adEffDura),
112  adGcSbDel_(adGcSbDel), adGcMbDel_(adGcMbDel), adGcRate_(adGcRate), adGcPhase_(adGcPhase),
113  adGcPhsRes_(adGcPhsRes), adFalseDet_(adFalseDet), adIncohAmp_(adIncohAmp), adIncohAmp2_(adIncohAmp2),
114  adGrResid_(adGrResid), adAprioriDl_(adAprioriDl), adAprioriRt_(adAprioriRt),
115  adAprioriAc_(adAprioriAc), adUrVr_(adUrVr), adIdelay_(adIdelay), adSrchPar_(adSrchPar),
116  adCorrClock_(adCorrClock), adCorBasCd_(adCorBasCd), adZdelay_(adZdelay), adStarElev_(adStarElev),
117  adPhcRate_(adPhcRate), adDtec_(adDtec), adDtecSig_(adDtecSig), adCableSgn_(adCableSgn),
118  adCablOnTp_(adCablOnTp), adCablOnTx_(adCablOnTx), adMeteOnTp_(adMeteOnTp), adMeteOnTx_(adMeteOnTx),
119  adSrcApRef_(adSrcApRef), adTectPlNm_(adTectPlNm), adConsnDel_(adConsnDel), adConsnRat_(adConsnRat),
120  adCtSite1_(adCtSite1), adEtdCont_(adEtdCont), adOceCont_(adOceCont), adOceOld_(adOceOld),
121  adOptlCont_(adOptlCont), adPtdCont_(adPtdCont), adPtoLdCon_(adPtoLdCon), adTiltRmvr_(adTiltRmvr),
122  adUt1Ortho_(adUt1Ortho), adWobOrtho_(adWobOrtho), adUt1Libra_(adUt1Libra), adWobLibra_(adWobLibra),
123  adWobXcont_(adWobXcont), adWobYcont_(adWobYcont), adConCont_(adConCont), adSunCont_(adSunCont),
124  adSun2cont_(adSun2cont), adPlx1pSec_(adPlx1pSec), adFeedCor_(adFeedCor), adBendPart_(adBendPart),
125  adWobPart_(adWobPart), adUt1Part_(adUt1Part), adConsPart_(adConsPart), adNut06Xyp_(adNut06Xyp),
126  adPlxPart_(adPlxPart), adPtdXyPar_(adPtdXyPar), adStrPart_(adStrPart), adSitPart_(adSitPart),
127  adSunData_(adSunData), adMunData_(adMunData), adEarthCe_(adEarthCe), adNutWahr_(adNutWahr),
128  adNut2006a_(adNut2006a), adNut06xys_(adNut06xys), adCf2J2k_0_(adCf2J2k_0), adCf2J2k_1_(adCf2J2k_1),
129  adCf2J2k_2_(adCf2J2k_2), adUt1_tai_(adUt1_tai), adPolarXy_(adPolarXy), adElTheo_(adElTheo),
130  adAzTheo_(adAzTheo), adAxoCont_(adAxoCont), adNdryCont_(adNdryCont), adNwetCont_(adNwetCont),
131  adOceVert_(adOceVert), adOceHorz_(adOceHorz), adOceDeld_(adOceDeld), adParangle_(adParangle),
132  adAxoPart_(adAxoPart), adNgradPar_(adNgradPar), adNdryPart_(adNdryPart), adNwetPart_(adNwetPart),
133  adCalcFlgV_(adCalcFlgV), adCalcFlgN_(adCalcFlgN), adTidalUt1_(adTidalUt1), adCalcVer_(adCalcVer),
134  adRelData_(adRelData), adPreData_(adPreData), adEtdData_(adEtdData), adAtmMess_(adAtmMess),
135  adAtmCflg_(adAtmCflg), adAxoMess_(adAxoMess), adAxoCflg_(adAxoCflg), adEtdMess_(adEtdMess),
136  adEtdCflg_(adEtdCflg), adPtdMess_(adPtdMess), adPtdCflg_(adPtdCflg), adNutMess_(adNutMess),
137  adNutCflg_(adNutCflg), adOceMess_(adOceMess), adOceCflg_(adOceCflg), adAtiMess_(adAtiMess),
138  adAtiCflg_(adAtiCflg), adCtiMess_(adCtiMess), adCtiCflg_(adCtiCflg), adPlxMess_(adPlxMess),
139  adPlxCflg_(adPlxCflg), adStrMess_(adStrMess), adStrCflg_(adStrCflg), adTheMess_(adTheMess),
140  adRelCflg_(adRelCflg), adSitMess_(adSitMess), adPanMess_(adPanMess), adPepMess_(adPepMess),
141  adWobCflg_(adWobCflg), adUt1Cflg_(adUt1Cflg), adOceStat_(adOceStat), adUt1Epoch_(adUt1Epoch),
142  adWobEpoch_(adWobEpoch), adSiteZens_(adSiteZens), adOPTLCoef_(adOPTLCoef), adSitOcPhs_(adSitOcPhs),
143  adSitOcAmp_(adSitOcAmp), adSitHWOPh_(adSitHWOPh), adSitHWOAm_(adSitHWOAm), adSitHSOPh_(adSitHSOPh),
144  adSitHSOAm_(adSitHSOAm), adAxisTyps_(adAxisTyps), adAxisOffs_(adAxisOffs), adAxisTilt_(adAxisTilt),
145  adEccTypes_(adEccTypes), adEccCoord_(adEccCoord), adEccNames_(adEccNames), adFwobInf_(adFwobInf),
146  adFut1Inf_(adFut1Inf), adUt1Intrp_(adUt1Intrp), adUt1Mess_(adUt1Mess), adWobMess_(adWobMess),
147  adWobIntrp_(adWobIntrp), adFut1Text_(adFut1Text), adFwobText_(adFwobText), adFut1Pts_(adFut1Pts),
148  adFwobXnYt_(adFwobXnYt),
149  //
150  adNumAp1_(adNumAp1), adNumAp2_(adNumAp2), adCiNum1_(adCiNum1),
151  adBbcIdx1_(adBbcIdx1), adBbcIdx2_(adBbcIdx2),
152  adErrRate1_(adErrRate1), adErrRate2_(adErrRate2), adChanId1_(adChanId1), adChanId2_(adChanId2),
153  adPolariz1_(adPolariz1), adPolariz2_(adPolariz2),
154  adRfFreq1_(adRfFreq1), adRfFreq2_(adRfFreq2), adLoFreq1_(adLoFreq1), adLoFreq2_(adLoFreq2),
155  adNSampls1_(adNSampls1), adNSampls2_(adNSampls2),
156  adApByFrq1_(adApByFrq1), adApByFrq2_(adApByFrq2), adPhCFrq1_(adPhCFrq1), adPhCFrq2_(adPhCFrq2),
157  adPhCAmp1_(adPhCAmp1), adPhCAmp2_(adPhCAmp2),
158  adPhCPhs1_(adPhCPhs1), adPhCPhs2_(adPhCPhs2), adPhCOff1_(adPhCOff1), adPhCOff2_(adPhCOff2),
159  adIndChn1_(adIndChn1), adIndChn2_(adIndChn2),
160  adNumSam1_(adNumSam1), adNumSam2_(adNumSam2), adUvChn1_(adUvChn1), adUvChn2_(adUvChn2),
161  adPCalFr1_(adPCalFr1), adPCalFr2_(adPCalFr2),
162  adPCalCm1_(adPCalCm1), adPCalCm2_(adPCalCm2),
163 
164  //
165  adPimaCnt_(adPimaCnt), adPimaVer_(adPimaVer), adFrnAmpl_(adFrnAmpl),
166  adFrTypFit_(adFrTypFit), adAprCloOf_(adAprCloOf), adAprCloRt_(adAprCloRt),
167  adAprDel_(adAprDel), adAprRate_(adAprRate), adAzimuth_(adAzimuth), adElev_(adElev),
168  adPolariz_(adPolariz), adScanDur_(adScanDur), adStaClRf_(adStaClRf),
169 
170 
171  //
172  adAntGain_(adAntGain), adAprPhas_(adAprPhas), adAprPhGc_(adAprPhGc), adAtmCns_(adAtmCns),
173  adAtmIntr_(adAtmIntr), adAutoSup_(adAutoSup), adAprEop_(adAprEop), adDerDel_(adDerDel),
174  adDerRat_(adDerRat), adBand2nd_(adBand2nd), adBasUse_(adBasUse), adBsclCns_(adBsclCns),
175  adBsclEst_(adBsclEst), adCalSts_(adCalSts), adCloCns_(adCloCns), adCloIntr_(adCloIntr),
176  adDaTyp_(adDaTyp), adDgClEst_(adDgClEst), adEditSts_(adEditSts), adEopCns_(adEopCns),
177  adEopEst_(adEopEst), adRwBasNam_(adRwBasNam), adRwDelVal_(adRwDelVal), adRwRatVal_(adRwRatVal),
178  adSoCoCns_(adSoCoCns), adSoCoEst_(adSoCoEst), adSouUse_(adSouUse),
179  adStaUse_(adStaUse), adStPsCns_(adStPsCns), adStPsEst_(adStPsEst), adSupMet_(adSupMet),
180  adTecSts_(adTecSts), adTilIntr_(adTilIntr), adTlOfCns_(adTlOfCns), adTlRtCns_(adTlRtCns),
181  adUserRec_(adUserRec), adUserSup_(adUserSup), adCalInfo_(adCalInfo), adCalName_(adCalName),
182  adMeanCabl_(adMeanCabl), adNcalib_(adNcalib), adEopTab_(adEopTab), adMjdEop_(adMjdEop),
183  adNutDer_(adNutDer), adNaprEop_(adNaprEop), adStepEop_(adStepEop), adTaiEop_(adTaiEop),
184  adThGrDel_(adThGrDel), adThPhDel_(adThPhDel), adThPhRat_(adThPhRat), adThProg_(adThProg),
185  adThRuDat_(adThRuDat), adUvCoord_(adUvCoord), adRateCen_(adRateCen), adRateWdt_(adRateWdt),
186  adResGrRat_(adResGrRat), adResMbDel_(adResMbDel), adResPhas_(adResPhas), adResPhRat_(adResPhRat),
187  adResSbDel_(adResSbDel), adResGrDl_(adResGrDl), adResPhGc_(adResPhGc), adResRate_(adResRate),
188  adSpChWdt_(adSpChWdt), adSrtOffs_(adSrtOffs), adTsys1_(adTsys1), adTsys2_(adTsys2),
189  adUvStaOrd_(adUvStaOrd), adChanSdb_(adChanSdb), adChanWdt_(adChanWdt), adDelWcen_(adDelWcen),
190  adDelWwdt_(adDelWwdt), adNoiseRms_(adNoiseRms), adPindObs_(adPindObs), adCorVers_(adCorVers),
191  adFrtOffs_(adFrtOffs), adGrRatErr_(adGrRatErr), adGrRate_(adGrRate), adNumClRf_(adNumClRf),
192  adNPhAmb_(adNPhAmb), adPhDelErr_(adPhDelErr), adScanPima_(adScanPima)
193 
194 
195 
196 {
197  session_ = NULL;
198  adNumOfAp_= NULL;
199  adIndexNum_ = NULL;
200  adChanId_ = NULL;
201  adPolarz_ = NULL;
202  adBbcIdx_ = NULL;
203  adErrRate_ = NULL;
204  adRfFreq_ = NULL;
205  adIndChn_ = NULL;
206  adLoRfFreq_ = NULL;
207  adNumSmpls_ = NULL;
208  adChAmpPhs_ = NULL;
209  adPhcFrq_ = NULL;
210  adPhcAmp_ = NULL;
211  adPhcPhs_ = NULL;
212  adPhcOff_ = NULL;
213 
214  numOfObs_ = 0;
215  numOfScans_ = 0;
216  numOfBands_ = 0;
217  numOfSrc_ = 0;
218  numOfStn_ = 0;
219  numOfBln_ = 0;
220  numOfStnPts_ = 0;
221  numOfChans2_ = 0;
222  maxNumPerStn_= 0;
266 
267  knownKeys_
274  << &adPCalCm1_ << &adPCalCm2_
275  ;
276 
277 
278  knownKeys_
281 
282  ;
283 
284  knownKeys_
298  << &adPhDelErr_ << &adScanPima_
299 
300 
301  ;
303 };
304 
305 
306 
307 //
309 {
310  for (int i=0; i<size(); i++)
311  delete at(i);
312  clear();
313 
314  datumByKey_.clear();
315  mandatoryDatumByKey_.clear();
316  knownKeys_.clear();
317 
318  for (QMap<QString, SgAgvDatumString*>::iterator it=c1Data_.begin(); it!=c1Data_.end(); ++it)
319  delete it.value();
320  c1Data_.clear();
321 
322  for (QMap<QString, SgAgvDatum<short int>*>::iterator it=i2Data_.begin(); it!=i2Data_.end(); ++it)
323  delete it.value();
324  i2Data_.clear();
325 
326  for (QMap<QString, SgAgvDatum<int>*>::iterator it=i4Data_.begin(); it!=i4Data_.end(); ++it)
327  delete it.value();
328  i4Data_.clear();
329 
330  for (QMap<QString, SgAgvDatum<long int>*>::iterator it=i8Data_.begin(); it!=i8Data_.end(); ++it)
331  delete it.value();
332  i8Data_.clear();
333 
334  for (QMap<QString, SgAgvDatum<float>*>::iterator it=r4Data_.begin(); it!=r4Data_.end(); ++it)
335  delete it.value();
336  r4Data_.clear();
337 
338  for (QMap<QString, SgAgvDatum<double>*>::iterator it=r8Data_.begin(); it!=r8Data_.end(); ++it)
339  delete it.value();
340  r8Data_.clear();
341 
342  numOfChansByBand_.clear();
343  numOfObsByStn_.clear();
344  numOfObsBySidx_.clear();
345  stnIdxByKey_.clear();
346  srcIdxByKey_.clear();
347  bndIdxByKey_.clear();
348  scanIdxByObsIdx_.clear();
349  scanSrcNames_.clear();
350  epochByScanFullName_.clear();
351 
352  session_ = NULL;
353 
354  delete []adNumOfAp_;
355  delete []adIndexNum_;
356  delete []adChanId_;
357  delete []adPolarz_;
358  delete []adBbcIdx_;
359  delete []adErrRate_;
360  delete []adRfFreq_;
361  delete []adIndChn_;
362  delete []adLoRfFreq_;
363  delete []adNumSmpls_;
364  delete []adChAmpPhs_;
365  delete []adPhcFrq_;
366  delete []adPhcAmp_;
367  delete []adPhcPhs_;
368  delete []adPhcOff_;
369 
370  adNumOfAp_ = NULL;
371  adIndexNum_ = NULL;
372  adChanId_ = NULL;
373  adPolarz_ = NULL;
374  adBbcIdx_ = NULL;
375  adErrRate_ = NULL;
376  adRfFreq_ = NULL;
377  adIndChn_ = NULL;
378  adLoRfFreq_ = NULL;
379  adNumSmpls_ = NULL;
380  adChAmpPhs_ = NULL;
381  adPhcFrq_ = NULL;
382  adPhcAmp_ = NULL;
383  adPhcPhs_ = NULL;
384  adPhcOff_ = NULL;
385 };
386 
387 
388 
389 //
391 {
392 //QString path2root("");
393  QList<QString> list;
394 
395  return list;
396 };
397 
398 
399 
400 //
401 bool SgAgvDriver::insertDatum(QMap<QString, SgAgvDatumDescriptor*> &datumByKey, SgAgvDatumDescriptor* dd)
402 {
403  if (!dd)
405  "::insertDatum(): the datum descriptor is NULL");
406  else if (datumByKey.contains(dd->getLCode()))
408  "::insertDatum(): the lCode \"" + dd->getLCode() + "\" already registered");
409  else
410  {
411  datumByKey.insert(dd->getLCode(), dd);
412  return true;
413  };
414  return false;
415 };
416 
417 
418 
419 //
421 {
422  if (dd->getDriver())
423  return;
424 
425  // set up the driver:
426  dd->setDriver(this);
427  // allocate data structures:
428  switch (dd->getDataType())
429  {
430  case ADT_CHAR:
431  if (c1Data_.contains(dd->getLCode()))
433  "::createDatum(): the datum descriptor with the lCode \"" + dd->getLCode() +
434  "\" is already in C1 map");
435  else
436  c1Data_.insert(dd->getLCode(), new SgAgvDatumString(dd));
437  break;
438  case ADT_I2:
439  if (i2Data_.contains(dd->getLCode()))
441  "::createDatum(): the datum descriptor with the lCode \"" + dd->getLCode() +
442  "\" is already in I2 map");
443  else
444  i2Data_.insert(dd->getLCode(), new SgAgvDatum<short int>(dd));
445  break;
446  case ADT_I4:
447  if (i4Data_.contains(dd->getLCode()))
449  "::createDatum(): the datum descriptor with the lCode \"" + dd->getLCode() +
450  "\" is already in I4 map");
451  else
452  i4Data_.insert(dd->getLCode(), new SgAgvDatum<int>(dd));
453  break;
454  case ADT_I8:
455  if (i8Data_.contains(dd->getLCode()))
457  "::createDatum(): the datum descriptor with the lCode \"" + dd->getLCode() +
458  "\" is already in I8 map");
459  else
460  i8Data_.insert(dd->getLCode(), new SgAgvDatum<long int>(dd));
461  break;
462  case ADT_R4:
463  if (r4Data_.contains(dd->getLCode()))
465  "::createDatum(): the datum descriptor with the lCode \"" + dd->getLCode() +
466  "\" is already in R4 map");
467  else
468  r4Data_.insert(dd->getLCode(), new SgAgvDatum<float>(dd));
469  break;
470  case ADT_R8:
471  if (r8Data_.contains(dd->getLCode()))
473  "::createDatum(): the datum descriptor with the lCode \"" + dd->getLCode() +
474  "\" is already in R8 map");
475  else
476  r8Data_.insert(dd->getLCode(), new SgAgvDatum<double>(dd));
477  break;
478  case ADT_NONE:
479  default:
480 
481  break;
482  };
483 };
484 
485 
486 
487 //
489 {
490  // create a datum for each descriptor:
491  for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=mandatoryDatumByKey_.begin();
492  it!=mandatoryDatumByKey_.end(); ++it)
493  createDatum(it.value());
494  for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=datumByKey_.begin();
495  it!=datumByKey_.end(); ++it)
496  createDatum(it.value());
497 
498  // allcoate space for datum:
499  for (QMap<QString, SgAgvDatumString*>::iterator it=c1Data_.begin(); it!=c1Data_.end(); ++it)
500  if (!it.value()->isAllocated())
501  it.value()->allocateSpace();
502 
503  for (QMap<QString, SgAgvDatum<short int>*>::iterator it=i2Data_.begin(); it!=i2Data_.end(); ++it)
504  if (!it.value()->isAllocated())
505  it.value()->allocateSpace();
506 
507  for (QMap<QString, SgAgvDatum<int>*>::iterator it=i4Data_.begin(); it!=i4Data_.end(); ++it)
508  if (!it.value()->isAllocated())
509  it.value()->allocateSpace();
510 
511  for (QMap<QString, SgAgvDatum<long int>*>::iterator it=i8Data_.begin(); it!=i8Data_.end(); ++it)
512  if (!it.value()->isAllocated())
513  it.value()->allocateSpace();
514 
515  for (QMap<QString, SgAgvDatum<float>*>::iterator it=r4Data_.begin(); it!=r4Data_.end(); ++it)
516  if (!it.value()->isAllocated())
517  it.value()->allocateSpace();
518 
519  for (QMap<QString, SgAgvDatum<double>*>::iterator it=r8Data_.begin(); it!=r8Data_.end(); ++it)
520  if (!it.value()->isAllocated())
521  it.value()->allocateSpace();
522 };
523 
524 
525 
526 //
527 QString SgAgvDriver::data2str(SgAgvDatumDescriptor* dd, int idx1, int idx2, int idx3, int idx4)
528 {
529  QString str("NULL");
530  SgAgvDatumString *dstr=NULL;
531  SgAgvDatum<short int> *dsin=NULL;
532  SgAgvDatum<int> *dint=NULL;
533  SgAgvDatum<long int> *dlin=NULL;
534  SgAgvDatum<float> *dflt=NULL;
535  SgAgvDatum<double> *ddbl=NULL;
536 
537  if (!dd)
538  return str;
539  str = "N/A";
540 
541  switch (dd->getDataType())
542  {
543  case ADT_CHAR:
544  if ((dstr = c1Data_.value(dd->getLCode())))
545  {
546  str = dstr->getValue(idx2, idx3, idx4).trimmed();
547  str.replace(' ', '_');
548  };
549  break;
550  case ADT_I2:
551  if ((dsin = i2Data_.value(dd->getLCode())))
552  str.setNum(dsin->getValue(idx1, idx2, idx3, idx4));
553  break;
554  case ADT_I4:
555  if ((dint = i4Data_.value(dd->getLCode())))
556  str.setNum(dint->getValue(idx1, idx2, idx3, idx4));
557  break;
558  case ADT_I8:
559  if ((dlin = i8Data_.value(dd->getLCode())))
560  str.setNum(dlin->getValue(idx1, idx2, idx3, idx4));
561  break;
562  case ADT_R4:
563  if ((dflt = r4Data_.value(dd->getLCode())))
564  str.setNum(dflt->getValue(idx1, idx2, idx3, idx4), 'E', 7);
565  break;
566  case ADT_R8:
567  if ((ddbl = r8Data_.value(dd->getLCode())))
568  str.setNum(ddbl->getValue(idx1, idx2, idx3, idx4), 'E', 15);
569  break;
570  case ADT_NONE:
571  default:
572 
573  break;
574  };
575  return str;
576 };
577 
578 
579 
580 //
581 bool SgAgvDriver::exportData(const QString& path2File, const QString& basicName)
582 {
585  path2File_ = path2File.size()?path2File:".";
586  fileName_ = basicName;
587  if (basicName.indexOf('.') == -1) // no extension at all
588  fileName_ += ".vda";
589 
590 #ifdef LOCAL_DEBUG
591  std::cout << " --- path2File_=[" << qPrintable(path2File_) << "]\n";
592  std::cout << " --- fileName_ =[" << qPrintable(fileName_) << "]\n";
593 #endif
594 
595 
596  QFile f(path2File_ + "/" + fileName_);
597  if (!f.open(QIODevice::WriteOnly))
598  {
600  "::exportData(): error opening output file: " + path2File_ + "/" + fileName_);
601  return false;
602  };
603  QTextStream ts(&f);
604 
605  for (int i=0; i<size(); i++)
606  at(i)->exportData(ts, this);
607 
608  ts.setDevice(NULL);
609  f.close();
610 
611 #ifdef LOCAL_DEBUG
612  std::cout << "SgAgvDriver::exportData: done"
613  //<< qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
614  << qPrintable(QString(", dt= %1 ms").arg((SgMJD::currentMJD() - startEpoch_)*86400000.0, 0, 'f', 2))
615  << "\n";
616 #endif
617 
618  return true;
619 };
620 
621 
622 
623 //
625 {
626  if (!mandatoryDatumByKey_.contains(adNobsSta_.getLCode())) // add the mandatory records:
627  {
634  };
635 };
636 
637 
638 
639 //
641 {
642  int n;
643  //session scope:
644  //strings:
655  //ints:
663 
664  // clock breaks, mix:
669 
670  //reals:
671 
672  //4CALC:
674  {
680  //
735 
736 
737  // adjust the size:
738  if ((n=session_->calcInfo().controlFlagNames().size()))
739  {
740  adCalcFlgN_.setDim2(n);
741  adCalcFlgV_.setDim1(n);
744  adCalcFlgV_.setHasData(true); // they are zeros...
745  };
746 
779 
780  // adjust the size:
781  if ((n=session_->calcInfo().oLoadStationStatus().size()))
782  {
783  adOceStat_.setDim2(n);
785  };
786  //
788  {
789  adUt1Epoch_.setDim2(n);
791  };
793  {
794  adWobEpoch_.setDim2(n);
796  };
797  //
798  if ((n=session_->calcInfo().siteZenDelays().size()))
799  {
800  adSiteZens_.setDim1(n);
802  };
803  //
804  if ((n=session_->calcInfo().stations().size()))
805  {
806  adOPTLCoef_.setDim1(n);
807  adSitOcPhs_.setDim1(n);
808  adSitOcAmp_.setDim1(n);
809  adSitHWOPh_.setDim1(n);
810  adSitHWOAm_.setDim1(n);
811  adSitHSOPh_.setDim1(n);
812  adSitHSOAm_.setDim1(n);
813  adAxisTyps_.setDim1(n);
814  adAxisOffs_.setDim1(n);
815  adAxisTilt_.setDim1(n);
816 
817  adEccTypes_.setDim2(n);
818  adEccCoord_.setDim1(n);
819  adEccCoord_.setHasData(true); // usually, all they are zeros
820  adEccNames_.setDim2(n);
821 
835  };
836 
841  {
852  };
853  };
854 
856 
858  {
863 
869 
873 
880 
881  //
884 
886  };
887 
888 
889  //scan scope:
890  //strings:
892  //added:
895  //ints:
898  //reals:
900 
901  //baseline scope:
902  //strings:
904  // added:
907 
908  //ints:
910  // added:
915 
916 
917  //reals:
932 
933  // added:
936  {
938  }
940  {
942  };
943 
944 
948 
949  // ionosphere corrections:
950  // add if numOfBands > 1:
951  if (numOfBands_ > 1)
952  {
957  };
960 
961 
962  // VGOS:
965 
966 
967  // correlator info data:
1006  //
1007  // phase cal info:
1009 
1010 
1011  // 4 testing:
1012 /*
1013  adFourfErr_.setHasData(true);
1014  adFourfFile_.setHasData(true);
1015  adStrtOffst_.setHasData(true);
1016  adStopOffst_.setHasData(true);
1017  adHopsVer_.setHasData(true);
1018  adFourFtVer_.setHasData(true);
1019  adScanUtc_.setHasData(true);
1020  adUtcMtag_.setHasData(true);
1021  adCorrUtc_.setHasData(true);
1022  adFourUtc_.setHasData(true);
1023  adQbFactor_.setHasData(true);
1024  adDiscard_.setHasData(true);
1025  adDeltaEpo_.setHasData(true);
1026  adStartSec_.setHasData(true);
1027  adStopSec_.setHasData(true);
1028  adSbResid_.setHasData(true);
1029  adRtResid_.setHasData(true);
1030  adEffDura_.setHasData(true);
1031  adGcSbDel_.setHasData(true);
1032  adGcMbDel_.setHasData(true);
1033  adGcRate_.setHasData(true);
1034  adGcPhase_.setHasData(true);
1035  adGcPhsRes_.setHasData(true);
1036  adFalseDet_.setHasData(true);
1037  adIncohAmp_.setHasData(true);
1038  adIncohAmp2_.setHasData(true);
1039  adGrResid_.setHasData(true);
1040  adAprioriDl_.setHasData(true);
1041  adAprioriRt_.setHasData(true);
1042  adAprioriAc_.setHasData(true);
1043  adUrVr_.setHasData(true);
1044  adIdelay_.setHasData(true);
1045  adSrchPar_.setHasData(true);
1046  adCorrClock_.setHasData(true);
1047  adPhcRate_.setHasData(true);
1048 */
1049 
1050  // stations:
1052  {
1062  };
1063 
1064 
1065  //
1066  //
1067  adIonDtFlg_.setHasData(true); //<- it is ok to have all zeros.
1068  //?
1069  adDelayFlag_.setHasData(true);
1070  adRateFlag_.setHasData(true);
1071  adPhaseFlag_.setHasData(true);
1072  adUAcSup_.setHasData(true);
1073  adNumGrAmbg_.setHasData(true); // its ok if all of them are zeros
1074 };
1075 
1076 
1077 
1078 //
1080 {
1081  // Number of accumulated periods:
1097 
1098  //fuzzyDescriptors_.append(adNumOfAp_);
1099 
1100  for (int bndIdx=0; bndIdx<numOfBands_; bndIdx++)
1101  {
1103  const QString& bandKey=session_->bands().at(bndIdx)->getKey();
1104  int numOfChannels=numOfChansByBand_[bandKey];
1105  if (numOfChannels) // can be 0
1106  {
1107  // ints:
1108  // Number of accumulated periods:
1109  d = adNumOfAp_ + bndIdx;
1110  d->setLCode(QString("").sprintf("NUM_AP%d", bndIdx + 1));
1111  d->setDescription(QString("").sprintf("Number of accumulation periods used in band %d per channel "
1112  "per sideband (USB, LSB)", bndIdx + 1));
1114  d->setDataType(ADT_I2);
1115  d->setDim1(numOfChannels);
1116  d->setDim2(2);
1117  d->setDim3(numOfObs_);
1118  d->setDim4(1);
1120  fuzzyDescriptors_.append(d);
1121 
1122  // Corel index numbers
1123  d = adIndexNum_ + bndIdx;
1124  d->setLCode(QString("").sprintf("CI_NUM%d", bndIdx + 1));
1125  d->setDescription(QString("").sprintf("Corel index numbers in band %d per channel "
1126  "per sideband (USB, LSB)", bndIdx + 1));
1128  d->setDataType(ADT_I2);
1129  d->setDim1(numOfChannels);
1130  d->setDim2(2);
1131  d->setDim3(numOfObs_);
1132  d->setDim4(1);
1134  fuzzyDescriptors_.append(d);
1135 
1136  // Physical BBC number by channel:
1137  d = adBbcIdx_ + bndIdx;
1138  d->setLCode(QString("").sprintf("BBC_IDX%d", bndIdx + 1));
1139  d->setDescription(QString("").sprintf("Physical BBC number per channel per station in band %d",
1140  bndIdx + 1));
1142  d->setDataType(ADT_I2);
1143  d->setDim1(numOfChannels);
1144  d->setDim2(2);
1145  d->setDim3(numOfObs_);
1146  d->setDim4(1);
1148  fuzzyDescriptors_.append(d);
1149 
1150  // Error rate:
1151  d = adErrRate_ + bndIdx; //12345678
1152  d->setLCode(QString("").sprintf("ERRATE_%d", bndIdx + 1));
1153  d->setDescription(QString("").sprintf("Log err rate per channel per station in band %d",
1154  bndIdx + 1));
1156  d->setDataType(ADT_I2);
1157  d->setDim1(numOfChannels);
1158  d->setDim2(2);
1159  d->setDim3(numOfObs_);
1160  d->setDim4(1);
1162  fuzzyDescriptors_.append(d);
1163 
1164  // strings:
1165  // Channel IDs:
1166  d = adChanId_ + bndIdx; //12345678
1167  d->setLCode(QString("").sprintf("CHANID%d", bndIdx + 1));
1168  d->setDescription(QString("").sprintf("Space separated one-letter Fourfit channel IDs in band %d",
1169  bndIdx + 1));
1171  d->setDataType(ADT_CHAR);
1172  d->setDim1(1);
1173  d->setDim2(1);
1174  d->setDim3(numOfObs_);
1175  d->setDim4(1);
1177  fuzzyDescriptors_.append(d);
1178 
1179  // polarizations:
1180  d = adPolarz_ + bndIdx; //12345678
1181  d->setLCode(QString("").sprintf("POLARZ%d", bndIdx + 1));
1182  d->setDescription(QString("").sprintf("Space separated polarization per sta/chan in band %d",
1183  bndIdx + 1));
1185  d->setDataType(ADT_CHAR);
1186  d->setDim1(1);
1187  d->setDim2(1);
1188  d->setDim3(numOfObs_);
1189  d->setDim4(1);
1191  fuzzyDescriptors_.append(d);
1192 
1193  // channel frequencies:
1194  d = adRfFreq_ + bndIdx; //12345678
1195  d->setLCode(QString("").sprintf("RFREQ%d", bndIdx + 1));
1196  d->setDescription(QString("").sprintf("RF freq by channel (MHz) in band %d",
1197  bndIdx + 1));
1199  d->setDataType(ADT_R8);
1200  d->setDim1(numOfChannels);
1201  d->setDim2(1);
1202  d->setDim3(numOfObs_);
1203  d->setDim4(1);
1205  fuzzyDescriptors_.append(d);
1206 
1207  // LO frequencies:
1208  d = adLoRfFreq_ + bndIdx; //12345678
1209  d->setLCode(QString("").sprintf("LO_FREQ%d", bndIdx + 1));
1210  d->setDescription(QString("").sprintf("LO frequencies per cha/sta MHz in band %d",
1211  bndIdx + 1));
1213  d->setDataType(ADT_R8);
1214  d->setDim1(numOfChannels);
1215  d->setDim2(2);
1216  d->setDim3(numOfObs_);
1217  d->setDim4(1);
1219  fuzzyDescriptors_.append(d);
1220 
1221  // number of samples:
1222  d = adNumSmpls_ + bndIdx; //12345678
1223  d->setLCode(QString("").sprintf("NSAMPLS%d", bndIdx + 1));
1224  d->setDescription(QString("").sprintf("Number of samples per channel, sideband (USB, LSB) in "
1225  "band %d", bndIdx + 1));
1227  d->setDataType(ADT_R8);
1228  d->setDim1(numOfChannels);
1229  d->setDim2(2);
1230  d->setDim3(numOfObs_);
1231  d->setDim4(1);
1233  fuzzyDescriptors_.append(d);
1234 
1235  // Amplitudes and phases:
1236  d = adChAmpPhs_ + bndIdx; //12345678
1237  d->setLCode(QString("").sprintf("APBYFRQ%d", bndIdx + 1));
1238  d->setDescription(QString("").sprintf("Amp(0-1), phs(-180to180) by chan in band %d",
1239  bndIdx + 1));
1241  d->setDataType(ADT_R8);
1242  d->setDim1(numOfChannels);
1243  d->setDim2(2);
1244  d->setDim3(numOfObs_);
1245  d->setDim4(1);
1247  fuzzyDescriptors_.append(d);
1248 
1249  // phase cal data:
1250  // frequencies:
1251  d = adPhcFrq_ + bndIdx; //12345678
1252  d->setLCode(QString("").sprintf("PHCFRQ_%d", bndIdx + 1));
1253  d->setDescription(QString("").sprintf("Phase cal freqs by channel by station in band %d",
1254  bndIdx + 1));
1256  d->setDataType(ADT_R8);
1257  d->setDim1(numOfChannels);
1258  d->setDim2(2);
1259  d->setDim3(numOfObs_);
1260  d->setDim4(1);
1262  d->setHasData(true);
1263  fuzzyDescriptors_.append(d);
1264 
1265  // amplitudes:
1266  d = adPhcAmp_ + bndIdx; //12345678
1267  d->setLCode(QString("").sprintf("PHCAMP_%d", bndIdx + 1));
1268  d->setDescription(QString("").sprintf("Phase cal amplitudes by channel by station in band %d",
1269  bndIdx + 1));
1271  d->setDataType(ADT_R8);
1272  d->setDim1(numOfChannels);
1273  d->setDim2(2);
1274  d->setDim3(numOfObs_);
1275  d->setDim4(1);
1277  d->setHasData(true);
1278  fuzzyDescriptors_.append(d);
1279 
1280  // phases:
1281  d = adPhcPhs_ + bndIdx; //12345678
1282  d->setLCode(QString("").sprintf("PHCPHS_%d", bndIdx + 1));
1283  d->setDescription(QString("").sprintf("Phase cal phases (-18000 to 18000) by channel by station"
1284  " in band %d", bndIdx + 1));
1286  d->setDataType(ADT_R8);
1287  d->setDim1(numOfChannels);
1288  d->setDim2(2);
1289  d->setDim3(numOfObs_);
1290  d->setDim4(1);
1292  d->setHasData(true);
1293  fuzzyDescriptors_.append(d);
1294 
1295  // offsets:
1296  d = adPhcOff_ + bndIdx; //12345678
1297  d->setLCode(QString("").sprintf("PHCOFF_%d", bndIdx + 1));
1298  d->setDescription(QString("").sprintf("Phase cal offsets (-18000 to 18000) by channel by station "
1299  "in band %d", bndIdx + 1));
1301  d->setDataType(ADT_R8);
1302  d->setDim1(numOfChannels);
1303  d->setDim2(2);
1304  d->setDim3(numOfObs_);
1305  d->setDim4(1);
1307  d->setHasData(true);
1308  fuzzyDescriptors_.append(d);
1309  // end of phase cal info
1310  };
1311  };
1312 };
1313 
1314 
1315 
1316 //
1318 {
1319  if (!session_)
1320  {
1322  "::fillDataStructures(): the session is NULL, nothing to do");
1323  return;
1324  };
1325  if (!session_->numberOfBands())
1326  {
1328  "::fillDataStructures(): the session has no any band, nothing to do");
1329  return;
1330  };
1331  //
1332 
1333  numOfBln_ = session_->baselinesByName().size();
1334  numOfObs_ = session_->observations().size();
1335  numOfBands_ = session_->bands().size();
1336  //
1337  scanIdxByObsIdx_.resize(numOfObs_);
1338  //
1339  for (int i=0; i<numOfBands_; i++)
1340  {
1341  const QString& bandKey=session_->bands().at(i)->getKey();
1342  numOfChansByBand_[bandKey] = session_->bands().at(i)->getMaxNumOfChannels();
1343  bndIdxByKey_[bandKey] = i;
1344  };
1345  int idx=0;
1346  for (int i=0; i<numOfObs_; i++)
1347  {
1348  SgVlbiObservation *obs=session_->observations().at(i);
1349  // set up scan indexes:
1350  //
1351 // if (!epochByScanId_.contains(obs->getScanId())) // new scan
1352  if (!epochByScanFullName_.contains(obs->getScanFullName())) // new scan
1353  {
1354 // epochByScanId_.insert(obs->getScanId(), *obs);
1355  epochByScanFullName_.insert(obs->getScanFullName(), *obs);
1356  idx++;
1357  scanNames_.append(obs->getScanName());
1358  scanFullNames_.append(obs->getScanFullName());
1359  crootFileNames_.append(obs->getCorrRootFileName());
1360  scanSrcNames_.append(obs->src()->getKey());
1361  };
1362  scanIdxByObsIdx_[i] = idx - 1;
1363  };
1364  numOfScans_ = scanFullNames_.size();
1365  numOfStn_ = session_->stationsByName().size();
1366  numOfSrc_ = session_->sourcesByName().size();
1367 
1368  numOfStnPts_ = -1;
1369  numOfChans2_ = -1;
1370  //
1371  //
1372  //
1373  // stations:
1374  idx = 0;
1375  for (QMap<QString, SgVlbiStationInfo*>::const_iterator it=session_->stationsByName().begin();
1376  it!=session_->stationsByName().end(); ++it, idx++)
1377  {
1378  SgVlbiStationInfo *stn=it.value();
1379  int num=stn->auxObservationByScanId()->size();
1380  stnNames_ << stn->getKey();
1381  numOfObsByStn_[stn->getKey()] = num;
1382  numOfObsBySidx_[idx] = num;
1383  stnIdxByKey_[stn->getKey()] = idx;
1384  if (maxNumPerStn_ < num)
1385  maxNumPerStn_ = num;
1386  };
1387  //
1388  //
1389  //
1390  // sources:
1391  idx = 0;
1392  for (QMap<QString, SgVlbiSourceInfo*>::const_iterator it=session_->sourcesByName().begin();
1393  it!=session_->sourcesByName().end(); ++it, idx++)
1394  {
1395  SgVlbiSourceInfo *src=it.value();
1396  srcIdxByKey_[src->getKey()] = idx;
1397  };
1398 
1402 
1403  // allocate data (all special sizes should be already resolved here):
1404  allocateData();
1405 
1406  // fill data:
1408  fillSessVars();
1409  fillScanVars();
1410  fillBslnVars();
1411  fillSttnVars();
1412 
1413  prepare4output();
1414  //
1415  SgAgvChunk *chunk;
1416  append(chunk = new SgAgvChunk(size()));
1417 
1418  chunk->fillDataStructures(session_, this);
1419 };
1420 
1421 
1422 
1423 //
1425 {
1426  // adjust first dimension (==length of a string) for strings:
1427  for (QMap<QString, SgAgvDatumString*>::iterator it=c1Data_.begin(); it!=c1Data_.end(); ++it)
1428  {
1429  SgAgvDatumString *ds=it.value();
1430  SgAgvDatumDescriptor *dd=ds->descriptor();
1431  int length=ds->value(0, 0, 0).size();
1432  for (int l=0; l<dd->d4(); l++)
1433  for (int k=0; k<dd->d3(); k++)
1434  for (int j=0; j<dd->d2(); j++)
1435  if (length < ds->value(j, k, l).size())
1436  length = ds->value(j, k, l).size();
1437  if (dd->getDim1() != length)
1438  {
1440  "::prepare4output(): the length of strings has been changed from " +
1441  QString("").setNum(dd->getDim1()) + " to " + QString("").setNum(length) + " for the lCode " +
1442  dd->getLCode());
1443  dd->setDim1(length);
1444  };
1445  };
1446  //
1447  // check records for presense of the data:
1448  for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=datumByKey_.begin(); it!=datumByKey_.end();
1449  ++it)
1450  {
1451  SgAgvDatumDescriptor *dd=it.value();
1452  switch (dd->getDataType())
1453  {
1454  case ADT_CHAR:
1455  if (c1Data_.contains(dd->getLCode()) && !dd->getHasData())
1456  dd->setHasData(!c1Data_.value(dd->getLCode())->isEmpty());
1457  break;
1458  case ADT_I2:
1459  if (i2Data_.contains(dd->getLCode()) && !dd->getHasData())
1460  dd->setHasData(!i2Data_.value(dd->getLCode())->isEmpty());
1461  break;
1462  case ADT_I4:
1463  if (i4Data_.contains(dd->getLCode()) && !dd->getHasData())
1464  dd->setHasData(!i4Data_.value(dd->getLCode())->isEmpty());
1465  break;
1466  case ADT_I8:
1467  if (i8Data_.contains(dd->getLCode()) && !dd->getHasData())
1468  dd->setHasData(!i8Data_.value(dd->getLCode())->isEmpty());
1469  break;
1470  case ADT_R4:
1471  if (r4Data_.contains(dd->getLCode()) && !dd->getHasData())
1472  dd->setHasData(!r4Data_.value(dd->getLCode())->isEmpty());
1473  break;
1474  case ADT_R8:
1475  if (r8Data_.contains(dd->getLCode()) && !dd->getHasData())
1476  dd->setHasData(!r8Data_.value(dd->getLCode())->isEmpty());
1477  break;
1478  case ADT_NONE:
1479  default:
1480 
1481  break;
1482  };
1483  };
1484 };
1485 
1486 
1487 
1488 //
1490 {
1491  int idx=0;
1492 
1493  if (i4Data_.contains(adNobsSta_.getLCode()))
1494  for (QMap<QString, int>::iterator it=numOfObsByStn_.begin(); it!=numOfObsByStn_.end(); ++it, idx++)
1495  i4Data_.value(adNobsSta_.getLCode())->value(idx, 0, 0, 0) = it.value();
1496 
1497  if (i4Data_.contains(adNumbObs_.getLCode()))
1498  i4Data_.value(adNumbObs_.getLCode())->value(0, 0, 0, 0) = numOfObs_;
1499 
1500  if (i4Data_.contains(adNumbSca_.getLCode()))
1501  i4Data_.value(adNumbSca_.getLCode())->value(0, 0, 0, 0) = numOfScans_;
1502 
1503  if (i4Data_.contains(adNumbSta_.getLCode()))
1504  i4Data_.value(adNumbSta_.getLCode())->value(0, 0, 0, 0) = numOfStn_;
1505 
1506  if (i4Data_.contains(adObsTab_.getLCode()))
1507  for (int idx=0; idx<numOfObs_; idx++)
1508  {
1509  SgVlbiObservation *obs=session_->observations().at(idx);
1510  i4Data_.value(adObsTab_.getLCode())->value(0, idx, 0, 0) = scanIdxByObsIdx_[idx] + 1;
1511  i4Data_.value(adObsTab_.getLCode())->value(1, idx, 0, 0) = stnIdxByKey_[obs->stn_1()->getKey()] + 1;
1512  i4Data_.value(adObsTab_.getLCode())->value(2, idx, 0, 0) = stnIdxByKey_[obs->stn_2()->getKey()] + 1;
1513  };
1514  adNobsSta_.setHasData(true);
1515  adNumbObs_.setHasData(true);
1516  adNumbSca_.setHasData(true);
1517  adNumbSta_.setHasData(true);
1518  adObsTab_.setHasData(true);
1519 };
1520 
1521 
1522 
1523 //
1525 {
1526  QString str("");
1527  int idx=0, totChannels=0, numOfClockBreak=0;
1528  QList<QString> refSites;
1529  QList<QString> cBrkSites;
1530  QList<SgMJD> cBrkEpochs;
1531  //
1532  //
1533  //
1534  // Stations:
1535  idx = 0;
1536  for (QMap<QString, int>::iterator it=stnIdxByKey_.begin(); it!=stnIdxByKey_.end(); ++it, idx++)
1537  {
1538  SgVlbiStationInfo *stn=session_->stationsByName().value(it.key());
1539  if (stn)
1540  {
1541  // strings:
1542  if (c1Data_.contains(adSiteNames_.getLCode()))
1543  c1Data_.value(adSiteNames_.getLCode())->value(idx, 0, 0) = it.key();
1544  if (c1Data_.contains(adTectPlNm_.getLCode()))
1545  c1Data_.value(adTectPlNm_.getLCode())->value(idx, 0, 0) = stn->getTectonicPlateName();
1546 
1547  // r8:
1548  if (r8Data_.contains(adStnCoord_.getLCode()))
1549  {
1550  r8Data_.value(adStnCoord_.getLCode())->value(0, idx, 0, 0) = stn->getR().at(X_AXIS);
1551  r8Data_.value(adStnCoord_.getLCode())->value(1, idx, 0, 0) = stn->getR().at(Y_AXIS);
1552  r8Data_.value(adStnCoord_.getLCode())->value(2, idx, 0, 0) = stn->getR().at(Z_AXIS);
1553  };
1554 
1555  if (r8Data_.contains(adAtmInterv_.getLCode()))
1556  r8Data_.value(adAtmInterv_.getLCode())->value(idx, 0, 0, 0) =
1557  stn->getPcZenith().getPwlStep()*24.0;
1558 
1559  if (r8Data_.contains(adAtmConstr_.getLCode()))
1560  r8Data_.value(adAtmConstr_.getLCode())->value(idx, 0, 0, 0) =
1561  stn->getPcZenith().getPwlAPriori()/(1.0e-12*24.0*vLight*100.0);
1562 
1563  if (r8Data_.contains(adClkInterv_.getLCode()))
1564  r8Data_.value(adClkInterv_.getLCode())->value(idx, 0, 0, 0) =
1565  stn->getPcClocks().getPwlStep()*24.0;
1566 
1567  if (r8Data_.contains(adClkConstr_.getLCode()))
1568  r8Data_.value(adClkConstr_.getLCode())->value(idx, 0, 0, 0) =
1569  stn->getPcClocks().getPwlAPriori()/864.0;
1570 
1571  // i2:
1572  if (i2Data_.contains(adCableSgn_.getLCode()))
1573  i2Data_.value(adCableSgn_.getLCode())->value(idx, 0, 0, 0) =
1575  // cable cal and meteo origin info:
1576  if (i2Data_.contains(adCablOnTp_.getLCode()))
1577  i2Data_.value(adCablOnTp_.getLCode())->value(idx, 0, 0, 0) =
1578  stn->getCableCalsOrigin();
1579  if (i2Data_.contains(adMeteOnTp_.getLCode()))
1580  i2Data_.value(adMeteOnTp_.getLCode())->value(idx, 0, 0, 0) =
1581  stn->getMeteoDataOrigin();
1582  // strings:
1583  if (c1Data_.contains(adCablOnTx_.getLCode()))
1584  {
1585  const QString &s=stn->getCableCalsOriginTxt();
1586  c1Data_.value(adCablOnTx_.getLCode())->value(idx, 0, 0) =
1587  s.size()?stn->getCableCalsOriginTxt():"_";
1588  };
1589  if (c1Data_.contains(adMeteOnTx_.getLCode()))
1590  {
1591  const QString &s=stn->getMeteoDataOriginTxt();
1592  c1Data_.value(adMeteOnTx_.getLCode())->value(idx, 0, 0) =
1593  s.size()?stn->getMeteoDataOriginTxt():"_";
1594  };
1595 
1596  // collect info:
1598  refSites << stn->getKey();
1599 
1600  // clock breaks:
1601  if (stn->clockBreaks().size())
1602  {
1604  for (int j=0; j<stn->clockBreaks().size(); j++)
1605  {
1606  SgParameterBreak *pb=stn->clockBreaks().at(j);
1607  cBrkSites << stn->getKey();
1608  cBrkEpochs << pb->getEpoch4Export();
1609  };
1610  };
1611  // station calibrations:
1612  // currently, we use only cable cal from the list:
1613  if (i2Data_.contains(adStnCalFlg_.getLCode()))
1614  i2Data_.value(adStnCalFlg_.getLCode())->value(idx, 0, 0, 0) =
1616  // this is predetrimined also:
1617  if (i2Data_.contains(adFlybyFlg_.getLCode()))
1618  {
1619  i2Data_.value(adFlybyFlg_.getLCode())->value(idx, 0, 0, 0) = 1<<(8-1);
1620  for (int j=1; j<7; j++)
1621  i2Data_.value(adFlybyFlg_.getLCode())->value(idx, j, 0, 0) = 0;
1622  };
1623  //
1624  //
1625  //
1626  int jdx=0;
1627  for (QMap<QString, int>::iterator jt=stnIdxByKey_.begin(); jt!=stnIdxByKey_.end(); ++jt, jdx++)
1628  {
1629  SgVlbiStationInfo *stn_2=session_->stationsByName().value(jt.key());
1630  if (stn_2)
1631  {
1632  QString st1Name(stn->getKey()), st2Name(stn_2->getKey());
1633  int bitArray;
1634  bitArray = 0;
1635  SgVlbiBaselineInfo *bi, *biR;
1636  if (session_->baselinesByName().contains(st1Name + ":" + st2Name))
1637  bi = session_->baselinesByName().value(st1Name + ":" + st2Name);
1638  else
1639  bi = NULL;
1640  if (session_->baselinesByName().contains (st2Name + ":" + st1Name))
1641  biR = session_->baselinesByName().value(st2Name + ":" + st1Name);
1642  else
1643  biR = NULL;
1644  //
1645  // ! * Format of BASLSTAT_I2 array: *
1646  // ! * Array BASLSTAT_I2 contains NUMSTA**2 elements, where *
1647  // ! * NUMSTA is the number of stations. *
1648  // ! * Baselines ISIT1, ISIT2 has index (ISITE1-1)*NUMSTA + ISITE2 *
1649  // ! * Where ISIT1, ISIT2 are indeces of the station *
1650  // ! * in interval [1, NUMSTA]. Stations index *
1651  // ! * correspond station name table kept in LCODE *
1652  // ! * SITNAMES. In general order of stations in this *
1653  // ! * station list MAY NOT coincide with order of *
1654  // ! * stations in the array ISITN_CHR kept in psfil.i !!*
1655  // ! * Each element of the array is 16-bits bit field. *
1656  // ! * Bits are counted from 1. *
1657  // ! * 1-st bit is set when at least one observation at the *
1658  // ! * baseline ISIT1, ISIT2 (but not ISIT2, ISIT1) took place*
1659  // ! * 2-nd bit is set when baseline ISIT1, ISIT2 (or ISIT2, ISIT1)*
1660  // ! * was selected in group delay solution. *
1661  // ! * 3-nd bit is set when baseline ISIT1, ISIT2 (or ISIT2, ISIT1)*
1662  // ! * was selected in phase delay solution. *
1663  // ! * 4-th bit is set when baseline-dependent clock for the *
1664  // ! * baseline ISIT1, ISIT2 (or ISIT2, ISIT1) was estimated *
1665  // ! * in group delay solution. *
1666  // ! * 5-th bit is set when baseline-dependent clock for the *
1667  // ! * baseline ISIT1, ISIT2 (or ISIT2, ISIT1) was estimated *
1668  // ! * in phase delay solution. *
1669  // ! * bits 6-16 are reserved for future used and always are zero. *
1670  // !
1671  // set the first bit:
1672  if (bi && bi->numTotal(DT_DELAY))
1673  bitArray |= (1<<0);
1674  //
1675  // bi and biR can be NULLs!
1676  //
1677  // set the second and third bits:
1678  if ( ((bi && !bi->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID)) ||
1679  (biR && !biR->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))) &&
1680  (stn && !stn->isAttr(SgVlbiStationInfo::Attr_NOT_VALID)) &&
1681  (stn_2 && !stn_2->isAttr(SgVlbiStationInfo::Attr_NOT_VALID)) )
1682  {
1683  bitArray |= (1<<1);
1684  bitArray |= (1<<2);
1685  };
1686  // set the fourth and fifth bits:
1687  if ((bi &&
1690  (biR &&
1693  {
1694  bitArray |= (1<<3);
1695  bitArray |= (1<<4);
1696  };
1697  if (i2Data_.contains(adBlnStatus_.getLCode()))
1698  i2Data_.value(adBlnStatus_.getLCode())->value(idx, jdx, 0, 0) = bitArray;
1699  }
1700  else
1702  "::fillSessVars(): cannot find a station \"" + jt.key() + "\" in the map");
1703  };
1704  }
1705  else
1707  "::fillSessVars(): cannot find a station \"" + it.key() + "\" in the map");
1708 
1709  // end of station iteration.
1710  };
1711  adSiteNames_.setHasData(true);
1712 
1713  if (c1Data_.contains(adRefClocks_.getLCode()) && refSites.size()>0)
1714  {
1715  adRefClocks_.setDim2(refSites.size());
1716  c1Data_.value(adRefClocks_.getLCode())->allocateSpace();
1717  for (int i=0; i<refSites.size(); i++)
1718  c1Data_.value(adRefClocks_.getLCode())->value(i, 0, 0) = refSites.at(i);
1719  };
1720  //
1721  //
1722  // store clock breaks:
1723  if ((numOfClockBreak = cBrkSites.size()))
1724  {
1725  if (i4Data_.contains(adCbrNumber_.getLCode()))
1726  i4Data_.value(adCbrNumber_.getLCode())->value(0, 0, 0, 0) = numOfClockBreak;
1727  if (c1Data_.contains(adCbrSite_.getLCode()))
1728  {
1729  adCbrSite_.setDim2(numOfClockBreak);
1730  c1Data_.value(adCbrSite_.getLCode())->allocateSpace();
1731  for (int i=0; i<numOfClockBreak; i++)
1732  c1Data_.value(adCbrSite_.getLCode())->value(i, 0, 0) = cBrkSites.at(i);
1733  };
1734  if (i4Data_.contains(adCbrImjd_.getLCode()) && r8Data_.contains(adCbrTime_.getLCode()))
1735  {
1736  adCbrImjd_.setDim1(numOfClockBreak);
1737  adCbrTime_.setDim1(numOfClockBreak);
1738  i4Data_.value(adCbrImjd_.getLCode())->allocateSpace();
1739  r8Data_.value(adCbrTime_.getLCode())->allocateSpace();
1740  for (int i=0; i<numOfClockBreak; i++)
1741  {
1742  const SgMJD &t=cBrkEpochs.at(i);
1743  i4Data_.value(adCbrImjd_.getLCode())->value(i, 0, 0, 0) = t.getDate();
1744  r8Data_.value(adCbrTime_.getLCode())->value(i, 0, 0, 0) = t.getTime()*86400.0;
1745  };
1746  };
1747  };
1748 
1749  // calibrations:
1750  if (c1Data_.contains(adStnCalNam_.getLCode()))
1751  {
1752  adStnCalNam_.setDim2(6);
1753  c1Data_.value(adStnCalNam_.getLCode())->allocateSpace();
1754  for (int i=0; i<6; i++)
1755  {
1756  c1Data_.value(adStnCalNam_.getLCode())->value(i, 0, 0) = sCalList[i];
1757  // special case:
1758  c1Data_.value(adStnCalNam_.getLCode())->value(i, 0, 0).replace(' ', '_');
1759  }
1760  };
1761  if (c1Data_.contains(adFlyCalNam_.getLCode()))
1762  {
1763  adFlyCalNam_.setDim2(8);
1764  c1Data_.value(adFlyCalNam_.getLCode())->allocateSpace();
1765  for (int i=0; i<8; i++)
1766  c1Data_.value(adFlyCalNam_.getLCode())->value(i, 0, 0) = sFclList[i];
1767  };
1768 
1769  int obsCalFlags;
1770  QList<QString> calList;
1771  session_->formObsCalibrationSetup(obsCalFlags, calList);
1772 
1773  if (i2Data_.contains(adObsCalFlg_.getLCode()))
1774  {
1775  i2Data_.value(adObsCalFlg_.getLCode())->value(0, 0, 0, 0) = obsCalFlags;
1776  };
1777  if (c1Data_.contains(adObsCalNam_.getLCode()))
1778  {
1779  adObsCalNam_.setDim2(calList.size());
1780  c1Data_.value(adObsCalNam_.getLCode())->allocateSpace();
1781  for (int i=0; i<calList.size(); i++)
1782  c1Data_.value(adObsCalNam_.getLCode())->value(i, 0, 0) = calList.at(i);
1783  };
1784  calList.clear();
1785 
1786  //
1787  // Sources:
1788  idx = 0;
1789  for (QMap<QString, SgVlbiSourceInfo*>::const_iterator it=session_->sourcesByName().begin();
1790  it!=session_->sourcesByName().end(); ++it, idx++)
1791  {
1792  SgVlbiSourceInfo *src=it.value();
1793  // strings:
1794  if (c1Data_.contains(adSrcName_.getLCode()))
1795  c1Data_.value(adSrcName_.getLCode())->value(idx, 0, 0) = src->getKey();
1796  if (c1Data_.contains(adSrcApRef_.getLCode()))
1797  c1Data_.value(adSrcApRef_.getLCode())->value(idx, 0, 0) = src->getAprioriReference();
1798  // r8:
1799  if (r8Data_.contains(adSrcCoord_.getLCode()))
1800  {
1801  r8Data_.value(adSrcCoord_.getLCode())->value(0, idx, 0, 0) = src->getRA();
1802  r8Data_.value(adSrcCoord_.getLCode())->value(1, idx, 0, 0) = src->getDN();
1803  };
1804  //
1805  if (i2Data_.contains(adSrcStatus_.getLCode()))
1806  i2Data_.value(adSrcStatus_.getLCode())->value(idx, 0, 0, 0) = src->calculateStatusBits();
1807  };
1808 
1809 
1810  //
1811  // Baselines:
1812  QList<QString> baselineNames;
1813  QList<double> blWght4delays;
1814  QList<double> blWght4rates;
1815  QList<QString> clocks4baselines;
1816  for (QMap<QString, SgVlbiBaselineInfo*>::const_iterator it=session_->baselinesByName().begin();
1817  it!=session_->baselinesByName().end(); ++it)
1818  {
1819  SgVlbiBaselineInfo *bi=it.value();
1820  str = bi->getKey();
1821  if (str.at(8) == ':')
1822  str.remove(8, 1);
1823  //
1824  baselineNames.append(str);
1825  blWght4delays.append(bi->getSigma2add(DT_DELAY));
1826  blWght4rates .append(bi->getSigma2add(DT_RATE ));
1827  //
1830  clocks4baselines << str;
1831  };
1832  //
1833  if (c1Data_.contains(adErrorBl_.getLCode()))
1834  {
1835  for (int i=0; i<numOfBln_; i++)
1836  c1Data_.value(adErrorBl_.getLCode())->value(i, 0, 0) = baselineNames.at(i);
1837  };
1838  if (r8Data_.contains(adErrorK_.getLCode()))
1839  {
1840  for (int i=0; i<numOfBln_; i++)
1841  {
1842  r8Data_.value(adErrorK_.getLCode())->value(0, i, 0, 0) = blWght4delays.at(i);
1843  r8Data_.value(adErrorK_.getLCode())->value(1, i, 0, 0) = blWght4rates.at(i);
1844  };
1845  };
1846  if (c1Data_.contains(adBlnClocks_.getLCode()) && clocks4baselines.size())
1847  {
1848  // adjust the size:
1849  adBlnClocks_.setDim2(clocks4baselines.size());
1850  c1Data_.value(adBlnClocks_.getLCode())->allocateSpace();
1851  for (int i=0; i<clocks4baselines.size(); i++)
1852  c1Data_.value(adBlnClocks_.getLCode())->value(i, 0, 0) = clocks4baselines.at(i);
1853  }
1854  else
1855  {
1856  //??
1857  };
1858  //
1859  // Bands:
1860  for (int i=0; i<session_->bands().size(); i++)
1861  {
1862  const QString &bandKey=session_->bands().at(i)->getKey();
1863  totChannels += numOfChansByBand_[bandKey];
1864  // string:
1865  if (c1Data_.contains(adBandNames_.getLCode()))
1866  c1Data_.value(adBandNames_.getLCode())->value(i, 0, 0) = bandKey;
1867  // i4:
1868  if (i4Data_.contains(adNumChnBnd_.getLCode()))
1869  i4Data_.value(adNumChnBnd_.getLCode())->value(0, i, 0, 0) = numOfChansByBand_[bandKey];
1870  };
1871 
1872 
1873  //
1874  // General:
1875  if (c1Data_.contains(adCorrPlace_.getLCode()))
1876  c1Data_.value(adCorrPlace_.getLCode())->value(0, 0, 0) = session_->getCorrelatorName();
1877  if (c1Data_.contains(adCorrType_.getLCode()))
1878  c1Data_.value(adCorrType_.getLCode())->value(0, 0, 0) = session_->getCorrelatorType();
1879  if (c1Data_.contains(adExpCode_.getLCode()))
1880  c1Data_.value(adExpCode_.getLCode())->value(0, 0, 0) = session_->getSessionCode();
1881  if (c1Data_.contains(adExpDesc_.getLCode()))
1882  c1Data_.value(adExpDesc_.getLCode())->value(0, 0, 0) = session_->getDescription();
1883  //
1884  //??
1885  if (c1Data_.contains(adExpName_.getLCode()))
1886  c1Data_.value(adExpName_.getLCode())->value(0, 0, 0) = session_->getSessionCode();
1887  //
1888  if (c1Data_.contains(adMk3DbName_.getLCode()))
1889  c1Data_.value(adMk3DbName_.getLCode())->value(0, 0, 0) = session_->getName();
1890  if (c1Data_.contains(adPiName_.getLCode()))
1891  c1Data_.value(adPiName_.getLCode())->value(0, 0, 0) = session_->getPiAgencyName();
1892  if (c1Data_.contains(adRecMode_.getLCode()))
1893  c1Data_.value(adRecMode_.getLCode())->value(0, 0, 0) = session_->getRecordingMode();
1894  // i2:
1895  if (i2Data_.contains(adExpSerNo_.getLCode()))
1896  i2Data_.value(adExpSerNo_.getLCode())->value(0, 0, 0, 0) = session_->getExperimentSerialNumber();
1897  // i4:
1898  if (i4Data_.contains(adNumSrc_.getLCode()))
1899  i4Data_.value(adNumSrc_.getLCode())->value(0, 0, 0, 0) = srcIdxByKey_.size();
1900  if (i4Data_.contains(adNumBands_.getLCode()))
1901  i4Data_.value(adNumBands_.getLCode())->value(0, 0, 0, 0) = numOfBands_;
1902  if (i4Data_.contains(adNumChnTot_.getLCode()))
1903  i4Data_.value(adNumChnTot_.getLCode())->value(0, 0, 0, 0) = totChannels;
1904  if (i4Data_.contains(adNumAvaBnd_.getLCode()))
1905  i4Data_.value(adNumAvaBnd_.getLCode())->value(0, 0, 0, 0) = numOfBands_;
1906  //
1907  // added:
1908  if (i2Data_.contains(adInterval4_.getLCode()))
1909  {
1910  int ep[5];
1911  double f;
1912  session_->getTStart().toYMDHMS_tr(ep[0], ep[1], ep[2], ep[3], ep[4], f);
1913  for (int i=0; i<5; i++)
1914  i2Data_.value(adInterval4_.getLCode())->value(0, i, 0, 0) = ep[i];
1915  session_->getTFinis().toYMDHMS_tr(ep[0], ep[1], ep[2], ep[3], ep[4], f);
1916  for (int i=0; i<5; i++)
1917  i2Data_.value(adInterval4_.getLCode())->value(1, i, 0, 0) = ep[i];
1918  };
1919 
1920  if (r8Data_.contains(adUtcMtai_.getLCode()))
1921  r8Data_.value(adUtcMtai_.getLCode())->value(0, 0, 0, 0) = -session_->getLeapSeconds();// reverse sign
1922 
1923 
1924  //4CALC:
1925  if (c1Data_.contains(adCalcFlgN_.getLCode()) && i2Data_.contains(adCalcFlgV_.getLCode()))
1926  {
1927  for (int i=0; i<session_->calcInfo().controlFlagNames().size(); i++)
1928  {
1929  i2Data_.value(adCalcFlgV_.getLCode())->value(i, 0, 0, 0) =
1930  session_->calcInfo().controlFlagValues().at(i);
1931  c1Data_.value(adCalcFlgN_.getLCode())->value(i, 0, 0) =
1932  session_->calcInfo().controlFlagNames().at(i);
1933  };
1934  };
1935 
1936  if (i2Data_.contains(adTidalUt1_.getLCode()))
1937  i2Data_.value(adTidalUt1_.getLCode())->value(0, 0, 0, 0) = session_->calcInfo().getFlagTidalUt1();
1938  if (r8Data_.contains(adCalcVer_.getLCode()))
1939  r8Data_.value(adCalcVer_.getLCode())->value(0, 0, 0, 0) = session_->calcInfo().getDversion();
1940  if (r8Data_.contains(adRelData_.getLCode()))
1941  r8Data_.value(adRelData_.getLCode())->value(0, 0, 0, 0) = session_->calcInfo().getRelativityData();
1942  if (r8Data_.contains(adPreData_.getLCode()))
1943  r8Data_.value(adPreData_.getLCode())->value(0, 0, 0, 0) = session_->calcInfo().getPrecessionData();
1944  if (r8Data_.contains(adEtdData_.getLCode()))
1945  {
1946  r8Data_.value(adEtdData_.getLCode())->value(0, 0, 0, 0) = session_->calcInfo().getEarthTideData(0);
1947  r8Data_.value(adEtdData_.getLCode())->value(1, 0, 0, 0) = session_->calcInfo().getEarthTideData(1);
1948  r8Data_.value(adEtdData_.getLCode())->value(2, 0, 0, 0) = session_->calcInfo().getEarthTideData(2);
1949  };
1950  //
1956  session_->calcInfo().earthTide());
1958  session_->calcInfo().poleTide());
1960  session_->calcInfo().nutation());
1968  session_->calcInfo().parallax());
1970  session_->calcInfo().star());
1973 
1974  if (c1Data_.contains(adSitMess_.getLCode()))
1975  c1Data_.value(adSitMess_.getLCode())->value(0, 0, 0) =
1977  if (c1Data_.contains(adPanMess_.getLCode()))
1978  c1Data_.value(adPanMess_.getLCode())->value(0, 0, 0) =
1980  if (c1Data_.contains(adPepMess_.getLCode()))
1981  c1Data_.value(adPepMess_.getLCode())->value(0, 0, 0) =
1983  if (c1Data_.contains(adWobCflg_.getLCode()))
1984  c1Data_.value(adWobCflg_.getLCode())->value(0, 0, 0) =
1986  if (c1Data_.contains(adUt1Cflg_.getLCode()))
1987  c1Data_.value(adUt1Cflg_.getLCode())->value(0, 0, 0) =
1989 
1990  if (c1Data_.contains(adOceStat_.getLCode()))
1991  for (int i=0; i<session_->calcInfo().oLoadStationStatus().size(); i++)
1992  c1Data_.value(adOceStat_.getLCode())->value(i, 0, 0) =
1994 
1995  if (r8Data_.contains(adSiteZens_.getLCode()))
1996  for (int i=0; i<session_->calcInfo().siteZenDelays().size(); i++)
1997  r8Data_.value(adSiteZens_.getLCode())->value(i, 0, 0, 0) =
1998  session_->calcInfo().siteZenDelays().at(i);
1999 
2000  if (r8Data_.contains(adUt1Epoch_.getLCode()))
2001  for (unsigned int i=0; i<session_->calcInfo().ut1InterpData()->nRow(); i++)
2002  for (unsigned int j=0; j<session_->calcInfo().ut1InterpData()->nCol(); j++)
2003  r8Data_.value(adUt1Epoch_.getLCode())->value(j, i, 0, 0) =
2005 
2006  if (r8Data_.contains(adWobEpoch_.getLCode()))
2007  for (unsigned int i=0; i<session_->calcInfo().wobInterpData()->nRow(); i++)
2008  for (unsigned int j=0; j<session_->calcInfo().wobInterpData()->nCol(); j++)
2009  r8Data_.value(adWobEpoch_.getLCode())->value(j, i, 0, 0) =
2011 
2012  for (int i=0; i<session_->calcInfo().stations().size(); i++)
2013  {
2015  if (si)
2016  {
2017  if (r8Data_.contains(adSitOcPhs_.getLCode()) &&
2018  r8Data_.contains(adSitOcAmp_.getLCode()) &&
2019  r8Data_.contains(adSitHWOPh_.getLCode()) &&
2020  r8Data_.contains(adSitHWOAm_.getLCode()) &&
2021  r8Data_.contains(adSitHSOPh_.getLCode()) &&
2022  r8Data_.contains(adSitHSOAm_.getLCode()) )
2023  for (int j=0; j<11; j++)
2024  {
2025  r8Data_.value(adSitOcPhs_.getLCode())->value(i, j, 0, 0) = si->getOLoadPhase(j, 0);
2026  r8Data_.value(adSitHWOPh_.getLCode())->value(i, j, 0, 0) = si->getOLoadPhase(j, 1);
2027  r8Data_.value(adSitHSOPh_.getLCode())->value(i, j, 0, 0) = si->getOLoadPhase(j, 2);
2028  r8Data_.value(adSitOcAmp_.getLCode())->value(i, j, 0, 0) = si->getOLoadAmplitude(j, 0);
2029  r8Data_.value(adSitHWOAm_.getLCode())->value(i, j, 0, 0) = si->getOLoadAmplitude(j, 1);
2030  r8Data_.value(adSitHSOAm_.getLCode())->value(i, j, 0, 0) = si->getOLoadAmplitude(j, 2);
2031  };
2032  //
2033  if (r8Data_.contains(adOPTLCoef_.getLCode()))
2034  for (int j=0; j<6; j++)
2035  r8Data_.value(adOPTLCoef_.getLCode())->value(i, j, 0, 0) = si->getOptLoadCoeff(j);
2036 
2037  if (i2Data_.contains(adAxisTyps_.getLCode()))
2038  i2Data_.value(adAxisTyps_.getLCode())->value(i, 0, 0, 0) =
2040 
2041  if (r8Data_.contains(adAxisOffs_.getLCode()))
2042  r8Data_.value(adAxisOffs_.getLCode())->value(i, 0, 0, 0) = si->getAxisOffset();
2043 
2044  if (r8Data_.contains(adAxisTilt_.getLCode()))
2045  {
2046  r8Data_.value(adAxisTilt_.getLCode())->value(i, 0, 0, 0) = si->getTilt(0);
2047  r8Data_.value(adAxisTilt_.getLCode())->value(i, 1, 0, 0) = si->getTilt(1);
2048  };
2049 
2050  if (c1Data_.contains(adEccTypes_.getLCode()))
2051  c1Data_.value(adEccTypes_.getLCode())->value(i, 0, 0) =
2052  si->eccRec()->getEccType()==SgEccRec::ET_XYZ ? "XY" :
2053  si->eccRec()->getEccType()==SgEccRec::ET_NEU ? "NE" : "N/A";
2054  if (r8Data_.contains(adEccCoord_.getLCode()))
2055  {
2056  r8Data_.value(adEccCoord_.getLCode())->value(i, 0, 0, 0) = si->eccRec()->getDR().at(X_AXIS);
2057  r8Data_.value(adEccCoord_.getLCode())->value(i, 1, 0, 0) = si->eccRec()->getDR().at(Y_AXIS);
2058  r8Data_.value(adEccCoord_.getLCode())->value(i, 2, 0, 0) = si->eccRec()->getDR().at(Z_AXIS);
2059  };
2060  if (c1Data_.contains(adEccNames_.getLCode()))
2061  c1Data_.value(adEccNames_.getLCode())->value(i, 0, 0) =
2062  si->eccRec()->getCdpNumber().leftJustified(10, ' ');
2063 
2064 
2065  }
2066  else
2068  "::fillSessVars(): the stnInfo is NULL for the idx=" + QString("").setNum(i));
2069  };
2070 
2071  if (r8Data_.contains(adFwobInf_.getLCode()) &&
2072  r8Data_.contains(adFut1Inf_.getLCode()) &&
2073  c1Data_.contains(adUt1Intrp_.getLCode()) &&
2074  c1Data_.contains(adUt1Mess_.getLCode()) &&
2075  c1Data_.contains(adWobMess_.getLCode()) &&
2076  c1Data_.contains(adWobIntrp_.getLCode()) &&
2077  c1Data_.contains(adFut1Text_.getLCode()) &&
2078  c1Data_.contains(adFwobText_.getLCode()) &&
2079  r8Data_.contains(adFut1Pts_.getLCode()) &&
2080  r8Data_.contains(adFwobXnYt_.getLCode()) )
2081  {
2084  "::fillSessVars(): the set of argumets for UT1 interpolation is not defined");
2085  else if (!session_->args4PxyInterpolation())
2087  "::fillSessVars(): the set of argumets for Polar motion interpolation is not defined");
2088  else
2089  {
2090  double d;
2091  // 0:
2093  r8Data_.value(adFut1Inf_.getLCode())->value(0, 0, 0, 0) = d>2390000.0?d:d+2400000.5;
2095  r8Data_.value(adFwobInf_.getLCode())->value(0, 0, 0, 0) = d>2390000.0?d:d+2400000.5;
2096  // 1:
2097  r8Data_.value(adFut1Inf_.getLCode())->value(1, 0, 0, 0) =
2101  r8Data_.value(adFwobInf_.getLCode())->value(1, 0, 0, 0) =
2105  // 2:
2106  r8Data_.value(adFut1Inf_.getLCode())->value(2, 0, 0, 0) =
2108  r8Data_.value(adFwobInf_.getLCode())->value(2, 0, 0, 0) =
2110  // 3:
2111  r8Data_.value(adFut1Inf_.getLCode())->value(3, 0, 0, 0) = 1.0;
2112  //
2113  for (unsigned int i=0; i<session_->tabs4Ut1Interpolation()->nRow(); i++)
2114  r8Data_.value(adFut1Pts_.getLCode())->value(i, 0, 0, 0) =
2116  for (unsigned int i=0; i<session_->tabs4PxyInterpolation()->nRow(); i++)
2117  {
2118  r8Data_.value(adFwobXnYt_.getLCode())->value(i, 0, 0, 0) =
2120  r8Data_.value(adFwobXnYt_.getLCode())->value(i, 1, 0, 0) =
2122  };
2123  if (c1Data_.contains(adUt1Intrp_.getLCode()))
2124  c1Data_.value(adUt1Intrp_.getLCode())->value(0, 0, 0) =
2126  if (c1Data_.contains(adWobIntrp_.getLCode()))
2127  c1Data_.value(adWobIntrp_.getLCode())->value(0, 0, 0) =
2129 
2130  if (c1Data_.contains(adUt1Mess_.getLCode()))
2131  c1Data_.value(adUt1Mess_.getLCode())->value(0, 0, 0) =
2133  if (c1Data_.contains(adWobMess_.getLCode()))
2134  c1Data_.value(adWobMess_.getLCode())->value(0, 0, 0) =
2136 
2137  if (c1Data_.contains(adFut1Text_.getLCode()))
2138  c1Data_.value(adFut1Text_.getLCode())->value(0, 0, 0) =
2140  if (c1Data_.contains(adFwobText_.getLCode()))
2141  c1Data_.value(adFwobText_.getLCode())->value(0, 0, 0) =
2143 
2144  };
2145  }
2146  else
2148  "::fillSessVars(): no ERP interpolation data to store");
2149 };
2150 
2151 
2152 
2153 //
2155 {
2156  bool hasScanNames, hasMjdObs, hasSrcIdx, hasUtcObs;
2157  bool hasCrootFnam, hasFScanName;
2158 
2159  hasScanNames = c1Data_.contains(adScanNames_.getLCode());
2160  hasMjdObs = i4Data_.contains(adMjdObs_.getLCode());
2161  hasSrcIdx = i4Data_.contains(adSrcIdx_.getLCode());
2162  hasUtcObs = r8Data_.contains(adUtcObs_.getLCode());
2163  // added:
2164  hasCrootFnam = c1Data_.contains(adCrootFnam_.getLCode());
2165  hasFScanName = c1Data_.contains(adFScanName_.getLCode());
2166 
2167  // per scan:
2168  for (int i=0; i<scanFullNames_.size(); i++)
2169  {
2170  const QString &scnFullName=scanFullNames_.at(i);
2171  //const QString &scnName=scanNames_.at(i);
2172  // string: here, the scan idx is #3
2173  if (hasScanNames)
2174  c1Data_.value(adScanNames_.getLCode())->value(0, i, 0) = qPrintable(scanNames_.at(i));
2175  // added:
2176  if (hasCrootFnam)
2177  c1Data_.value(adCrootFnam_.getLCode())->value(0, i, 0) = qPrintable(crootFileNames_.at(i));
2178  if (hasFScanName)
2179  c1Data_.value(adFScanName_.getLCode())->value(0, i, 0) = qPrintable(scanFullNames_.at(i));
2180 
2181  // i4:
2182  if (hasMjdObs)
2183  i4Data_.value(adMjdObs_.getLCode())->value(0, 0, i, 0) =
2184  epochByScanFullName_[scnFullName].getDate();
2185  if (hasSrcIdx)
2186  i4Data_.value(adSrcIdx_.getLCode())->value(0, 0, i, 0) = srcIdxByKey_[scanSrcNames_.at(i)] + 1;
2187 
2188  // R8:
2189  if (hasUtcObs)
2190  r8Data_.value(adUtcObs_.getLCode())->value(0, 0, i, 0) =
2191  epochByScanFullName_[scnFullName].getTime()*86400.0;
2192  };
2193 };
2194 
2195 
2196 
2197 //
2199 {
2200  QString str("");
2201  int nYear, nMonth, nDay, nHour, nMin, scanIdx;
2202  double dSec;
2203  QMap<QString, SgMJD> epochByScanId;
2204  epochByScanId.clear();
2205  scanIdx = 0;
2206 
2207  // per obs:
2208  for (int i=0; i<numOfObs_; i++)
2209  {
2210  SgVlbiObservation *obs=session_->observations().at(i);
2211 
2212  // +per band:
2213  for (QMap<QString, SgVlbiObservable*>::iterator it=obs->observableByKey().begin();
2214  it!=obs->observableByKey().end(); ++it)
2215  {
2216  SgVlbiObservable *o=it.value();
2217  const QString &bandKey=o->getBandKey();
2218  int bndIdx=bndIdxByKey_[bandKey];
2219  //
2220  // string: here, the obs idx is #3
2221  if (c1Data_.contains(adQualCodes_.getLCode()))
2222  c1Data_.value(adQualCodes_.getLCode())->value(bndIdx, i, 0) =
2223  QString("").sprintf("%d", o->getQualityFactor());
2224  if (c1Data_.contains(adFourfCmd_.getLCode()))
2225  c1Data_.value(adFourfCmd_.getLCode())->value(bndIdx, i, 0) = o->getFourfitCommandOverride();
2226  if (c1Data_.contains(adFourfCtrl_.getLCode()))
2227  c1Data_.value(adFourfCtrl_.getLCode())->value(bndIdx, i, 0) = o->getFourfitControlFile();
2228 
2229  // reals:
2230  // SB delays:
2231  if (r8Data_.contains(adSbDelVal_.getLCode()))
2232  r8Data_.value(adSbDelVal_.getLCode())->value(bndIdx, 0, i, 0) = o->sbDelay().getValue();
2233  if (r8Data_.contains(adSbDelErr_.getLCode()))
2234  r8Data_.value(adSbDelErr_.getLCode())->value(bndIdx, 0, i, 0) = o->sbDelay().getSigma();
2235 
2236  // group delays:
2237  if (r8Data_.contains(adGrDelVal_.getLCode()))
2238  r8Data_.value(adGrDelVal_.getLCode())->value(bndIdx, 0, i, 0) = o->grDelay().getValue();
2239  if (r8Data_.contains(adGrDelErr_.getLCode()))
2240  r8Data_.value(adGrDelErr_.getLCode())->value(bndIdx, 0, i, 0) = o->grDelay().getSigma();
2241 
2242  // delay rates:
2243  if (r8Data_.contains(adDelRate_.getLCode()))
2244  r8Data_.value(adDelRate_.getLCode())->value(bndIdx, 0, i, 0) = o->phDRate().getValue();
2245  if (r8Data_.contains(adPhRatErr_.getLCode()))
2246  r8Data_.value(adPhRatErr_.getLCode())->value(bndIdx, 0, i, 0) = o->phDRate().getSigma();
2247 
2248  // aux:
2249  if (r8Data_.contains(adGrDelAmbg_.getLCode()))
2250  r8Data_.value(adGrDelAmbg_.getLCode())->value(bndIdx, 0, i, 0) =
2252  if (r8Data_.contains(adRefFreq_.getLCode())) // MHz->Hz
2253  r8Data_.value(adRefFreq_.getLCode())->value(bndIdx, 0, i, 0) = o->getReferenceFrequency()*1.0E6;
2254  if (r8Data_.contains(adSnr_.getLCode()))
2255  r8Data_.value(adSnr_.getLCode())->value(bndIdx, 0, i, 0) = o->getSnr();
2256  if (r8Data_.contains(adTotPhase_.getLCode()))
2257  r8Data_.value(adTotPhase_.getLCode())->value(bndIdx, 0, i, 0) = o->getTotalPhase();
2258 
2259  // added:
2260  if (r8Data_.contains(adCorrelatn_.getLCode()))
2261  r8Data_.value(adCorrelatn_.getLCode())->value(bndIdx, 0, i, 0) = o->getCorrCoeff();
2262 
2263  if (r8Data_.contains(adFrnAmpl_.getLCode()))
2264  r8Data_.value(adFrnAmpl_.getLCode())->value(bndIdx, 0, i, 0) = o->getCorrCoeff();
2265 
2266  if (i2Data_.contains(adNumLags_.getLCode()))
2267  i2Data_.value(adNumLags_.getLCode())->value(bndIdx, 0, i, 0) = o->getNlags();
2268 
2269  if (r8Data_.contains(adUvf_Asec_.getLCode()))
2270  {
2271  r8Data_.value(adUvf_Asec_.getLCode())->value(bndIdx, 0, i, 0) = o->getUvFrPerAsec(0);
2272  r8Data_.value(adUvf_Asec_.getLCode())->value(bndIdx, 1, i, 0) = o->getUvFrPerAsec(1);
2273  };
2274 
2275  if (r8Data_.contains(adUnPhaseCl_.getLCode()))
2276  {
2277  r8Data_.value(adUnPhaseCl_.getLCode())->value(bndIdx, 0, i, 0) = o->getPhaseCalGrDelays(0);
2278  r8Data_.value(adUnPhaseCl_.getLCode())->value(bndIdx, 1, i, 0) = o->getPhaseCalGrDelays(1);
2279  };
2280  if (r8Data_.contains(adSamplRate_.getLCode()))
2281  r8Data_.value(adSamplRate_.getLCode())->value(bndIdx, 0, i, 0) = o->getSampleRate();
2282 
2283  //
2284  //
2285  // ionosphere corrections:
2286  //
2287  if (r8Data_.contains(adIonCorr_.getLCode()))
2288  {
2289  r8Data_.value(adIonCorr_.getLCode())->value(0, bndIdx, i, 0) = o->grDelay().getIonoValue();
2290  r8Data_.value(adIonCorr_.getLCode())->value(1, bndIdx, i, 0) = o->phDRate().getIonoValue();
2291  };
2292  if (r8Data_.contains(adIonRms_.getLCode()))
2293  {
2294  r8Data_.value(adIonRms_.getLCode())->value(0, bndIdx, i, 0) = o->grDelay().getIonoSigma();
2295  r8Data_.value(adIonRms_.getLCode())->value(1, bndIdx, i, 0) = o->phDRate().getIonoSigma();
2296  };
2297  if (i2Data_.contains(adIonDtFlg_.getLCode()))
2298  {
2299  short int flg=-1;
2300  if (obs->observableByKey().size()==1)
2301  flg = -1;
2302  else
2303  {
2304  flg = 0;
2305  //The -3 flag is set if
2306  //ION_DELAY_SIGMA < 1.d-14 or ION_RATE_SIGMA < 1.d-17
2307  if (o->grDelay().getIonoSigma()<1.0e-14 || o->phDRate().getIonoSigma()<1.0e-17)
2308  flg = -3;
2309  //The -4 flag is set if
2310  //ION_DELAY_SIGMA >1.d-8 or ION_RATE_SIGMA > 1.d-8
2311  if (o->grDelay().getIonoSigma()>1.0e-8 || o->phDRate().getIonoSigma()>1.0e-8)
2312  flg = -4;
2313  };
2314  i2Data_.value(adIonDtFlg_.getLCode())->value(bndIdx, 0, i, 0) = flg;
2315  };
2316  //
2317  // end of ionosphere corrections.
2318  //
2319 
2320  if (r8Data_.contains(adEffFreq_.getLCode()))
2321  {
2322  r8Data_.value(adEffFreq_.getLCode())->value(0, bndIdx, i, 0) = o->grDelay().getEffFreq()*1.0e6;
2323  r8Data_.value(adEffFreq_.getLCode())->value(1, bndIdx, i, 0) = o->phDelay().getEffFreq()*1.0e6;
2324  r8Data_.value(adEffFreq_.getLCode())->value(2, bndIdx, i, 0) = o->phDRate().getEffFreq()*1.0e6;
2325  };
2326  if (r8Data_.contains(adEffFrew_.getLCode()))
2327  {
2328  r8Data_.value(adEffFrew_.getLCode())->value(0, bndIdx, i, 0) =
2329  o->grDelay().getEffFreqEqWgt()*1.0e6;
2330  r8Data_.value(adEffFrew_.getLCode())->value(1, bndIdx, i, 0) =
2331  o->phDelay().getEffFreqEqWgt()*1.0e6;
2332  r8Data_.value(adEffFrew_.getLCode())->value(2, bndIdx, i, 0) =
2333  o->phDRate().getEffFreqEqWgt()*1.0e6;
2334  };
2335 
2336  if (i4Data_.contains(adNumGrAmbg_.getLCode()))
2337  i4Data_.value(adNumGrAmbg_.getLCode())->value(bndIdx, 0, i, 0) =
2339 
2340 
2341  // correlator info data:
2342  if (c1Data_.contains(adFourfErr_.getLCode()))
2343  c1Data_.value(adFourfErr_.getLCode())->value(bndIdx, i, 0) =
2344  o->getErrorCode()==" "?"_":o->getErrorCode();
2345  if (c1Data_.contains(adFourfFile_.getLCode()))
2346  c1Data_.value(adFourfFile_.getLCode())->value(bndIdx, i, 0) =
2347  qPrintable(o->getFourfitOutputFName());
2348  if (i2Data_.contains(adStrtOffst_.getLCode()))
2349  i2Data_.value(adStrtOffst_.getLCode())->value(bndIdx, 0, i, 0) = o->getStartOffset();
2350  if (i2Data_.contains(adStopOffst_.getLCode()))
2351  i2Data_.value(adStopOffst_.getLCode())->value(bndIdx, 0, i, 0) = o->getStopOffset();
2352 //
2353 // obs->setCorrRootFileName(vlb1FileNames.at(obsIdx));
2354 // obs->auxObs_1()->setTapeId(tapeIds_1.at(obsIdx));
2355 // obs->auxObs_2()->setTapeId(tapeIds_2.at(obsIdx));
2356 //
2357  if (c1Data_.contains(adTapQcode_.getLCode()))
2358  c1Data_.value(adTapQcode_.getLCode())->value(bndIdx, i, 0) =
2359  QString("").sprintf("%-6s", qPrintable(o->getTapeQualityCode()));
2360 
2361  if (i2Data_.contains(adHopsVer_.getLCode()))
2362  i2Data_.value(adHopsVer_.getLCode())->value(bndIdx, 0, i, 0) = o->getHopsRevisionNumber();
2363  if (i2Data_.contains(adFourFtVer_.getLCode()))
2364  {
2365  i2Data_.value(adFourFtVer_.getLCode())->value(bndIdx, 0, i, 0) = o->getFourfitVersion(0);
2366  i2Data_.value(adFourFtVer_.getLCode())->value(bndIdx, 1, i, 0) = o->getFourfitVersion(1);
2367  };
2368  if (i2Data_.contains(adScanUtc_.getLCode()))
2369  {
2370  o->getEpochOfScan().toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
2371  i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 0, i, 0) = nYear;
2372  i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 1, i, 0) = nMonth;
2373  i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 2, i, 0) = nDay;
2374  i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 3, i, 0) = nHour;
2375  i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 4, i, 0) = nMin;
2376  i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 5, i, 0) = (int)trunc(dSec);
2377  };
2378  if (i2Data_.contains(adUtcMtag_.getLCode()))
2379  {
2380  o->getEpochCentral().toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
2381  i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 0, i, 0) = nYear;
2382  i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 1, i, 0) = nMonth;
2383  i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 2, i, 0) = nDay;
2384  i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 3, i, 0) = nHour;
2385  i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 4, i, 0) = nMin;
2386  i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 5, i, 0) = (int)trunc(dSec);
2387  };
2388  if (i2Data_.contains(adCorrUtc_.getLCode()))
2389  {
2390  o->getEpochOfCorrelation().toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
2391  i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 0, i, 0) = nYear;
2392  i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 1, i, 0) = nMonth;
2393  i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 2, i, 0) = nDay;
2394  i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 3, i, 0) = nHour;
2395  i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 4, i, 0) = nMin;
2396  i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 5, i, 0) = (int)trunc(dSec);
2397  };
2398  if (i2Data_.contains(adFourUtc_.getLCode()))
2399  {
2400  o->getEpochOfFourfitting().toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
2401  i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 0, i, 0) = nYear;
2402  i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 1, i, 0) = nMonth;
2403  i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 2, i, 0) = nDay;
2404  i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 3, i, 0) = nHour;
2405  i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 4, i, 0) = nMin;
2406  i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 5, i, 0) = (int)trunc(dSec);
2407  };
2408  // reals:
2409  if (r8Data_.contains(adQbFactor_.getLCode()))
2410  r8Data_.value(adQbFactor_.getLCode())->value(bndIdx, 0, i, 0) = o->getAcceptedRatio();
2411  if (r8Data_.contains(adDiscard_.getLCode()))
2412  r8Data_.value(adDiscard_.getLCode())->value(bndIdx, 0, i, 0) = o->getDiscardRatio();
2413  if (r8Data_.contains(adDeltaEpo_.getLCode()))
2414  r8Data_.value(adDeltaEpo_.getLCode())->value(bndIdx, 0, i, 0) = o->getCentrOffset();
2415  if (r8Data_.contains(adStartSec_.getLCode()))
2416  {
2417  o->getTstart().toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
2418  r8Data_.value(adStartSec_.getLCode())->value(bndIdx, 0, i, 0) = 60.0*nMin + dSec;
2419  };
2420  if (r8Data_.contains(adStopSec_.getLCode()))
2421  {
2422  o->getTstop().toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
2423  r8Data_.value(adStopSec_.getLCode())->value(bndIdx, 0, i, 0) = 60.0*nMin + dSec;
2424  };
2425  if (r8Data_.contains(adSbResid_.getLCode()))
2426  r8Data_.value(adSbResid_.getLCode())->value(bndIdx, 0, i, 0) =
2428  if (r8Data_.contains(adGrResid_.getLCode()))
2429  r8Data_.value(adGrResid_.getLCode())->value(bndIdx, 0, i, 0) =
2431  if (r8Data_.contains(adRtResid_.getLCode()))
2432  r8Data_.value(adRtResid_.getLCode())->value(bndIdx, 0, i, 0) =
2434  if (r8Data_.contains(adEffDura_.getLCode()))
2435  r8Data_.value(adEffDura_.getLCode())->value(bndIdx, 0, i, 0) = o->getEffIntegrationTime();
2436  if (r8Data_.contains(adFalseDet_.getLCode()))
2437  r8Data_.value(adFalseDet_.getLCode())->value(bndIdx, 0, i, 0) = o->getProbabOfFalseDetection();
2438  if (r8Data_.contains(adGcSbDel_.getLCode()))
2439  r8Data_.value(adGcSbDel_.getLCode())->value(bndIdx, 0, i, 0) = o->sbDelay().getGeocenterValue();
2440  if (r8Data_.contains(adGcMbDel_.getLCode()))
2441  r8Data_.value(adGcMbDel_.getLCode())->value(bndIdx, 0, i, 0) = o->grDelay().getGeocenterValue();
2442  if (r8Data_.contains(adGcRate_.getLCode()))
2443  r8Data_.value(adGcRate_.getLCode())->value(bndIdx, 0, i, 0) = o->phDRate().getGeocenterValue();
2444  if (r8Data_.contains(adGcPhase_.getLCode()))
2445  r8Data_.value(adGcPhase_.getLCode())->value(bndIdx, 0, i, 0) =
2447  if (r8Data_.contains(adGcPhsRes_.getLCode()))
2448  r8Data_.value(adGcPhsRes_.getLCode())->value(bndIdx, 0, i, 0) =
2450  if (r8Data_.contains(adIncohAmp_.getLCode()))
2451  r8Data_.value(adIncohAmp_.getLCode())->value(bndIdx, 0, i, 0) = o->getIncohChanAddAmp();
2452  if (r8Data_.contains(adIncohAmp2_.getLCode()))
2453  r8Data_.value(adIncohAmp2_.getLCode())->value(bndIdx, 0, i, 0) = o->getIncohSegmAddAmp();
2454  if (r8Data_.contains(adAprioriDl_.getLCode()))
2455  r8Data_.value(adAprioriDl_.getLCode())->value(bndIdx, 0, i, 0) = o->getAprioriDra(0);
2456  if (r8Data_.contains(adAprioriRt_.getLCode()))
2457  r8Data_.value(adAprioriRt_.getLCode())->value(bndIdx, 0, i, 0) = o->getAprioriDra(1);
2458  if (r8Data_.contains(adAprioriAc_.getLCode()))
2459  r8Data_.value(adAprioriAc_.getLCode())->value(bndIdx, 0, i, 0) = o->getAprioriDra(2);
2460  if (r8Data_.contains(adUrVr_.getLCode()))
2461  {
2462  r8Data_.value(adUrVr_.getLCode())->value(bndIdx, 0, i, 0) = o->getUrVr(0);
2463  r8Data_.value(adUrVr_.getLCode())->value(bndIdx, 1, i, 0) = o->getUrVr(1);
2464  };
2465  if (r8Data_.contains(adFeedCor_.getLCode()))
2466  {
2467  r8Data_.value(adFeedCor_.getLCode())->value(0, bndIdx, i, 0) = o->getCalcFeedCorrDelay();
2468  r8Data_.value(adFeedCor_.getLCode())->value(1, bndIdx, i, 0) = o->getCalcFeedCorrRate();
2469  };
2470  if (r8Data_.contains(adIdelay_.getLCode()))
2471  {
2472  r8Data_.value(adIdelay_.getLCode())->value(bndIdx, 0, i, 0) = o->getInstrDelay(0);
2473  r8Data_.value(adIdelay_.getLCode())->value(bndIdx, 1, i, 0) = o->getInstrDelay(1);
2474  };
2475  if (r8Data_.contains(adSrchPar_.getLCode()))
2476  for (int j=0; j<6; j++)
2477  r8Data_.value(adSrchPar_.getLCode())->value(bndIdx, j, i, 0) = o->getFourfitSearchParameters(j);
2478  if (r8Data_.contains(adCorrClock_.getLCode()))
2479  {
2480  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 0, i, 0) = o->getCorrClocks(0, 0);
2481  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 1, i, 0) = o->getCorrClocks(0, 1);
2482  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 2, i, 0) = o->getCorrClocks(1, 0);
2483  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 3, i, 0) = o->getCorrClocks(1, 1);
2484  };
2485  if (c1Data_.contains(adCorBasCd_.getLCode()))
2486  c1Data_.value(adCorBasCd_.getLCode())->value(bndIdx, i, 0) =
2487  QString("").sprintf("%c%c", obs->stn_1()->getCid(), obs->stn_2()->getCid());
2488 
2489  if (r8Data_.contains(adZdelay_.getLCode()))
2490  {
2491  r8Data_.value(adZdelay_.getLCode())->value(bndIdx, 0, i, 0) = o->getCorrelZdelay_1();
2492  r8Data_.value(adZdelay_.getLCode())->value(bndIdx, 1, i, 0) = o->getCorrelZdelay_2();
2493  };
2494  if (r8Data_.contains(adStarElev_.getLCode()))
2495  {
2496  r8Data_.value(adStarElev_.getLCode())->value(bndIdx, 0, i, 0) = o->getCorrelStarElev_1();
2497  r8Data_.value(adStarElev_.getLCode())->value(bndIdx, 1, i, 0) = o->getCorrelStarElev_2();
2498  };
2499  //
2500  // EoCIS
2501  // phase cal info stuff:
2502  if (r8Data_.contains(adPhcRate_.getLCode()))
2503  {
2504  r8Data_.value(adPhcRate_.getLCode())->value(bndIdx, 0, i, 0) = o->getPhaseCalRates(0);
2505  r8Data_.value(adPhcRate_.getLCode())->value(bndIdx, 1, i, 0) = o->getPhaseCalRates(1);
2506  };
2507 
2508  // channel dependent data:
2509  if (i2Data_.contains(adBitsSampl_.getLCode()))
2510  i2Data_.value(adBitsSampl_.getLCode())->value(bndIdx, 0, i, 0) = o->getBitsPerSample();
2511  if (i2Data_.contains(adNusedChnl_.getLCode()))
2512  i2Data_.value(adNusedChnl_.getLCode())->value(bndIdx, 0, i, 0) = o->getNumOfChannels();
2513  //
2514  QString chanIds("");
2515  QString polariz("");
2516  for (int j=0; j<o->getNumOfChannels(); j++)
2517  {
2518  if (i2Data_.contains((adNumOfAp_ + bndIdx)->getLCode()))
2519  {
2520  i2Data_.value((adNumOfAp_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2522  i2Data_.value((adNumOfAp_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2524  };
2525  if (i2Data_.contains((adIndexNum_ + bndIdx)->getLCode()))
2526  {
2527  i2Data_.value((adIndexNum_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2528  o->corelIndexNumUSB()->at(j);
2529  i2Data_.value((adIndexNum_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2530  o->corelIndexNumLSB()->at(j);
2531  };
2532 /*
2533  chanIds += QString("").sprintf("%-2c", o->chanIdByChan()->at(j));
2534  polariz += QString("").sprintf("%-2c%-2c",
2535  o->polarization_1ByChan()->at(j), o->polarization_2ByChan()->at(j));
2536 */
2537  chanIds += QString("").sprintf("%c", o->chanIdByChan()->at(j));
2538  polariz += QString("").sprintf("%c%c",
2539  o->polarization_1ByChan()->at(j), o->polarization_2ByChan()->at(j));
2540 
2541  if (i2Data_.contains((adBbcIdx_ + bndIdx)->getLCode()))
2542  {
2543  i2Data_.value((adBbcIdx_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2544  o->bbcIdxByChan_1()->at(j);
2545  i2Data_.value((adBbcIdx_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2546  o->bbcIdxByChan_2()->at(j);
2547  };
2548  if (i2Data_.contains((adErrRate_ + bndIdx)->getLCode()))
2549  {
2550  i2Data_.value((adErrRate_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2551  o->phaseCalData_1ByChan()->getElement(4, j);
2552  i2Data_.value((adErrRate_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2553  o->phaseCalData_2ByChan()->getElement(4, j);
2554  };
2555  if (r8Data_.contains((adRfFreq_ + bndIdx)->getLCode()))
2556  r8Data_.value((adRfFreq_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2557  o->refFreqByChan()->getElement(j);
2558  if (r8Data_.contains((adLoRfFreq_ + bndIdx)->getLCode()))
2559  {
2560  r8Data_.value((adLoRfFreq_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2561  o->loFreqByChan_1()->getElement(j);
2562  r8Data_.value((adLoRfFreq_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2563  o->loFreqByChan_2()->getElement(j);
2564  };
2565  if (r8Data_.contains((adNumSmpls_ + bndIdx)->getLCode()))
2566  {
2567  r8Data_.value((adNumSmpls_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2569  r8Data_.value((adNumSmpls_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2571  };
2572  if (r8Data_.contains((adChAmpPhs_ + bndIdx)->getLCode()))
2573  {
2574  r8Data_.value((adChAmpPhs_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2576  r8Data_.value((adChAmpPhs_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2578  };
2579  // phase cal info data:
2580  if (r8Data_.contains((adPhcFrq_ + bndIdx)->getLCode()))
2581  {
2582  r8Data_.value((adPhcFrq_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2584  r8Data_.value((adPhcFrq_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2586  };
2587  if (r8Data_.contains((adPhcAmp_ + bndIdx)->getLCode()))
2588  {
2589  r8Data_.value((adPhcAmp_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2591  r8Data_.value((adPhcAmp_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2593  };
2594  if (r8Data_.contains((adPhcPhs_ + bndIdx)->getLCode()))
2595  {
2596  r8Data_.value((adPhcPhs_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2598  r8Data_.value((adPhcPhs_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2600  };
2601  if (r8Data_.contains((adPhcOff_ + bndIdx)->getLCode()))
2602  {
2603  r8Data_.value((adPhcOff_ + bndIdx)->getLCode())->value(j, 0, i, 0) =
2605  r8Data_.value((adPhcOff_ + bndIdx)->getLCode())->value(j, 1, i, 0) =
2607  };
2608  // end of channels
2609  };
2610  if (c1Data_.contains((adChanId_ + bndIdx)->getLCode()) && chanIds.size())
2611  c1Data_.value((adChanId_ + bndIdx)->getLCode())->value(0, i, 0) = chanIds;
2612  if (c1Data_.contains((adPolarz_ + bndIdx)->getLCode()) && polariz.size())
2613  c1Data_.value((adPolarz_ + bndIdx)->getLCode())->value(0, i, 0) = polariz;
2614  //
2615  };
2616  // end of band dependent data
2617 
2618  //ints:
2619  if (i4Data_.contains(adStnIdx_.getLCode()))
2620  {
2621  i4Data_.value(adStnIdx_.getLCode())->value(0, 0, i, 0) = stnIdxByKey_[obs->stn_1()->getKey()] + 1;
2622  i4Data_.value(adStnIdx_.getLCode())->value(1, 0, i, 0) = stnIdxByKey_[obs->stn_2()->getKey()] + 1;
2623  };
2624 
2625  if (r8Data_.contains(adApLength_.getLCode()))
2626  r8Data_.value(adApLength_.getLCode())->value(0, 0, i, 0) = obs->getApLength();
2627 
2628  if (r8Data_.contains(adDtec_.getLCode()))
2629  r8Data_.value(adDtec_.getLCode())->value(0, 0, i, 0) = obs->getDTec();
2630  if (r8Data_.contains(adDtecSig_.getLCode()))
2631  r8Data_.value(adDtecSig_.getLCode())->value(0, 0, i, 0) = obs->getDTecStdDev();
2632 
2633  if (i2Data_.contains(adIonoBits_.getLCode()))
2634  i2Data_.value(adIonoBits_.getLCode())->value(0, 0, i, 0) = obs->calculateIonoBits();
2635 
2636  short int uAcSup=0;
2637  SgVlbiObservable *pbObs=obs->primeObs(), *sbObs=NULL;
2638  for (QMap<QString, SgVlbiObservable*>::iterator it=obs->observableByKey().begin();
2639  it!=obs->observableByKey().end(); ++it)
2640  if (it.value()->getBandKey() != pbObs->getBandKey())
2641  sbObs = it.value();
2642 // if (obs->passiveObses().size())
2643 // sbObs = obs->passiveObses().at(0);
2644 
2647  {
2648  if (pbObs->grDelay().getUnweightFlag()==0)
2649  {
2651  pbObs->grDelay().setUnweightFlag(1);
2652  else if (!obs->isAttr(SgObservation::Attr_PROCESSED))
2653  pbObs->grDelay().setUnweightFlag(2);
2654  //
2655  if (sbObs) // can be NULL
2656  {
2657  int qCodeSb=sbObs->getQualityFactor();
2658  if (qCodeSb==0 && !obs->isAttr(SgObservation::Attr_PROCESSED))
2659  pbObs->grDelay().setUnweightFlag(4);
2660  };
2661  //
2662  if (numOfBands_>1 && !sbObs)
2663  pbObs->grDelay().setUnweightFlag(8);
2664  }
2665  else if (!obs->isAttr(SgObservation::Attr_NOT_VALID) &&
2667  pbObs->grDelay().setUnweightFlag(0);
2668  };
2669 
2670 
2671  if (pbObs->grDelay().getUnweightFlag()==0 && (sbObs || numOfBands_==1))
2672  uAcSup = -32768;
2673  else if (pbObs->grDelay().getUnweightFlag()==1)
2674  uAcSup = -32767;
2675  else
2676  uAcSup = -32763;
2677 
2678  if (i2Data_.contains(adUAcSup_.getLCode()))
2679  i2Data_.value(adUAcSup_.getLCode())->value(0, 0, i, 0) = uAcSup;
2680  if (i2Data_.contains(adDelayFlag_.getLCode()))
2681  i2Data_.value(adDelayFlag_.getLCode())->value(0, 0, i, 0) = pbObs->grDelay().getUnweightFlag();
2682  if (i2Data_.contains(adRateFlag_.getLCode()))
2683  i2Data_.value(adRateFlag_.getLCode())->value(0, 0, i, 0) = pbObs->phDRate().getUnweightFlag();
2684  if (i2Data_.contains(adPhaseFlag_.getLCode()))
2685  i2Data_.value(adPhaseFlag_.getLCode())->value(0, 0, i, 0) = pbObs->phDelay().getUnweightFlag();
2686 
2687 
2688  //4CALC:
2689  if (r8Data_.contains(adConsnDel_.getLCode()))
2690  r8Data_.value(adConsnDel_.getLCode())->value(0, 0, i, 0) = obs->getCalcConsensusDelay();
2691  if (r8Data_.contains(adConsnRat_.getLCode()))
2692  r8Data_.value(adConsnRat_.getLCode())->value(0, 0, i, 0) = obs->getCalcConsensusRate();
2693  if (r8Data_.contains(adCtSite1_.getLCode()))
2694  r8Data_.value(adCtSite1_.getLCode())->value(0, 0, i, 0) = obs->getFractC();
2695 
2696  // contributions:
2697  if (r8Data_.contains(adEtdCont_.getLCode()))
2698  {
2699  r8Data_.value(adEtdCont_.getLCode())->value(0, 0, i, 0) = obs->getCalcEarthTideDelay();
2700  r8Data_.value(adEtdCont_.getLCode())->value(1, 0, i, 0) = obs->getCalcEarthTideRate();
2701  };
2702  if (r8Data_.contains(adOceCont_.getLCode()))
2703  {
2704  r8Data_.value(adOceCont_.getLCode())->value(0, 0, i, 0) = obs->getCalcOceanTideDelay();
2705  r8Data_.value(adOceCont_.getLCode())->value(1, 0, i, 0) = obs->getCalcOceanTideRate();
2706  };
2707  if (r8Data_.contains(adOceOld_.getLCode()))
2708  {
2709  r8Data_.value(adOceOld_.getLCode())->value(0, 0, i, 0) = obs->getCalcOceanTideOldDelay();
2710  r8Data_.value(adOceOld_.getLCode())->value(1, 0, i, 0) = obs->getCalcOceanTideOldRate();
2711  };
2712  if (r8Data_.contains(adOptlCont_.getLCode()))
2713  {
2714  r8Data_.value(adOptlCont_.getLCode())->value(0, 0, i, 0) = obs->getCalcOceanPoleTideLdDelay();
2715  r8Data_.value(adOptlCont_.getLCode())->value(1, 0, i, 0) = obs->getCalcOceanPoleTideLdRate();
2716  };
2717  if (r8Data_.contains(adPtdCont_.getLCode()))
2718  {
2719  r8Data_.value(adPtdCont_.getLCode())->value(0, 0, i, 0) = obs->getCalcPoleTideDelay();
2720  r8Data_.value(adPtdCont_.getLCode())->value(1, 0, i, 0) = obs->getCalcPoleTideRate();
2721  };
2722  if (r8Data_.contains(adPtoLdCon_.getLCode()))
2723  {
2724  r8Data_.value(adPtoLdCon_.getLCode())->value(0, 0, i, 0) = obs->getCalcPoleTideOldDelay();
2725  r8Data_.value(adPtoLdCon_.getLCode())->value(1, 0, i, 0) = obs->getCalcPoleTideOldRate();
2726  };
2727  if (r8Data_.contains(adTiltRmvr_.getLCode()))
2728  {
2729  r8Data_.value(adTiltRmvr_.getLCode())->value(0, 0, i, 0) = obs->getCalcTiltRemvrDelay();
2730  r8Data_.value(adTiltRmvr_.getLCode())->value(1, 0, i, 0) = obs->getCalcTiltRemvrRate();
2731  };
2732  if (r8Data_.contains(adUt1Ortho_.getLCode()))
2733  {
2734  r8Data_.value(adUt1Ortho_.getLCode())->value(0, 0, i, 0) = obs->getCalcHiFyUt1Delay();
2735  r8Data_.value(adUt1Ortho_.getLCode())->value(1, 0, i, 0) = obs->getCalcHiFyUt1Rate();
2736  };
2737  if (r8Data_.contains(adWobOrtho_.getLCode()))
2738  {
2739  r8Data_.value(adWobOrtho_.getLCode())->value(0, 0, i, 0) = obs->getCalcHiFyPxyDelay();
2740  r8Data_.value(adWobOrtho_.getLCode())->value(1, 0, i, 0) = obs->getCalcHiFyPxyRate();
2741  };
2742  if (r8Data_.contains(adUt1Libra_.getLCode()))
2743  {
2744  r8Data_.value(adUt1Libra_.getLCode())->value(0, 0, i, 0) = obs->getCalcHiFyUt1LibrationDelay();
2745  r8Data_.value(adUt1Libra_.getLCode())->value(1, 0, i, 0) = obs->getCalcHiFyUt1LibrationRate();
2746  };
2747  if (r8Data_.contains(adWobLibra_.getLCode()))
2748  {
2749  r8Data_.value(adWobLibra_.getLCode())->value(0, 0, i, 0) = obs->getCalcHiFyPxyLibrationDelay();
2750  r8Data_.value(adWobLibra_.getLCode())->value(1, 0, i, 0) = obs->getCalcHiFyPxyLibrationRate();
2751  };
2752  if (r8Data_.contains(adWobXcont_.getLCode()))
2753  {
2754  r8Data_.value(adWobXcont_.getLCode())->value(0, 0, i, 0) = obs->getCalcPxDelay();
2755  r8Data_.value(adWobXcont_.getLCode())->value(1, 0, i, 0) = obs->getCalcPxRate();
2756  };
2757  if (r8Data_.contains(adWobYcont_.getLCode()))
2758  {
2759  r8Data_.value(adWobYcont_.getLCode())->value(0, 0, i, 0) = obs->getCalcPyDelay();
2760  r8Data_.value(adWobYcont_.getLCode())->value(1, 0, i, 0) = obs->getCalcPyRate();
2761  };
2762  if (r8Data_.contains(adConCont_.getLCode()))
2763  {
2764  r8Data_.value(adConCont_.getLCode())->value(0, 0, i, 0) = obs->getCalcConsBendingDelay();
2765  r8Data_.value(adConCont_.getLCode())->value(1, 0, i, 0) = obs->getCalcConsBendingRate();
2766  };
2767  if (r8Data_.contains(adSunCont_.getLCode()))
2768  {
2769  r8Data_.value(adSunCont_.getLCode())->value(0, 0, i, 0) = obs->getCalcConsBendingSunDelay();
2770  r8Data_.value(adSunCont_.getLCode())->value(1, 0, i, 0) = obs->getCalcConsBendingSunRate();
2771  };
2772  if (r8Data_.contains(adSun2cont_.getLCode()))
2773  {
2774  r8Data_.value(adSun2cont_.getLCode())->value(0, 0, i, 0) = obs->getCalcConsBendingSunHigherDelay();
2775  r8Data_.value(adSun2cont_.getLCode())->value(1, 0, i, 0) = obs->getCalcConsBendingSunHigherRate();
2776  }
2777  if (r8Data_.contains(adPlx1pSec_.getLCode()))
2778  {
2779  r8Data_.value(adPlx1pSec_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dParallaxRev();
2780  r8Data_.value(adPlx1pSec_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dParallaxRev();
2781  };
2782 
2783 
2784  if (r8Data_.contains(adBendPart_.getLCode()))
2785  {
2786  r8Data_.value(adBendPart_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dBend();
2787  r8Data_.value(adBendPart_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dBend();
2788  };
2789  if (r8Data_.contains(adWobPart_.getLCode()))
2790  {
2791  r8Data_.value(adWobPart_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dPx();
2792  r8Data_.value(adWobPart_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dPx();
2793  r8Data_.value(adWobPart_.getLCode())->value(0, 1, i, 0) = obs->getDdel_dPy();
2794  r8Data_.value(adWobPart_.getLCode())->value(1, 1, i, 0) = obs->getDrat_dPy();
2795  };
2796  if (r8Data_.contains(adUt1Part_.getLCode()))
2797  {
2798  r8Data_.value(adUt1Part_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dUT1()/86400.0;
2799  r8Data_.value(adUt1Part_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dUT1()/86400.0;
2800  r8Data_.value(adUt1Part_.getLCode())->value(0, 1, i, 0) = obs->getD2del_dUT12();
2801  r8Data_.value(adUt1Part_.getLCode())->value(1, 1, i, 0) = obs->getD2rat_dUT12();
2802  };
2803  if (r8Data_.contains(adConsPart_.getLCode()))
2804  {
2805  r8Data_.value(adConsPart_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dGamma();
2806  r8Data_.value(adConsPart_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dGamma();
2807  };
2808  if (r8Data_.contains(adNut06Xyp_.getLCode()))
2809  {
2810  r8Data_.value(adNut06Xyp_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dCipX();
2811  r8Data_.value(adNut06Xyp_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dCipX();
2812  r8Data_.value(adNut06Xyp_.getLCode())->value(0, 1, i, 0) = obs->getDdel_dCipY();
2813  r8Data_.value(adNut06Xyp_.getLCode())->value(1, 1, i, 0) = obs->getDrat_dCipY();
2814  };
2815  if (r8Data_.contains(adPlxPart_.getLCode()))
2816  {
2817  r8Data_.value(adPlxPart_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dParallax();
2818  r8Data_.value(adPlxPart_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dParallax();
2819  };
2820  if (r8Data_.contains(adPtdXyPar_.getLCode()))
2821  {
2822  r8Data_.value(adPtdXyPar_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dPolTideX();
2823  r8Data_.value(adPtdXyPar_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dPolTideX();
2824  r8Data_.value(adPtdXyPar_.getLCode())->value(0, 1, i, 0) = obs->getDdel_dPolTideY();
2825  r8Data_.value(adPtdXyPar_.getLCode())->value(1, 1, i, 0) = obs->getDrat_dPolTideY();
2826  };
2827  if (r8Data_.contains(adStrPart_.getLCode()))
2828  {
2829  r8Data_.value(adStrPart_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dRA();
2830  r8Data_.value(adStrPart_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dRA();
2831  r8Data_.value(adStrPart_.getLCode())->value(0, 1, i, 0) = obs->getDdel_dDN();
2832  r8Data_.value(adStrPart_.getLCode())->value(1, 1, i, 0) = obs->getDrat_dDN();
2833  };
2834  if (r8Data_.contains(adSitPart_.getLCode()))
2835  {
2836  r8Data_.value(adSitPart_.getLCode())->value(0, 0, i, 0) = obs->getDdel_dR_1().at(X_AXIS);
2837  r8Data_.value(adSitPart_.getLCode())->value(0, 1, i, 0) = obs->getDdel_dR_1().at(Y_AXIS);
2838  r8Data_.value(adSitPart_.getLCode())->value(0, 2, i, 0) = obs->getDdel_dR_1().at(Z_AXIS);
2839  r8Data_.value(adSitPart_.getLCode())->value(1, 0, i, 0) = obs->getDrat_dR_1().at(X_AXIS);
2840  r8Data_.value(adSitPart_.getLCode())->value(1, 1, i, 0) = obs->getDrat_dR_1().at(Y_AXIS);
2841  r8Data_.value(adSitPart_.getLCode())->value(1, 2, i, 0) = obs->getDrat_dR_1().at(Z_AXIS);
2842  };
2843  //
2844  if (!epochByScanId.contains(obs->getScanId())) // new scan:
2845  {
2846  SgAgvDatum<double> *p;
2847  const Sg3dVector *r;
2848  epochByScanId.insert(obs->getScanId(), *obs);
2849  //
2850  if (r8Data_.contains(adSunData_.getLCode()) && (p=r8Data_.value(adSunData_.getLCode())))
2851  {
2852  r = &obs->getRsun();
2853  p->value(0, 0, scanIdx, 0) = r->at(X_AXIS);
2854  p->value(0, 1, scanIdx, 0) = r->at(Y_AXIS);
2855  p->value(0, 2, scanIdx, 0) = r->at(Z_AXIS);
2856  r = &obs->getVsun();
2857  p->value(1, 0, scanIdx, 0) = r->at(X_AXIS);
2858  p->value(1, 1, scanIdx, 0) = r->at(Y_AXIS);
2859  p->value(1, 2, scanIdx, 0) = r->at(Z_AXIS);
2860  };
2861  //
2862  if (r8Data_.contains(adMunData_.getLCode()) && (p=r8Data_.value(adMunData_.getLCode())))
2863  {
2864  r = &obs->getRmoon();
2865  p->value(0, 0, scanIdx, 0) = r->at(X_AXIS);
2866  p->value(0, 1, scanIdx, 0) = r->at(Y_AXIS);
2867  p->value(0, 2, scanIdx, 0) = r->at(Z_AXIS);
2868  r = &obs->getVmoon();
2869  p->value(1, 0, scanIdx, 0) = r->at(X_AXIS);
2870  p->value(1, 1, scanIdx, 0) = r->at(Y_AXIS);
2871  p->value(1, 2, scanIdx, 0) = r->at(Z_AXIS);
2872  };
2873  //
2874  if (r8Data_.contains(adEarthCe_.getLCode()) && (p=r8Data_.value(adEarthCe_.getLCode())))
2875  {
2876  r = &obs->getRearth();
2877  p->value(0, 0, scanIdx, 0) = r->at(X_AXIS);
2878  p->value(0, 1, scanIdx, 0) = r->at(Y_AXIS);
2879  p->value(0, 2, scanIdx, 0) = r->at(Z_AXIS);
2880  r = &obs->getVearth();
2881  p->value(1, 0, scanIdx, 0) = r->at(X_AXIS);
2882  p->value(1, 1, scanIdx, 0) = r->at(Y_AXIS);
2883  p->value(1, 2, scanIdx, 0) = r->at(Z_AXIS);
2884  r = &obs->getAearth();
2885  p->value(2, 0, scanIdx, 0) = r->at(X_AXIS);
2886  p->value(2, 1, scanIdx, 0) = r->at(Y_AXIS);
2887  p->value(2, 2, scanIdx, 0) = r->at(Z_AXIS);
2888  };
2889  //
2890  if (r8Data_.contains(adNutWahr_.getLCode()) && (p=r8Data_.value(adNutWahr_.getLCode())))
2891  {
2892  p->value(0, 0, scanIdx, 0) = obs->getCalcNutWahr_dPsiV();
2893  p->value(1, 0, scanIdx, 0) = obs->getCalcNutWahr_dEpsV();
2894  p->value(0, 1, scanIdx, 0) = obs->getCalcNutWahr_dPsiR();
2895  p->value(1, 1, scanIdx, 0) = obs->getCalcNutWahr_dEpsR();
2896  };
2897  if (r8Data_.contains(adNut2006a_.getLCode()) && (p=r8Data_.value(adNut2006a_.getLCode())))
2898  {
2899  p->value(0, 0, scanIdx, 0) = obs->getCalcNut2006_dPsiV();
2900  p->value(1, 0, scanIdx, 0) = obs->getCalcNut2006_dEpsV();
2901  p->value(0, 1, scanIdx, 0) = obs->getCalcNut2006_dPsiR();
2902  p->value(1, 1, scanIdx, 0) = obs->getCalcNut2006_dEpsR();
2903  };
2904  if (r8Data_.contains(adNut06xys_.getLCode()) && (p=r8Data_.value(adNut06xys_.getLCode())))
2905  {
2906  p->value(0, 0, scanIdx, 0) = obs->getCalcCipXv();
2907  p->value(1, 0, scanIdx, 0) = obs->getCalcCipYv();
2908  p->value(2, 0, scanIdx, 0) = obs->getCalcCipSv();
2909 
2910  p->value(0, 1, scanIdx, 0) = obs->getCalcCipXr();
2911  p->value(1, 1, scanIdx, 0) = obs->getCalcCipYr();
2912  p->value(2, 1, scanIdx, 0) = obs->getCalcCipSr();
2913  };
2914 
2915  if (r8Data_.contains(adCf2J2k_0_.getLCode()) && (p=r8Data_.value(adCf2J2k_0_.getLCode())))
2916  for (int k=0; k<3; k++)
2917  for (int l=0; l<3; l++)
2918  p->value(k, l, scanIdx, 0) = obs->getTrf2crfVal().at((DIRECTION)k, (DIRECTION)l);
2919  if (r8Data_.contains(adCf2J2k_1_.getLCode()) && (p=r8Data_.value(adCf2J2k_1_.getLCode())))
2920  for (int k=0; k<3; k++)
2921  for (int l=0; l<3; l++)
2922  p->value(k, l, scanIdx, 0) = obs->getTrf2crfRat().at((DIRECTION)k, (DIRECTION)l);
2923  if (r8Data_.contains(adCf2J2k_2_.getLCode()) && (p=r8Data_.value(adCf2J2k_2_.getLCode())))
2924  for (int k=0; k<3; k++)
2925  for (int l=0; l<3; l++)
2926  p->value(k, l, scanIdx, 0) = obs->getTrf2crfAcc().at((DIRECTION)k, (DIRECTION)l);
2927 
2928  if (r8Data_.contains(adUt1_tai_.getLCode()) && (p=r8Data_.value(adUt1_tai_.getLCode())))
2929  p->value(0, 0, scanIdx, 0) = obs->getCalcUt1_Tai();
2930  if (r8Data_.contains(adPolarXy_.getLCode()) && (p=r8Data_.value(adPolarXy_.getLCode())))
2931  {
2932  p->value(0, 0, scanIdx, 0) = obs->getCalcPmX();
2933  p->value(1, 0, scanIdx, 0) = obs->getCalcPmY();
2934  };
2935 
2936  scanIdx++;
2937  };
2938 // ---------------> eoc
2939  };
2940 
2941  epochByScanId.clear();
2942 };
2943 
2944 
2945 
2946 //
2948 {
2949  // per stn:
2950  QString str("");
2951  int stnIdx;
2952  SgAgvDatum<double> *p;
2953  //
2954  //
2955  stnIdx = 0;
2956  for (QMap<QString, int>::iterator it=stnIdxByKey_.begin(); it!=stnIdxByKey_.end(); ++it, stnIdx++)
2957  {
2958  SgVlbiStationInfo *stn=session_->stationsByName().value(it.key());
2959  if (stn)
2960  {
2961  int obsIdx;
2962  obsIdx = 0;
2963  for (QMap<QString, SgVlbiAuxObservation*>::iterator jt=stn->auxObservationByScanId()->begin();
2964  jt!=stn->auxObservationByScanId()->end(); ++jt, obsIdx++)
2965  {
2966  SgVlbiAuxObservation *auxObs=jt.value();
2967  if (r8Data_.contains(adAirTemp_.getLCode()))
2968  r8Data_.value(adAirTemp_.getLCode())->value(0, 0, obsIdx, stnIdx) =
2969  auxObs->meteoData().getTemperature() + 273.15;
2970  if (r8Data_.contains(adAirPress_.getLCode()))
2971  r8Data_.value(adAirPress_.getLCode())->value(0, 0, obsIdx, stnIdx) =
2972  auxObs->meteoData().getPressure()*100.0;
2973  if (r8Data_.contains(adRelHumd_.getLCode()))
2974  r8Data_.value(adRelHumd_.getLCode())->value(0, 0, obsIdx, stnIdx) =
2975  auxObs->meteoData().getRelativeHumidity();
2976 
2977  if (r8Data_.contains(adCableDel_.getLCode()))
2978  r8Data_.value(adCableDel_.getLCode())->value(0, 0, obsIdx, stnIdx) =
2979  auxObs->getCableCalibration();
2980 
2981  //4CALC:
2982  if (r8Data_.contains(adElTheo_.getLCode()) && (p=r8Data_.value(adElTheo_.getLCode())))
2983  {
2984  p->value(0, 0, obsIdx, stnIdx) = auxObs->getElevationAngle();
2985  p->value(1, 0, obsIdx, stnIdx) = auxObs->getElevationAngleRate();
2986  };
2987  if (r8Data_.contains(adAzTheo_.getLCode()) && (p=r8Data_.value(adAzTheo_.getLCode())))
2988  {
2989  p->value(0, 0, obsIdx, stnIdx) = auxObs->getAzimuthAngle();
2990  p->value(1, 0, obsIdx, stnIdx) = auxObs->getAzimuthAngleRate();
2991  };
2992  if (r8Data_.contains(adAxoCont_.getLCode()) && (p=r8Data_.value(adAxoCont_.getLCode())))
2993  {
2994  p->value(0, 0, obsIdx, stnIdx) = auxObs->getCalcAxisOffset4Delay();
2995  p->value(1, 0, obsIdx, stnIdx) = auxObs->getCalcAxisOffset4Rate();
2996  };
2997  if (r8Data_.contains(adNdryCont_.getLCode()) && (p=r8Data_.value(adNdryCont_.getLCode())))
2998  {
2999  p->value(0, 0, obsIdx, stnIdx) = auxObs->getCalcNdryCont4Delay();
3000  p->value(1, 0, obsIdx, stnIdx) = auxObs->getCalcNdryCont4Rate();
3001  };
3002  if (r8Data_.contains(adNwetCont_.getLCode()) && (p=r8Data_.value(adNwetCont_.getLCode())))
3003  {
3004  p->value(0, 0, obsIdx, stnIdx) = auxObs->getCalcNwetCont4Delay();
3005  p->value(1, 0, obsIdx, stnIdx) = auxObs->getCalcNwetCont4Rate();
3006  };
3007  if (r8Data_.contains(adOceVert_.getLCode()) && (p=r8Data_.value(adOceVert_.getLCode())))
3008  {
3009  p->value(0, 0, obsIdx, stnIdx) = auxObs->getCalcOLoadVert4Delay();
3010  p->value(1, 0, obsIdx, stnIdx) = auxObs->getCalcOLoadVert4Rate();
3011  };
3012  if (r8Data_.contains(adOceHorz_.getLCode()) && (p=r8Data_.value(adOceHorz_.getLCode())))
3013  {
3014  p->value(0, 0, obsIdx, stnIdx) = auxObs->getCalcOLoadHorz4Delay();
3015  p->value(1, 0, obsIdx, stnIdx) = auxObs->getCalcOLoadHorz4Rate();
3016  };
3017  if (r8Data_.contains(adOceDeld_.getLCode()) && (p=r8Data_.value(adOceDeld_.getLCode())))
3018  {
3019  p->value(0, 0, obsIdx, stnIdx) = auxObs->getOcnLdR().at(X_AXIS);
3020  p->value(0, 1, obsIdx, stnIdx) = auxObs->getOcnLdR().at(Y_AXIS);
3021  p->value(0, 2, obsIdx, stnIdx) = auxObs->getOcnLdR().at(Z_AXIS);
3022  p->value(1, 0, obsIdx, stnIdx) = auxObs->getOcnLdV().at(X_AXIS);
3023  p->value(1, 1, obsIdx, stnIdx) = auxObs->getOcnLdV().at(Y_AXIS);
3024  p->value(1, 2, obsIdx, stnIdx) = auxObs->getOcnLdV().at(Z_AXIS);
3025  };
3026  if (r8Data_.contains(adParangle_.getLCode()) && (p=r8Data_.value(adParangle_.getLCode())))
3027  p->value(0, 0, obsIdx, stnIdx) = auxObs->getParallacticAngle();
3028  if (r8Data_.contains(adAxoPart_.getLCode()) && (p=r8Data_.value(adAxoPart_.getLCode())))
3029  {
3030  p->value(0, 0, obsIdx, stnIdx) = auxObs->getDdel_dAxsOfs();
3031  p->value(1, 0, obsIdx, stnIdx) = auxObs->getDrat_dAxsOfs();
3032  };
3033  if (r8Data_.contains(adNgradPar_.getLCode()) && (p=r8Data_.value(adNgradPar_.getLCode())))
3034  {
3035  p->value(0, 0, obsIdx, stnIdx) = auxObs->getDdel_dTzdGrdN();
3036  p->value(0, 1, obsIdx, stnIdx) = auxObs->getDdel_dTzdGrdE();
3037  p->value(1, 0, obsIdx, stnIdx) = auxObs->getDrat_dTzdGrdN();
3038  p->value(1, 1, obsIdx, stnIdx) = auxObs->getDrat_dTzdGrdE();
3039  };
3040  if (r8Data_.contains(adNdryPart_.getLCode()) && (p=r8Data_.value(adNdryPart_.getLCode())))
3041  {
3042  p->value(0, 0, obsIdx, stnIdx) = auxObs->getDdel_dTzdDry();
3043  p->value(1, 0, obsIdx, stnIdx) = auxObs->getDrat_dTzdDry();
3044  };
3045  if (r8Data_.contains(adNwetPart_.getLCode()) && (p=r8Data_.value(adNwetPart_.getLCode())))
3046  {
3047  p->value(0, 0, obsIdx, stnIdx) = auxObs->getDdel_dTzdWet();
3048  p->value(1, 0, obsIdx, stnIdx) = auxObs->getDrat_dTzdWet();
3049  };
3050  // eo4c
3051  };
3052  }
3053  else
3055  "::fillSttnVars(): cannot find a station \"" + it.key() + "\" in the map");
3056  };
3057 };
3058 
3059 
3060 
3061 // ------------------------------ import stuff: ----------------------------------------
3062 //
3063 bool SgAgvDriver::importData(const QString& fileName)
3064 {
3065  QFile f(fileName);
3067 
3068  if (inputIdentities_)
3069  delete inputIdentities_;
3071 // if (inputDriverVersion_)
3072 // delete inputDriverVersion_;
3073 // inputDriverVersion_ = new SgVersion;
3074 
3088 
3089  if (!f.open(QIODevice::ReadOnly))
3090  {
3092  "::importData(): error opening input file: \"" + fileName_ + "\"");
3093  return false;
3094  };
3095  QTextStream ts(&f);
3096 
3097  SgAgvChunk *chunk;
3098  while (!ts.atEnd())
3099  {
3100  append(chunk = new SgAgvChunk(size()));
3101 #ifdef LOCAL_DEBUG
3102  //std::cout << "SgAgvDriver::importData appended chunk #" << chunk->getIdx()
3103  //<< qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
3104  //<< "\n";
3105 #endif
3106  chunk->importData(ts, this);
3107 #ifdef LOCAL_DEBUG
3108  //std::cout << "SgAgvDriver::importData imported chunk #" << chunk->getIdx()
3109  //<< qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
3110  //<< "\n";
3111 #endif
3113  "::importData(): the chunk #" + QString("").setNum(chunk->getIdx()) + " has been read");
3114  };
3115 
3117 
3118 #ifdef LOCAL_DEBUG
3119  //std::cout << " SgAgvDriver::importData init session start"
3120  //<< qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
3121  //<< "\n";
3122 #endif
3123  initSession();
3124 #ifdef LOCAL_DEBUG
3125  //std::cout << " SgAgvDriver::importData init session done"
3126  //<< qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
3127  //<< "\n";
3128 #endif
3129  ts.setDevice(NULL);
3130  f.close();
3131 
3132  return true;
3133 };
3134 
3135 
3136 
3137 //
3139 {
3140  QMap<QString, SgAgvDatumDescriptor*> knownKeyByLcode;
3141 
3142  // check for missed lcodes:
3143  for (int i=0; i<knownKeys_.size(); i++)
3144  {
3145  SgAgvDatumDescriptor *expectedDd=knownKeys_.at(i);
3146  SgAgvDatumDescriptor *actualDd=datumByKey_.value(expectedDd->getLCode());
3147  knownKeyByLcode[expectedDd->getLCode()] = expectedDd;
3148  if (actualDd)
3149  {
3150  if (expectedDd->getDataType() != actualDd->getDataType())
3151  {
3153  "::checkCollectedDescriptors(): the LCode \"" + expectedDd->getLCode() +
3154  "\" have unexpected data type, " +
3156  ", expected: " + SgAgvDatumDescriptor::dataType2str(expectedDd->getDataType()));
3157  actualDd->setIsUsable(false);
3158  };
3159 
3160  if (expectedDd->getDataScope() != actualDd->getDataScope() &&
3161  !expectedDd->getHasMutableScope())
3162  {
3164  "::checkCollectedDescriptors(): the LCode \"" + expectedDd->getLCode() +
3165  "\" have unexpected data scope: " +
3167  " (expected " + SgAgvDatumDescriptor::dataScope2str(expectedDd->getDataScope()) + ")");
3168  actualDd->setIsUsable(false);
3169  };
3170  }
3171  else if (expectedDd->isExpected(getExpectedStyle()))
3173  "::checkCollectedDescriptors(): cannot find LCode \"" + expectedDd->getLCode() + "\"");
3174  };
3175  //
3176  // check for unknown lcodes:
3177  for (QMap<QString, SgAgvDatumDescriptor*>::iterator it=datumByKey_.begin(); it!=datumByKey_.end();
3178  ++it)
3179  {
3180  SgAgvDatumDescriptor *actualDd=it.value();
3181  if (!knownKeyByLcode.contains(actualDd->getLCode()))
3183  "::checkCollectedDescriptors(): got an unknown LCode \"" + actualDd->getLCode() + "\"");
3184  };
3185  knownKeyByLcode.clear();
3186 };
3187 
3188 
3189 
3190 
3191 //
3192 bool SgAgvDriver::strVal(const QString& content,
3193  QString& lCode, int& d1, int& d2, int& d3, int& d4, QString& val)
3194 {
3195  QRegExp re("(.{8})\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(.*)",
3196  Qt::CaseInsensitive);
3197  bool isOk=false;
3198  d1 = d2 = d3 = d4 = 0;
3199  lCode = "";
3200  val = "";
3201  if (re.indexIn(content) != -1)
3202  {
3203  lCode = re.cap(1);
3204  d3 = re.cap(2).toInt(&isOk);
3205  if (isOk)
3206  {
3207  d4 = re.cap(3).toInt(&isOk);
3208  if (isOk)
3209  {
3210  d1 = re.cap(4).toInt(&isOk);
3211  if (isOk)
3212  {
3213  d2 = re.cap(5).toInt(&isOk);
3214  if (isOk)
3215  val = re.cap(6);
3216  };
3217  };
3218  };
3219  }
3220  else
3222  "::strVal(): cannot parse the record \"" + content + "\"");
3223  if (d1 == 0)
3224  d1 = 1;
3225  if (d2 == 0)
3226  d2 = 1;
3227  if (d3 == 0)
3228  d3 = 1;
3229  if (d4 == 0)
3230  d4 = 1;
3231  return isOk;
3232 };
3233 
3234 
3235 
3236 //
3237 bool SgAgvDriver::sintVal(const QString& content,
3238  QString& lCode, int& d1, int& d2, int& d3, int& d4, short int &val)
3239 {
3240  QRegExp re("(.{8})\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+([-+0-9]+)",
3241  Qt::CaseInsensitive);
3242  bool isOk=false;
3243  lCode = "";
3244  d1 = d2 = d3 = d4 = 0;
3245  val = 0;
3246  if (re.indexIn(content) != -1)
3247  {
3248  lCode = re.cap(1);
3249  d3 = re.cap(2).toInt(&isOk);
3250  if (isOk)
3251  {
3252  d4 = re.cap(3).toInt(&isOk);
3253  if (isOk)
3254  {
3255  d1 = re.cap(4).toInt(&isOk);
3256  if (isOk)
3257  {
3258  d2 = re.cap(5).toInt(&isOk);
3259  if (isOk)
3260  val = re.cap(6).toShort(&isOk);
3261  };
3262  };
3263  };
3264  }
3265  else
3267  "::sintVal(): cannot parse the record \"" + content + "\"");
3268  if (d1 == 0)
3269  d1 = 1;
3270  if (d2 == 0)
3271  d2 = 1;
3272  if (d3 == 0)
3273  d3 = 1;
3274  if (d4 == 0)
3275  d4 = 1;
3276  return isOk;
3277 };
3278 
3279 
3280 
3281 //
3282 bool SgAgvDriver::intVal(const QString& content,
3283  QString& lCode, int& d1, int& d2, int& d3, int& d4, int &val)
3284 {
3285  QRegExp re("(.{8})\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+([-+0-9]+)",
3286  Qt::CaseInsensitive);
3287  bool isOk=false;
3288  lCode = "";
3289  d1 = d2 = d3 = d4 = val = 0;
3290  val = 0;
3291  if (re.indexIn(content) != -1)
3292  {
3293  lCode = re.cap(1);
3294  d3 = re.cap(2).toInt(&isOk);
3295  if (isOk)
3296  {
3297  d4 = re.cap(3).toInt(&isOk);
3298  if (isOk)
3299  {
3300  d1 = re.cap(4).toInt(&isOk);
3301  if (isOk)
3302  {
3303  d2 = re.cap(5).toInt(&isOk);
3304  if (isOk)
3305  val = re.cap(6).toInt(&isOk);
3306  };
3307  };
3308  };
3309  }
3310  else
3312  "::intVal(): cannot parse the record \"" + content + "\"");
3313  if (d1 == 0)
3314  d1 = 1;
3315  if (d2 == 0)
3316  d2 = 1;
3317  if (d3 == 0)
3318  d3 = 1;
3319  if (d4 == 0)
3320  d4 = 1;
3321  return isOk;
3322 };
3323 
3324 
3325 
3326 //
3327 bool SgAgvDriver::lintVal(const QString& content,
3328  QString& lCode, int& d1, int& d2, int& d3, int& d4, long int &val)
3329 {
3330  QRegExp re("(.{8})\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+([-+0-9]+)",
3331  Qt::CaseInsensitive);
3332  bool isOk=false;
3333  lCode = "";
3334  d1 = d2 = d3 = d4 = val = 0;
3335  val = 0;
3336  if (re.indexIn(content) != -1)
3337  {
3338  lCode = re.cap(1);
3339  d3 = re.cap(2).toInt(&isOk);
3340  if (isOk)
3341  {
3342  d4 = re.cap(3).toInt(&isOk);
3343  if (isOk)
3344  {
3345  d1 = re.cap(4).toInt(&isOk);
3346  if (isOk)
3347  {
3348  d2 = re.cap(5).toInt(&isOk);
3349  if (isOk)
3350  val = re.cap(6).toLong(&isOk);
3351  };
3352  };
3353  };
3354  }
3355  else
3357  "::lintVal(): cannot parse the record \"" + content + "\"");
3358  if (d1 == 0)
3359  d1 = 1;
3360  if (d2 == 0)
3361  d2 = 1;
3362  if (d3 == 0)
3363  d3 = 1;
3364  if (d4 == 0)
3365  d4 = 1;
3366  return isOk;
3367 };
3368 
3369 
3370 
3371 //
3372 bool SgAgvDriver::floatVal(const QString& content,
3373  QString& lCode, int& d1, int& d2, int& d3, int& d4, float &val)
3374 {
3375  QRegExp re("(.{8})\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+([-+0-9\\.eEdD]+)",
3376  Qt::CaseInsensitive);
3377  bool isOk=false;
3378  d1 = d2 = d3 = d4 = 0;
3379  lCode = "";
3380  val = 0.0;
3381  if (re.indexIn(content) != -1)
3382  {
3383  lCode = re.cap(1);
3384  d3 = re.cap(2).toInt(&isOk);
3385  if (isOk)
3386  {
3387  d4 = re.cap(3).toInt(&isOk);
3388  if (isOk)
3389  {
3390  d1 = re.cap(4).toInt(&isOk);
3391  if (isOk)
3392  {
3393  d2 = re.cap(5).toInt(&isOk);
3394  if (isOk)
3395  val = re.cap(6).toFloat(&isOk);
3396  };
3397  };
3398  };
3399  }
3400  else if (content.contains("NaN", Qt::CaseInsensitive)) // it's ok
3401  {
3402  val = 0.0;
3403  isOk = true;
3404  }
3405  else
3407  "::floatVal(): cannot parse the record \"" + content + "\"");
3408  if (d1 == 0)
3409  d1 = 1;
3410  if (d2 == 0)
3411  d2 = 1;
3412  if (d3 == 0)
3413  d3 = 1;
3414  if (d4 == 0)
3415  d4 = 1;
3416  return isOk;
3417 };
3418 
3419 
3420 
3421 //
3422 bool SgAgvDriver::doubleVal(const QString& content,
3423  QString& lCode, int& d1, int& d2, int& d3, int& d4, double &val)
3424 {
3425  QRegExp re("(.{8})\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+([-+0-9\\.eEdD]+)",
3426  Qt::CaseInsensitive);
3427  bool isOk=false;
3428  d1 = d2 = d3 = d4 = 1;
3429  val = 0.0;
3430  lCode = "";
3431  if (re.indexIn(content) != -1)
3432  {
3433  lCode = re.cap(1);
3434  d3 = re.cap(2).toInt(&isOk);
3435  if (isOk)
3436  {
3437  d4 = re.cap(3).toInt(&isOk);
3438  if (isOk)
3439  {
3440  d1 = re.cap(4).toInt(&isOk);
3441  if (isOk)
3442  {
3443  d2 = re.cap(5).toInt(&isOk);
3444  if (isOk)
3445  {
3446  QString str(re.cap(6));
3447  str.replace("D", "E", Qt::CaseInsensitive);
3448  val = str.toDouble(&isOk);
3449  };
3450  };
3451  };
3452  };
3453  }
3454  else if (content.contains("NaN", Qt::CaseInsensitive)) // it's ok
3455  {
3456  val = 0.0;
3457  isOk = true;
3458  }
3459  else
3461  "::doubleVal(): cannot parse the record \"" + content + "\"");
3462  if (d1 == 0)
3463  d1 = 1;
3464  if (d2 == 0)
3465  d2 = 1;
3466  if (d3 == 0)
3467  d3 = 1;
3468  if (d4 == 0)
3469  d4 = 1;
3470  return isOk;
3471 };
3472 
3473 
3474 
3475 //
3477 {
3478  QString lCode(""), valStr("");
3479  int idx1, idx2, idx3, idx4, val;
3480  if (section)
3481  {
3482  if (section->size() >= 5)
3483  {
3484  // find the mandatory records:
3485  if (datumByKey_.contains(adNobsSta_.getLCode()))
3487  else
3488  {
3490  "::figureOutImplicitDimensions(): the mandatory record \"" + adNobsSta_.getLCode() +
3491  "\" was not found");
3492  return;
3493  };
3494  if (datumByKey_.contains(adNumbObs_.getLCode()))
3496  else
3497  {
3499  "::figureOutImplicitDimensions(): the mandatory record \"" + adNumbObs_.getLCode() +
3500  "\" was not found");
3501  return;
3502  };
3503  if (datumByKey_.contains(adNumbSca_.getLCode()))
3505  else
3506  {
3508  "::figureOutImplicitDimensions(): the mandatory record \"" + adNumbSca_.getLCode() +
3509  "\" was not found");
3510  return;
3511  };
3512  if (datumByKey_.contains(adNumbSta_.getLCode()))
3514  else
3515  {
3517  "::figureOutImplicitDimensions(): the mandatory record \"" + adNumbSta_.getLCode() +
3518  "\" was not found");
3519  return;
3520  };
3521  if (datumByKey_.contains(adObsTab_.getLCode()))
3523  else
3524  {
3526  "::figureOutImplicitDimensions(): the mandatory record \"" + adObsTab_.getLCode() +
3527  "\" was not found");
3528  return;
3529  };
3530  if (datumByKey_.contains(adSiteNames_.getLCode()))
3532  else
3533  {
3535  "::figureOutImplicitDimensions(): the mandatory record \"" + adSiteNames_.getLCode() +
3536  "\" was not found");
3537  return;
3538  };
3539 
3540  bool haveNobsSta, haveNumbObs, haveNumbSca, haveNumbSta, haveSiteNames;
3541  bool haveAll;
3542  haveNobsSta = haveNumbObs = haveNumbSca = haveNumbSta = haveSiteNames = haveAll = false;
3543  QMap<int, int> stnobsByIdx;
3544  QMap<int, QString> stnnameByIdx;
3545 
3546  // check for mandatory records:
3547  for (int i=0; i<section->size() && !haveAll; i++)
3548  {
3549  const QString& str=section->at(i)->content();
3550  const QString& lcd=section->at(i)->lCode();
3551  lCode = "";
3552  idx1 = idx2 = idx3 = idx4 = val = 0;
3553  valStr = "";
3554 
3555  if (lcd != adSiteNames_.getLCode())
3556  {
3557  intVal(str, lCode, idx1, idx2, idx3, idx4, val);
3558  if (val == 0)
3559  {
3561  "::figureOutImplicitDimensions(): the value is 0 for the " + QString("").setNum(i) +
3562  "'s record \"" + str + "\"");
3563  return;
3564  }
3565  }
3566  else
3567  strVal(str, lCode, idx1, idx2, idx3, idx4, valStr);
3568  //
3569  //
3570  // checking in alpabet order, as the records should be:
3571  if (adNobsSta_.getLCode() == lCode)
3572  {
3573  stnobsByIdx[idx1] = val;
3574  if (idx1 == adNobsSta_.getDim1())
3575  haveNobsSta = true;
3576  };
3577 
3578  if (adNumbObs_.getLCode() == lCode)
3579  {
3580  numOfObs_ = val;
3581  haveNumbObs = true;
3582  };
3583  if (adNumbSca_.getLCode() == lCode)
3584  {
3585  numOfScans_ = val;
3586  haveNumbSca = true;
3587  };
3588  if (adNumbSta_.getLCode() == lCode)
3589  {
3590  numOfStn_ = val;
3591  haveNumbSta = true;
3592  };
3593 
3594  if (adSiteNames_.getLCode() == lCode)
3595  {
3596  valStr = valStr.leftJustified(8, ' ');
3597  stnNames_ << valStr;
3598  stnnameByIdx[idx2] = valStr;
3599  if (idx2 == adSiteNames_.getDim2())
3600  haveSiteNames = true;
3601  };
3602  haveAll = haveNobsSta && haveNumbObs && haveNumbSca && haveNumbSta && haveSiteNames;
3603  };
3604  if (haveAll)
3605  {
3606  if (stnobsByIdx.size() == stnnameByIdx.size())
3607  {
3608  maxNumPerStn_ = 0;
3609  for (QMap<int, int>::iterator it=stnobsByIdx.begin(); it!=stnobsByIdx.end(); ++it)
3610  {
3611  numOfObsByStn_[stnnameByIdx[it.key()]] = it.value();
3612  if (maxNumPerStn_ < it.value())
3613  maxNumPerStn_ = it.value();
3614  };
3615  }
3616  else
3618  "::figureOutImplicitDimensions(): sizes of NOBS_STA and SITNAMES mismatch");
3619  }
3620  else
3622  "::figureOutImplicitDimensions(): cannot find all necessary mandatory records");
3623  }
3624  else
3626  "::figureOutImplicitDimensions(): not enough mandatory records, " +
3627  QString("").setNum(section->size()));
3628  }
3629  else
3631  "::figureOutImplicitDimensions(): the section is NULL");
3632 
3633 };
3634 
3635 
3636 
3637 //
3639 {
3640  QString lCode("");
3641  int idx1, idx2, idx3, idx4;
3642  if (!section)
3643  {
3645  "::digestData(): the section is NULL");
3646  return;
3647  };
3648  if (section->size() <= 5)
3649  {
3651  "::digestData(): not enough records to get data: " + QString("").setNum(section->size()));
3652  return;
3653  };
3654  //
3655  for (int i=0; i<section->size(); i++)
3656  {
3657  QString sVal("");
3658  short int siVal=0;
3659  int iVal=0;
3660  long int liVal=0;
3661  float fVal=0.0;
3662  double dVal=0.0;
3663  const QString& str=section->at(i)->content();
3664  const QString& lcd=section->at(i)->lCode();
3665  lCode = "";
3666  idx1 = idx2 = idx3 = idx4 = 0;
3667  SgAgvDatumDescriptor *dd=NULL;
3668  if (datumByKey_.contains(lcd))
3669  {
3670  dd = datumByKey_.value(lcd);
3671  switch (dd->getDataType())
3672  {
3673  case ADT_CHAR:
3674  if (c1Data_.contains(dd->getLCode()))
3675  {
3676  if (strVal(str, lCode, idx1, idx2, idx3, idx4, sVal))
3677  c1Data_.value(dd->getLCode())->value(idx2-1, idx3-1, idx4-1) = sVal;
3678  }
3679  else
3681  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3682  "\" is not in C1 map");
3683  break;
3684  case ADT_I2:
3685  if (i2Data_.contains(dd->getLCode()))
3686  {
3687  if (sintVal(str, lCode, idx1, idx2, idx3, idx4, siVal))
3688  i2Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = siVal;
3689  }
3690  else
3692  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3693  "\" is not in I2 map");
3694  break;
3695  case ADT_I4:
3696  if (i4Data_.contains(dd->getLCode()))
3697  {
3698  if (intVal(str, lCode, idx1, idx2, idx3, idx4, iVal))
3699  i4Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = iVal;
3700  }
3701  else
3703  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3704  "\" is not in I4 map");
3705  break;
3706  case ADT_I8:
3707  if (i8Data_.contains(dd->getLCode()))
3708  {
3709  if (lintVal(str, lCode, idx1, idx2, idx3, idx4, liVal))
3710  i8Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = liVal;
3711  }
3712  else
3714  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3715  "\" is not in I8 map");
3716  break;
3717  case ADT_R4:
3718  if (r4Data_.contains(dd->getLCode()))
3719  {
3720  if (floatVal(str, lCode, idx1, idx2, idx3, idx4, fVal))
3721  r4Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = fVal;
3722  }
3723  else
3725  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3726  "\" is not in R4 map");
3727  break;
3728  case ADT_R8:
3729  if (r8Data_.contains(dd->getLCode()))
3730  {
3731  if (doubleVal(str, lCode, idx1, idx2, idx3, idx4, dVal))
3732  r8Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = dVal;
3733  }
3734  else
3736  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3737  "\" is not in R8 map");
3738  break;
3739  case ADT_NONE:
3740  default:
3742  "::digestData(): got an unknown datum descriptor with the lCode \"" +
3743  dd->getLCode() + "\"");
3744  break;
3745  };
3746  }
3747  else
3748  {
3750  "::digestData(): cannot find lCode \"" + lcd + "\" in the map");
3751  return;
3752  };
3753  };
3754  //
3755  if (datumByKey_.contains(adBandNames_.getLCode()))
3756  numOfBands_ = datumByKey_.value(adBandNames_.getLCode())->d2();
3757  else
3759  "::digestData(): cannot figure out a number of bands");
3760 
3761 #ifdef LOCAL_DEBUG
3762 /*
3763 std::cout << " ++ Colllected " << c1Data_.size() << " elements of String:\n";
3764 for (QMap<QString, SgAgvDatumString*>::iterator it=c1Data_.begin(); it!=c1Data_.end(); ++it)
3765 {
3766  SgAgvDatumDescriptor *dd=NULL;
3767  if (datumByKey_.contains(it.key()))
3768  {
3769  dd = datumByKey_.value(it.key());
3770  for (int i=0; i<dd->d2(); i++)
3771  for (int j=0; j<dd->d3(); j++)
3772  for (int k=0; k<dd->d4(); k++)
3773 std::cout << " ++ " << qPrintable(dd->getLCode()) << "[" << i << "][" << j << "][" << k << "]: " <<
3774 " \"" << qPrintable(it.value()->value(i, j, k)) << "\"\n";
3775  };
3776 
3777 };
3778 */
3779 /*
3780 std::cout << " ++ Colllected " << i2Data_.size() << " elements of short:\n";
3781 for (QMap<QString, SgAgvDatum<short int>*>::iterator it=i2Data_.begin(); it!=i2Data_.end(); ++it)
3782 {
3783  SgAgvDatumDescriptor *dd=NULL;
3784  if (datumByKey_.contains(it.key()))
3785  {
3786  dd = datumByKey_.value(it.key());
3787  for (int i=0; i<dd->d1(); i++)
3788  for (int j=0; j<dd->d2(); j++)
3789  for (int k=0; k<dd->d3(); k++)
3790  for (int l=0; l<dd->d4(); l++)
3791 std::cout << " ++ " << qPrintable(dd->getLCode()) << "[" << i << "][" << j << "][" << k << "][" << l << "]:= "
3792 << it.value()->value(i, j, k, l) << "\n";
3793  };
3794 };
3795 */
3796 #endif
3797 };
3798 
3799 
3800 
3801 //
3803 {
3804  int idx1, idx2, idx3, idx4;
3805  if (!section)
3806  {
3808  "::digestData(): the section is NULL");
3809  return;
3810  };
3811  if (section->size() <= 5)
3812  {
3814  "::digestData(): not enough records to get data: " + QString("").setNum(section->size()));
3815  return;
3816  };
3817  //
3818  for (int i=0; i<section->size(); i++)
3819  {
3820  QString sVal("");
3821  short int siVal=0;
3822  int iVal=0;
3823  long int liVal=0;
3824  float fVal=0.0;
3825  double dVal=0.0;
3826  const QString& str=section->at(i)->content().mid(9);
3827  const QString& lcd=section->at(i)->lCode();
3828  idx1 = idx2 = idx3 = idx4 = 0;
3829 //
3830 // ------------------ check timing here:
3831 //
3832  SgAgvDatumDescriptor *dd=NULL;
3833  if (datumByKey_.contains(lcd))
3834  {
3835  dd = datumByKey_.value(lcd);
3836  switch (dd->getDataType())
3837  {
3838  case ADT_CHAR:
3839  if (c1Data_.contains(dd->getLCode()))
3840  {
3841  if (strValNoRegEx(str, idx1, idx2, idx3, idx4, sVal))
3842  c1Data_.value(dd->getLCode())->value(idx2-1, idx3-1, idx4-1) = sVal;
3843  }
3844  else
3846  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3847  "\" is not in C1 map");
3848  break;
3849  case ADT_I2:
3850  if (i2Data_.contains(dd->getLCode()))
3851  {
3852  if (sintValNoRegEx(str, idx1, idx2, idx3, idx4, siVal))
3853  i2Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = siVal;
3854  }
3855  else
3857  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3858  "\" is not in I2 map");
3859  break;
3860  case ADT_I4:
3861  if (i4Data_.contains(dd->getLCode()))
3862  {
3863  if (intValNoRegEx(str, idx1, idx2, idx3, idx4, iVal))
3864  i4Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = iVal;
3865  }
3866  else
3868  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3869  "\" is not in I4 map");
3870  break;
3871  case ADT_I8:
3872  if (i8Data_.contains(dd->getLCode()))
3873  {
3874  if (lintValNoRegEx(str, idx1, idx2, idx3, idx4, liVal))
3875  i8Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = liVal;
3876  }
3877  else
3879  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3880  "\" is not in I8 map");
3881  break;
3882  case ADT_R4:
3883  if (r4Data_.contains(dd->getLCode()))
3884  {
3885  if (floatValNoRegEx(str, idx1, idx2, idx3, idx4, fVal))
3886  r4Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = fVal;
3887  }
3888  else
3890  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3891  "\" is not in R4 map");
3892  break;
3893  case ADT_R8:
3894  if (r8Data_.contains(dd->getLCode()))
3895  {
3896  if (doubleValNoRegEx(str, idx1, idx2, idx3, idx4, dVal))
3897  r8Data_.value(dd->getLCode())->value(idx1-1, idx2-1, idx3-1, idx4-1) = dVal;
3898  }
3899  else
3901  "::digestData(): the datum descriptor with the lCode \"" + dd->getLCode() +
3902  "\" is not in R8 map");
3903  break;
3904  case ADT_NONE:
3905  default:
3907  "::digestData(): got an unknown datum descriptor with the lCode \"" +
3908  dd->getLCode() + "\"");
3909  break;
3910  };
3911  }
3912  else
3913  {
3915  "::digestData(): cannot find lCode \"" + lcd + "\" in the map");
3916  return;
3917  };
3918  };
3919  //
3920  if (datumByKey_.contains(adBandNames_.getLCode()))
3921  numOfBands_ = datumByKey_.value(adBandNames_.getLCode())->d2();
3922  else
3924  "::digestData(): cannot figure out a number of bands");
3925 };
3926 
3927 
3928 
3929 //
3930 bool SgAgvDriver::getContentIdxs(const QString& str, int& i1, int& i2, int& i3, int& i4)
3931 {
3932  int i, strLength;
3933  i = i1 = i2 = i3 = i4 = 0;
3934  strLength = str.size();
3935  while (i<strLength && (i1==0 || i2==0 || i3==0 || i4==0))
3936  {
3937  if (i1==0 && str.at(i)==' ')
3938  {
3939  i1 = i;
3940  while (i<strLength && str.at(i)==' ')
3941  i++;
3942  }
3943  else if (i2==0 && str.at(i)==' ')
3944  {
3945  i2 = i;
3946  while (i<strLength && str.at(i)==' ')
3947  i++;
3948  }
3949  else if (i3==0 && str.at(i)==' ')
3950  {
3951  i3 = i;
3952  while (i<strLength && str.at(i)==' ')
3953  i++;
3954  }
3955  else if (i4==0 && str.at(i)==' ')
3956  i4 = i;
3957  i++;
3958  };
3959  return !( i1==0 || i2==0 || i3==0 || i4==0 ||
3960  i1==i2 || i1==i3 || i1==i4 || i2==i3 || i2==i4 || i3==i4 ||
3961  strLength <= i4-1);
3962 };
3963 
3964 
3965 
3966 //
3967 bool SgAgvDriver::strValNoRegEx(const QString& content, int& d1, int& d2, int& d3, int& d4, QString& val)
3968 {
3969  int i1, i2, i3, i4;
3970  bool isOk=false;
3971  int strLength=content.size();
3972  char buff[2048];
3973  if (strLength < 9)
3974  {
3976  "::strVal(): the string is too short: \"" + content + "\"");
3977  return isOk;
3978  };
3979  d1 = d2 = d3 = d4 = 0;
3980  val = "";
3981  if (!getContentIdxs(content, i1, i2, i3, i4))
3982  {
3984  "::strVal(): cannot parse the string \"" + content + "\": " +
3985  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
3986  return isOk;
3987  };
3988  if (!true)
3989  {
3990  if ((i1 = sscanf(qPrintable(content), "%d %d %d %d %s", &d3, &d4, &d1, &d2, buff)) == 5)
3991  {
3992  isOk = true;
3993  val = QString(buff);
3994  }
3995  else
3997  "::strVal(): cannot sscan the string \"" + content + "\", retCode= " +
3998  QString("").setNum(i1));
3999  }
4000  else
4001  {
4002  d3 = content.mid(0, i1).toInt(&isOk);
4003  if (isOk)
4004  {
4005  d4 = content.mid(i1, i2-i1).toInt(&isOk);
4006  if (isOk)
4007  {
4008  d1 = content.mid(i2, i3-i2).toInt(&isOk);
4009  if (isOk)
4010  {
4011  d2 = content.mid(i3, i4-i3).toInt(&isOk);
4012  if (isOk)
4013  val = content.mid(i4).simplified();
4014  else
4016  "::strVal(): cannot parse the 2nd idx; content: \"" + content + "\"");
4017  }
4018  else
4020  "::strVal(): cannot parse the 1st idx; content: \"" + content + "\"");
4021  }
4022  else
4024  "::strVal(): cannot parse the 4th idx; content: \"" + content + "\"");
4025  }
4026  else
4028  "::strVal(): cannot parse the 3rd idx; content: \"" + content + "\"");
4029  };
4030  if (d1 == 0)
4031  d1 = 1;
4032  if (d2 == 0)
4033  d2 = 1;
4034  if (d3 == 0)
4035  d3 = 1;
4036  if (d4 == 0)
4037  d4 = 1;
4038 
4039  return isOk;
4040 };
4041 
4042 
4043 
4044 //
4045 bool SgAgvDriver::sintValNoRegEx(const QString& content,
4046  int& d1, int& d2, int& d3, int& d4, short int &val)
4047 {
4048  int i1, i2, i3, i4;
4049  bool isOk=false;
4050  int strLength=content.size();
4051  if (strLength < 9)
4052  {
4054  "::sintVal(): the string is too short: \"" + content + "\"");
4055  return isOk;
4056  };
4057  d1 = d2 = d3 = d4 = 0;
4058  val = 0;
4059  if (!getContentIdxs(content, i1, i2, i3, i4))
4060  {
4062  "::sintVal(): cannot parse the string \"" + content + "\": " +
4063  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4064  return isOk;
4065  };
4066  if (true)
4067  {
4068  if ((i1 = sscanf(qPrintable(content), "%d %d %d %d %hd", &d3, &d4, &d1, &d2, &val)) == 5)
4069  isOk = true;
4070  else
4072  "::sintVal(): cannot sscan the string \"" + content + "\", retCode= " +
4073  QString("").setNum(i1));
4074  }
4075  else
4076  {
4077  d3 = content.mid(0, i1).toInt(&isOk);
4078  if (isOk)
4079  {
4080  d4 = content.mid(i1, i2-i1).toInt(&isOk);
4081  if (isOk)
4082  {
4083  d1 = content.mid(i2, i3-i2).toInt(&isOk);
4084  if (isOk)
4085  {
4086  d2 = content.mid(i3, i4-i3).toInt(&isOk);
4087  if (isOk)
4088  {
4089  val = content.mid(i4).toShort(&isOk);
4090  if (!isOk)
4092  "::sintVal(): cannot parse the value; content: \"" + content + "\"");
4093  }
4094  else
4096  "::sintVal(): cannot parse the 2nd idx; content: \"" + content + "\"");
4097  }
4098  else
4100  "::sintVal(): cannot parse the 1st idx; content: \"" + content + "\"");
4101  }
4102  else
4104  "::sintVal(): cannot parse the 4th idx; content: \"" + content + "\"");
4105  }
4106  else
4108  "::sintVal(): cannot parse the 3rd idx; content: \"" + content + "\"");
4109  };
4110  if (d1 == 0)
4111  d1 = 1;
4112  if (d2 == 0)
4113  d2 = 1;
4114  if (d3 == 0)
4115  d3 = 1;
4116  if (d4 == 0)
4117  d4 = 1;
4118 
4119  return isOk;
4120 };
4121 
4122 
4123 
4124 //
4125 bool SgAgvDriver::intValNoRegEx(const QString& content,
4126  int& d1, int& d2, int& d3, int& d4, int &val)
4127 {
4128  int i1, i2, i3, i4;
4129  bool isOk=false;
4130  int strLength=content.size();
4131  if (strLength < 9)
4132  {
4134  "::intVal(): the string is too short: \"" + content + "\"");
4135  return isOk;
4136  };
4137  d1 = d2 = d3 = d4 = 0;
4138  val = 0;
4139  if (!getContentIdxs(content, i1, i2, i3, i4))
4140  {
4142  "::intVal(): cannot parse the string \"" + content + "\": " +
4143  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4144  return isOk;
4145  };
4146  if (!getContentIdxs(content, i1, i2, i3, i4))
4147  {
4149  "::intVal(): cannot parse the string \"" + content + "\": " +
4150  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4151  return isOk;
4152  };
4153  if (true)
4154  {
4155  if ((i1 = sscanf(qPrintable(content), "%d %d %d %d %d", &d3, &d4, &d1, &d2, &val)) == 5)
4156  isOk = true;
4157  else
4159  "::intVal(): cannot sscan the string \"" + content + "\", retCode= " +
4160  QString("").setNum(i1));
4161  }
4162  else
4163  {
4164  d3 = content.mid(0, i1).toInt(&isOk);
4165  if (isOk)
4166  {
4167  d4 = content.mid(i1, i2-i1).toInt(&isOk);
4168  if (isOk)
4169  {
4170  d1 = content.mid(i2, i3-i2).toInt(&isOk);
4171  if (isOk)
4172  {
4173  d2 = content.mid(i3, i4-i3).toInt(&isOk);
4174  if (isOk)
4175  {
4176  val = content.mid(i4).toInt(&isOk);
4177  if (!isOk)
4179  "::intVal(): cannot parse the value; content: \"" + content + "\"");
4180  }
4181  else
4183  "::intVal(): cannot parse the 2nd idx; content: \"" + content + "\"");
4184  }
4185  else
4187  "::intVal(): cannot parse the 1st idx; content: \"" + content + "\"");
4188  }
4189  else
4191  "::intVal(): cannot parse the 4th idx; content: \"" + content + "\"");
4192  }
4193  else
4195  "::intVal(): cannot parse the 3rd idx; content: \"" + content + "\"");
4196  };
4197  if (d1 == 0)
4198  d1 = 1;
4199  if (d2 == 0)
4200  d2 = 1;
4201  if (d3 == 0)
4202  d3 = 1;
4203  if (d4 == 0)
4204  d4 = 1;
4205 
4206  return isOk;
4207 };
4208 
4209 
4210 
4211 //
4212 bool SgAgvDriver::lintValNoRegEx(const QString& content,
4213  int& d1, int& d2, int& d3, int& d4, long int &val)
4214 {
4215  int i1, i2, i3, i4;
4216  bool isOk=false;
4217  int strLength=content.size();
4218  if (strLength < 9)
4219  {
4221  "::lintVal(): the string is too short: \"" + content + "\"");
4222  return isOk;
4223  };
4224  d1 = d2 = d3 = d4 = 0;
4225  val = 0;
4226  if (!getContentIdxs(content, i1, i2, i3, i4))
4227  {
4229  "::lintVal(): cannot parse the string \"" + content + "\": " +
4230  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4231  return isOk;
4232  };
4233 
4234  if (!getContentIdxs(content, i1, i2, i3, i4))
4235  {
4237  "::lintVal(): cannot parse the string \"" + content + "\": " +
4238  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4239  return isOk;
4240  };
4241  if (true)
4242  {
4243  if ((i1 = sscanf(qPrintable(content), "%d %d %d %d %ld", &d3, &d4, &d1, &d2, &val)) == 5)
4244  isOk = true;
4245  else
4247  "::lintVal(): cannot sscan the string \"" + content + "\", retCode= " +
4248  QString("").setNum(i1));
4249  }
4250  else
4251  {
4252  d3 = content.mid(0, i1).toInt(&isOk);
4253  if (isOk)
4254  {
4255  d4 = content.mid(i1, i2-i1).toInt(&isOk);
4256  if (isOk)
4257  {
4258  d1 = content.mid(i2, i3-i2).toInt(&isOk);
4259  if (isOk)
4260  {
4261  d2 = content.mid(i3, i4-i3).toInt(&isOk);
4262  if (isOk)
4263  {
4264  val = content.mid(i4).toLong(&isOk);
4265  if (!isOk)
4267  "::lintVal(): cannot parse the value; content: \"" + content + "\"");
4268  }
4269  else
4271  "::lintVal(): cannot parse the 2nd idx; content: \"" + content + "\"");
4272  }
4273  else
4275  "::lintVal(): cannot parse the 1st idx; content: \"" + content + "\"");
4276  }
4277  else
4279  "::lintVal(): cannot parse the 4th idx; content: \"" + content + "\"");
4280  }
4281  else
4283  "::lintVal(): cannot parse the 3rd idx; content: \"" + content + "\"");
4284  };
4285  if (d1 == 0)
4286  d1 = 1;
4287  if (d2 == 0)
4288  d2 = 1;
4289  if (d3 == 0)
4290  d3 = 1;
4291  if (d4 == 0)
4292  d4 = 1;
4293 
4294  return isOk;
4295 };
4296 
4297 
4298 
4299 //
4300 bool SgAgvDriver::floatValNoRegEx(const QString& content,
4301  int& d1, int& d2, int& d3, int& d4, float &val)
4302 {
4303  int i1, i2, i3, i4;
4304  bool isOk=false;
4305  int strLength=content.size();
4306  if (strLength < 9)
4307  {
4309  "::floatVal(): the string is too short: \"" + content + "\"");
4310  return isOk;
4311  };
4312  d1 = d2 = d3 = d4 = 0;
4313  val = 0.0;
4314  if (!getContentIdxs(content, i1, i2, i3, i4))
4315  {
4317  "::floatVal(): cannot parse the string \"" + content + "\": " +
4318  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4319  return isOk;
4320  };
4321  if (true)
4322  {
4323  if ((i1 = sscanf(qPrintable(content), "%d %d %d %d %e", &d3, &d4, &d1, &d2, &val)) == 5)
4324  isOk = true;
4325  else
4327  "::floatVal(): cannot sscan the string \"" + content + "\", retCode= " +
4328  QString("").setNum(i1));
4329  }
4330  else
4331  {
4332  d3 = content.mid(0, i1).toInt(&isOk);
4333  if (isOk)
4334  {
4335  d4 = content.mid(i1, i2-i1).toInt(&isOk);
4336  if (isOk)
4337  {
4338  d1 = content.mid(i2, i3-i2).toInt(&isOk);
4339  if (isOk)
4340  {
4341  d2 = content.mid(i3, i4-i3).toInt(&isOk);
4342  if (isOk)
4343  {
4344  val = content.mid(i4).toFloat(&isOk);
4345  if (!isOk)
4347  "::floatVal(): cannot parse the value; content: \"" + content + "\"");
4348  }
4349  else
4351  "::floatVal(): cannot parse the 2nd idx; content: \"" + content + "\"");
4352  }
4353  else
4355  "::floatVal(): cannot parse the 1st idx; content: \"" + content + "\"");
4356  }
4357  else
4359  "::floatVal(): cannot parse the 4th idx; content: \"" + content + "\"");
4360  }
4361  else
4363  "::floatVal(): cannot parse the 3rd idx; content: \"" + content + "\"");
4364  };
4365  if (d1 == 0)
4366  d1 = 1;
4367  if (d2 == 0)
4368  d2 = 1;
4369  if (d3 == 0)
4370  d3 = 1;
4371  if (d4 == 0)
4372  d4 = 1;
4373 
4374  return isOk;
4375 };
4376 
4377 
4378 
4379 //
4380 bool SgAgvDriver::doubleValNoRegEx(const QString& content,
4381  int& d1, int& d2, int& d3, int& d4, double &val)
4382 {
4383  bool isOk=false;
4384  int i1, i2, i3, i4;
4385  int strLength=content.size();
4386  if (strLength < 9)
4387  {
4389  "::doubleVal(): the string is too short: \"" + content + "\"");
4390  return isOk;
4391  };
4392  d1 = d2 = d3 = d4 = 0;
4393  val = 0.0;
4394  QString str(content);
4395  str.replace("D", "E", Qt::CaseInsensitive);
4396 
4397  if (!getContentIdxs(str, i1, i2, i3, i4))
4398  {
4400  "::doubleVal(): cannot parse the string \"" + content + "\": " +
4401  QString("").sprintf("idxs=(%d:%d:%d:%d)", i1, i2, i3, i4));
4402  return isOk;
4403  };
4404  if (true)
4405  {
4406  if ((i1 = sscanf(qPrintable(str), "%d %d %d %d %le", &d3, &d4, &d1, &d2, &val)) == 5)
4407  isOk = true;
4408  else if (content.contains("NaN", Qt::CaseInsensitive)) // it's ok
4409  {
4410  val = 0.0;
4411  isOk = true;
4412  }
4413  else
4415  "::doubleVal(): cannot sscan the string \"" + content + "\", retCode= " +
4416  QString("").setNum(i1));
4417  }
4418  else
4419  {
4420  d3 = str.mid(0, i1).toInt(&isOk);
4421  if (isOk)
4422  {
4423  d4 = str.mid(i1, i2-i1).toInt(&isOk);
4424  if (isOk)
4425  {
4426  d1 = str.mid(i2, i3-i2).toInt(&isOk);
4427  if (isOk)
4428  {
4429  d2 = str.mid(i3, i4-i3).toInt(&isOk);
4430  if (isOk)
4431  {
4432  val = str.mid(i4).toDouble(&isOk);
4433  if (!isOk)
4435  "::doubleVal(): cannot parse the value; content: \"" + content + "\"");
4436  }
4437  else
4439  "::doubleVal(): cannot parse the 2nd idx; content: \"" + content + "\"");
4440  }
4441  else
4443  "::doubleVal(): cannot parse the 1st idx; content: \"" + content + "\"");
4444  }
4445  else
4447  "::doubleVal(): cannot parse the 4th idx; content: \"" + content + "\"");
4448  }
4449  else
4451  "::doubleVal(): cannot parse the 3rd idx; content: \"" + content + "\"");
4452  };
4453  if (d1 == 0)
4454  d1 = 1;
4455  if (d2 == 0)
4456  d2 = 1;
4457  if (d3 == 0)
4458  d3 = 1;
4459  if (d4 == 0)
4460  d4 = 1;
4461 
4462  return isOk;
4463 };
4464 
4465 
4466 
4467 //
4468 void SgAgvDriver::lookupFuzzyDescriptor(const QString& lc, int bndIdx, const QList<QString>& bandNames,
4469  SgAgvDatumDescriptor*& dd, bool doCheckNumOfChannels, unsigned int expectedStyles)
4470 {
4471  QString str("");
4472  str.sprintf("%s%d", qPrintable(lc), bndIdx + 1);
4473  str = str.leftJustified(8, ' ');
4474  if (datumByKey_.contains(str))
4475  {
4476 // *(dd + bndIdx) = datumByKey_.value(str);
4477 // if (numOfChansByBand_[bandNames.at(bndIdx)] < (*(d + bndIdx))->getDim1())
4478 // numOfChansByBand_[bandNames.at(bndIdx)] = (*(d + bndIdx))->getDim1();
4479  dd = datumByKey_.value(str);
4480  if (doCheckNumOfChannels && numOfChansByBand_[bandNames.at(bndIdx)] < dd->getDim1())
4481  numOfChansByBand_[bandNames.at(bndIdx)] = dd->getDim1();
4482  }
4483  else
4484  {
4485 // *(dd + bndIdx) = NULL;
4486  dd = NULL;
4487  if (expectedStyles & expectedStyle_)
4489  "::lookupFuzzyDescriptor(): the lCode \"" + lc + "\" for the band #" +
4490  QString("").setNum(bndIdx + 1) + " was not found");
4491  };
4492 };
4493 
4494 
4495 
4496 //
4498 {
4499  int d=0, n=0;
4500  QString str("");
4501  QList<QString> sourceNames, bandNames;
4504  //
4505  // collect neccessarry info:
4506  //
4507  if (c1Data_.contains(adPimaCnt_.getLCode()) || c1Data_.contains(adPimaVer_.getLCode()))
4508  cppSoft = SgVlbiSessionInfo::CPPS_PIMA;
4509  else if (c1Data_.contains(adFourfCmd_.getLCode()) || c1Data_.contains(adFourfCtrl_.getLCode()) ||
4510  c1Data_.contains(adFourFtVer_.getLCode()))
4511  cppSoft = SgVlbiSessionInfo::CPPS_HOPS;
4512  else if (i4Data_.contains(adFrTypFit_.getLCode()))
4513  {
4514  d = i4Data_.value(adFrTypFit_.getLCode())->value(0, 0, 0, 0);
4515  if (0<d && d<100)
4516  cppSoft = SgVlbiSessionInfo::CPPS_HOPS;
4517  else if (100 < d && d < 200)
4518  cppSoft = SgVlbiSessionInfo::CPPS_PIMA;
4519  };
4520  //
4521  session_->setCppsSoft(cppSoft);
4522 
4523  //
4524  //
4525  // source names:
4526  if (datumByKey_.contains(adSrcName_.getLCode()))
4527  {
4528  for (int i=0; i<datumByKey_.value(adSrcName_.getLCode())->d2(); i++)
4529  sourceNames << c1Data_.value(adSrcName_.getLCode())->value(i, 0, 0).leftJustified(8, ' ');
4530  numOfSrc_ = sourceNames.size();
4531  }
4532  else
4534  "::initSession(): a list of sources was not found");
4535  //
4536  // scan names:
4537  scanNames_.clear();
4538  if (datumByKey_.contains(adScanNames_.getLCode()))
4539  {
4540  for (int i=0; i<datumByKey_.value(adScanNames_.getLCode())->d3(); i++)
4541  scanNames_ << c1Data_.value(adScanNames_.getLCode())->value(0, i, 0);
4542  }
4543  else
4545  "::initSession(): a list of scans was not found");
4546  //
4547  // band names:
4548  if (datumByKey_.contains(adBandNames_.getLCode()))
4549  {
4550  for (int i=0; i<datumByKey_.value(adBandNames_.getLCode())->d2(); i++)
4551  bandNames << c1Data_.value(adBandNames_.getLCode())->value(i, 0, 0);
4552  }
4553  else
4555  "::initSession(): a list of bands was not found");
4556  //
4557  //
4558  // check the fuzzy descriptors:
4576  //
4577  numOfChansByBand_.clear();
4578  for (int bndIdx=0; bndIdx<numOfBands_; bndIdx++)
4579  {
4580  numOfChansByBand_[bandNames.at(bndIdx)] = 0;
4581  //
4582  lookupFuzzyDescriptor("NUM_AP", bndIdx, bandNames, *(adNumOfAp + bndIdx), true, ACS_NATIVE);
4583  lookupFuzzyDescriptor("CI_NUM", bndIdx, bandNames, *(adIndexNum + bndIdx), true, ACS_NATIVE);
4584  lookupFuzzyDescriptor("BBC_IDX", bndIdx, bandNames, *(adBbcIdx + bndIdx), true, ACS_NATIVE);
4585  lookupFuzzyDescriptor("ERRATE_", bndIdx, bandNames, *(adErrRate + bndIdx), true, ACS_NATIVE);
4586  lookupFuzzyDescriptor("CHANID", bndIdx, bandNames, *(adChanId + bndIdx), false, ACS_NATIVE);
4587  lookupFuzzyDescriptor("POLARZ", bndIdx, bandNames, *(adPolarz + bndIdx), false, ACS_NATIVE);
4588  lookupFuzzyDescriptor("RFREQ", bndIdx, bandNames, *(adRfFreq + bndIdx), true, ACS_NATIVE);
4589  lookupFuzzyDescriptor("IND_CHN", bndIdx, bandNames, *(adIndChn + bndIdx), true, ACS_ANY);
4590  lookupFuzzyDescriptor("LO_FREQ", bndIdx, bandNames, *(adLoRfFreq + bndIdx), true, ACS_NATIVE);
4591  lookupFuzzyDescriptor("APBYFRQ", bndIdx, bandNames, *(adChAmpPhs + bndIdx), true, ACS_NATIVE);
4592  lookupFuzzyDescriptor("UV_CHN", bndIdx, bandNames, *(adUvChn + bndIdx), true, ACS_NATIVE);
4593  if (cppSoft == SgVlbiSessionInfo::CPPS_PIMA)
4594  {
4595  lookupFuzzyDescriptor("NUM_SAM", bndIdx, bandNames, *(adNumSmpls + bndIdx), true, ACS_GVH);
4596  lookupFuzzyDescriptor("PCAL_FR", bndIdx, bandNames, *(adPhcFrq + bndIdx), true, ACS_GVH);
4597 
4598  lookupFuzzyDescriptor("PCAL_CM", bndIdx, bandNames, *(adPhcCm + bndIdx), true, ACS_GVH);
4599 
4600  *(adPhcAmp + bndIdx) = NULL;
4601  *(adPhcPhs + bndIdx) = NULL;
4602  *(adPhcOff + bndIdx) = NULL;
4603  }
4604  else if (cppSoft == SgVlbiSessionInfo::CPPS_HOPS)
4605  {
4606  lookupFuzzyDescriptor("NSAMPLS", bndIdx, bandNames, *(adNumSmpls + bndIdx), true, ACS_NATIVE);
4607  lookupFuzzyDescriptor("PHCFRQ_", bndIdx, bandNames, *(adPhcFrq + bndIdx), true, ACS_NATIVE);
4608 
4609  lookupFuzzyDescriptor("PHCAMP_", bndIdx, bandNames, *(adPhcAmp + bndIdx), true, ACS_NATIVE);
4610  lookupFuzzyDescriptor("PHCPHS_", bndIdx, bandNames, *(adPhcPhs + bndIdx), true, ACS_NATIVE);
4611  lookupFuzzyDescriptor("PHCOFF_", bndIdx, bandNames, *(adPhcOff + bndIdx), true, ACS_NATIVE);
4612  *(adPhcCm + bndIdx) = NULL;
4613  }
4614  };
4615 
4616 #ifdef LOCAL_DEBUG
4617  for (QMap<QString, int>::iterator it=numOfChansByBand_.begin(); it!=numOfChansByBand_.end(); ++it)
4618  std::cout << "the band[" << qPrintable(it.key()) << "] has " << it.value() << " channels"
4619  << qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
4620  << "\n";
4621 #endif
4622 
4623 
4624  //
4625  // phase 1:
4626  //
4627  //
4628  bool hasFourFitFileName;
4629 
4630  hasFourFitFileName = datumByKey_.contains(adFourfFile_.getLCode()) &&
4631  datumByKey_.value(adFourfFile_.getLCode())->d3();
4632 
4633  //
4635  QString station1Name, station2Name, sourceName, baselineName;
4636  QString scanName, scanId, obsKey, bandKey;
4637  SgMJD epoch;
4638  SgVlbiBand *band=NULL;
4639  SgVlbiObservation *obs=NULL;
4640  SgVlbiObservable *o=NULL;
4641  SgVlbiStationInfo *station1Info, *station2Info;
4642  SgVlbiStationInfo *bandStation1Info, *bandStation2Info;
4643  SgVlbiSourceInfo *sourceInfo, *bandSourceInfo;
4644  SgVlbiBaselineInfo *baselineInfo, *bandBaselineInfo;
4645  QMap<QString, SgVlbiAuxObservation*>
4646  *auxObsByScan=NULL;
4647  SgMeteoData meteo1, meteo2;
4648 
4649  // auxiliaries:
4650  int scanIdx, stn_1Idx, stn_2Idx, srcIdx;
4651  int mjdDay;
4652  double seconds;
4653  bool isTmp;
4654  int nYear, nMonth, nDay, nHour, nMin;
4655  double dSec;
4656  SgMJD tStart, tStop;
4657  //
4658  int numOfAllChannels=0;
4659  double *frqByChanNum=NULL;
4660 
4661  SgAgvDatum<double> *pGrDelAmbg=NULL, *pSnr=NULL, *pD;
4662 
4663  if (r8Data_.contains(adGrDelAmbg_.getLCode()))
4664  pGrDelAmbg = r8Data_.value(adGrDelAmbg_.getLCode());
4665  if (r8Data_.contains(adSnr_.getLCode()))
4666  pSnr = r8Data_.value(adSnr_.getLCode());
4667 
4668 
4669  //
4670  // General:
4671  if (c1Data_.contains(adCorrPlace_.getLCode()))
4673  c1Data_.value(adCorrPlace_.getLCode())->value(0, 0, 0));
4674  if (c1Data_.contains(adCorrType_.getLCode()))
4676  c1Data_.value(adCorrType_.getLCode())->value(0, 0, 0));
4677  if (c1Data_.contains(adExpCode_.getLCode()))
4679  c1Data_.value(adExpCode_.getLCode())->value(0, 0, 0));
4680  if (c1Data_.contains(adExpDesc_.getLCode()))
4682  c1Data_.value(adExpDesc_.getLCode())->value(0, 0, 0));
4683  //
4684  if (c1Data_.contains(adExpName_.getLCode()) && !c1Data_.contains(adExpCode_.getLCode()))
4686  c1Data_.value(adExpName_.getLCode())->value(0, 0, 0));
4687  //
4688  if (c1Data_.contains(adMk3DbName_.getLCode()))
4689  {
4690  str = c1Data_.value(adMk3DbName_.getLCode())->value(0, 0, 0);
4691  if (str.at(0) == '$')
4692  str.remove(0, 1);
4693  session_->setName(str);
4694  if (session_->getName().size() == 9)
4695  session_->setNetworkSuffix(session_->getName().mid(8, 1));
4696  else
4698  };
4699  if (c1Data_.contains(adPiName_.getLCode()))
4701  c1Data_.value(adPiName_.getLCode())->value(0, 0, 0));
4702  if (c1Data_.contains(adRecMode_.getLCode()))
4704  c1Data_.value(adRecMode_.getLCode())->value(0, 0, 0));
4705  if (i2Data_.contains(adExpSerNo_.getLCode()))
4707  i2Data_.value(adExpSerNo_.getLCode())->value(0, 0, 0, 0));
4708 
4709  if (datumByKey_.contains(adSkyFrqChn_.getLCode()) && r8Data_.contains(adSkyFrqChn_.getLCode()))
4710  {
4711  numOfAllChannels = datumByKey_.value(adSkyFrqChn_.getLCode())->d1();
4712  if (numOfAllChannels)
4713  {
4714  frqByChanNum = new double[numOfAllChannels];
4715  for (int i=0; i<numOfAllChannels; i++)
4716  frqByChanNum[i] = r8Data_.value(adSkyFrqChn_.getLCode())->value(i, 0, 0, 0)*1.0e-6;
4717  }
4718  else
4719  {
4721  "::initSession(): numOfAllChannels is zero");
4722  frqByChanNum = NULL;
4723  };
4724  }
4726  {
4728  "::initSession(): cannot find the lCode \"" + adSkyFrqChn_.getLCode() + "\"");
4729  };
4730 
4731 
4732  // first, create bands:
4733  for (int i=0; i<numOfBands_; i++)
4734  {
4735  bandKey = bandNames.at(i);
4736  band = new SgVlbiBand;
4737  band->setKey(bandKey);
4738  session_->bands().append(band);
4739  session_->bandByKey().insert(bandKey, band);
4741  band->setInputFileName(fileName_);
4742  //
4743  if ((r8Data_.contains(adIonCorr_.getLCode()) && r8Data_.contains(adIonRms_.getLCode())) ||
4744  (r8Data_.contains(adDtec_.getLCode()) && r8Data_.contains(adDtecSig_.getLCode())) )
4746  };
4747  //
4748  //
4749  //
4750  // add session attributes:
4751  if ((r8Data_.contains(adIonCorr_.getLCode()) && r8Data_.contains(adIonRms_.getLCode())) ||
4752  (r8Data_.contains(adDtec_.getLCode()) && r8Data_.contains(adDtecSig_.getLCode())) )
4753  {
4756  };
4757  //
4758  if (r8Data_.contains(adDtec_.getLCode()) && r8Data_.contains(adDtecSig_.getLCode()))
4760  //
4761  if (i2Data_.contains(adDelayFlag_.getLCode()) ||
4762  i2Data_.contains(adRateFlag_.getLCode()) ||
4763  i2Data_.contains(adPhaseFlag_.getLCode()) )
4764  {
4767  };
4768  //
4769  if (i4Data_.contains(adNumGrAmbg_.getLCode()))
4771  //
4772  if (r8Data_.contains(adAirPress_.getLCode()) || r8Data_.contains(adCableDel_.getLCode()))
4773  {
4776  };
4777  //
4778  if (r8Data_.contains(adAtmInterv_.getLCode()) && r8Data_.contains(adAtmConstr_.getLCode()))
4780  //
4781  if (r8Data_.contains(adConsnDel_.getLCode()) && r8Data_.contains(adConsnRat_.getLCode()))
4782  {
4785  };
4786  //
4787 
4788  // and a couple more below...
4789  //
4790  //
4791  if (r8Data_.contains(adUtcMtai_.getLCode()))
4792  session_->setLeapSeconds(-r8Data_.value(adUtcMtai_.getLCode())->value(0, 0, 0, 0)); // reverse sign
4793 
4794  // make a skeleton of a session:
4795  for (int obsIdx=0; obsIdx<numOfObs_; obsIdx++)
4796  {
4797  scanIdx = i4Data_.value(adObsTab_.getLCode())->value(0, obsIdx, 0, 0) - 1;
4798  stn_1Idx = i4Data_.value(adObsTab_.getLCode())->value(1, obsIdx, 0, 0) - 1;
4799  stn_2Idx = i4Data_.value(adObsTab_.getLCode())->value(2, obsIdx, 0, 0) - 1;
4800  // these are per scan:
4801  srcIdx = i4Data_.value(adSrcIdx_.getLCode())->value(0, 0, scanIdx, 0) - 1;
4802  mjdDay = i4Data_.value(adMjdObs_.getLCode())->value(0, 0, scanIdx, 0);
4803  seconds = r8Data_.value(adUtcObs_.getLCode())->value(0, 0, scanIdx, 0);
4804 
4805  epoch.setDate(mjdDay);
4806  epoch.setTime(seconds/DAY2SEC);
4807 
4808 
4809  // stations and source names:
4810  station1Name = stnNames_.at(stn_1Idx);
4811  station2Name = stnNames_.at(stn_2Idx);
4812  sourceName = sourceNames.at(srcIdx);
4813  scanName = scanNames_.at(scanIdx);
4814  baselineName = station1Name + ":" + station2Name;
4815 
4816 #ifdef LOCAL_DEBUG
4817  if (numOfObs_ < 100)
4818  std::cout << " Got (" << obsIdx << ") ["
4819  << qPrintable(station1Name) << "]:[" << qPrintable(station2Name) << "] @["
4820  << qPrintable(sourceName) << "], scan=[" << qPrintable(scanName) << "] at "
4821  << qPrintable(epoch.toString()) << "\n";
4822 #endif
4823 
4824  // scanId and scanName:
4825  scanId = epoch.toString(SgMJD::F_INTERNAL) + "@" + sourceName;
4826  obsKey.sprintf("%s",
4827  qPrintable(epoch.toString(SgMJD::F_INTERNAL) + "-" + baselineName + "@" + sourceName));
4828 
4829  //
4830  // pick up or create an observation:
4831  if (session_->observationByKey().contains(obsKey))
4832  obs = session_->observationByKey().value(obsKey);
4833  else
4834  {
4835  obs = new SgVlbiObservation(session_);
4836  obs->setMJD(epoch);
4837  obs->setScanName(scanName);
4838  obs->setScanId(scanId);
4839  obs->setKey(obsKey);
4840  obs->setMediaIdx(obsIdx);
4841  session_->observations().append(obs);
4842  session_->observationByKey().insert(obsKey, obs);
4843  if (c1Data_.contains(adFScanName_.getLCode()))
4844  obs->setScanFullName(c1Data_.value(adFScanName_.getLCode())->value(0, scanIdx, 0));
4845  if (c1Data_.contains(adCrootFnam_.getLCode()))
4846  obs->setCorrRootFileName(c1Data_.value(adCrootFnam_.getLCode())->value(0, scanIdx, 0));
4847  };
4848  //
4849  // station #1:
4850  if (session_->stationsByName().contains(station1Name))
4851  station1Info = session_->stationsByName().value(station1Name);
4852  else // new station, add it to the container and register its index:
4853  {
4854  station1Info = new SgVlbiStationInfo(session_->stationsByName().size(), station1Name);
4855  session_->stationsByName().insert(station1Info->getKey(), station1Info);
4856  session_->stationsByIdx().insert(station1Info->getIdx(), station1Info);
4857  };
4858  // station #2:
4859  if (session_->stationsByName().contains(station2Name))
4860  station2Info = session_->stationsByName().value(station2Name);
4861  else // new station, add it to the container and register its index:
4862  {
4863  station2Info = new SgVlbiStationInfo(session_->stationsByName().size(), station2Name);
4864  session_->stationsByName().insert(station2Info->getKey(), station2Info);
4865  session_->stationsByIdx().insert(station2Info->getIdx(), station2Info);
4866  };
4867  // source:
4868  if (session_->sourcesByName().contains(sourceName))
4869  sourceInfo = session_->sourcesByName().value(sourceName);
4870  else // new source, add it to the container and register its index:
4871  {
4872  sourceInfo = new SgVlbiSourceInfo(session_->sourcesByName().size(), sourceName);
4873  session_->sourcesByName().insert(sourceInfo->getKey(), sourceInfo);
4874  session_->sourcesByIdx().insert(sourceInfo->getIdx(), sourceInfo);
4875  };
4876  // baseline:
4877  if (session_->baselinesByName().contains(baselineName))
4878  baselineInfo = session_->baselinesByName().value(baselineName);
4879  else // new baseline, add it to the container and register its index:
4880  {
4881  baselineInfo = new SgVlbiBaselineInfo(session_->baselinesByName().size(), baselineName);
4882  session_->baselinesByName().insert(baselineInfo->getKey(), baselineInfo);
4883  session_->baselinesByIdx().insert(baselineInfo->getIdx(), baselineInfo);
4884  };
4885  obs->setStation1Idx(station1Info->getIdx());
4886  obs->setStation2Idx(station2Info->getIdx());
4887  obs->setSourceIdx(sourceInfo->getIdx());
4888  obs->setBaselineIdx(baselineInfo->getIdx());
4889  //
4890  //
4891  // auxObs: just create entries:
4892  // the first station:
4893  auxObsByScan = station1Info->auxObservationByScanId();
4894  if (!auxObsByScan->contains(scanId)) // new scan, insert data:
4895  {
4897  auxObs->setMJD(*obs);
4898  auxObsByScan->insert(scanId, auxObs);
4899  };
4900  // the second station:
4901  auxObsByScan = station2Info->auxObservationByScanId();
4902  if (!auxObsByScan->contains(scanId)) // new scan, insert data:
4903  {
4905  auxObs->setMJD(*obs);
4906  auxObsByScan->insert(scanId, auxObs);
4907  };
4908  //
4909  //
4910  /*
4911  if (r8Data_.contains(adApLength_.getLCode()))
4912  obs->setApLength(
4913  r8Data_.value(adApLength_.getLCode())->value(0, 0, obsIdx, 0));
4914  */
4915  dd = datumByKey_.value(adApLength_.getLCode());
4916  if (dd && r8Data_.contains(dd->getLCode()))
4917  {
4918  if (dd->getDataScope() == ADS_BASELINE)
4919  obs->setApLength(r8Data_.value(dd->getLCode())->value(0, 0, obsIdx, 0));
4920  else if ( dd->getDataScope() == ADS_SESSION &&
4921  dd->getDim3() == 1 &&
4922  dd->getDim4() == 1)
4923  obs->setApLength(r8Data_.value(dd->getLCode())->value(0, 0, 0, 0));
4924  else
4926  "::initSession(): got an uknown format of \"" + dd->getLCode() + "\" lCode");
4927  };
4928  if (r8Data_.contains(adDtec_.getLCode()))
4929  obs->setDTec(
4930  r8Data_.value(adDtec_.getLCode())->value(0, 0, obsIdx, 0));
4931  if (r8Data_.contains(adDtecSig_.getLCode()))
4932  obs->setDTecStdDev(
4933  r8Data_.value(adDtecSig_.getLCode())->value(0, 0, obsIdx, 0));
4934 
4935 //std::cout << " -- 0\n";
4936  // run for each of bands:
4937  for (int bndIdx=0; bndIdx<numOfBands_; bndIdx++)
4938  {
4939  bandKey = bandNames.at(bndIdx);
4940 //std::cout << " -- 0 band " << qPrintable(bandKey) << "\n";
4941  band = session_->bandByKey().value(bandKey);
4942  o = NULL;
4943 
4944  if ((pGrDelAmbg && 0.0<pGrDelAmbg->value(bndIdx, 0, obsIdx, 0) &&
4945  pSnr && 0.0<pSnr->value(bndIdx, 0, obsIdx, 0)) ||
4946  // false
4948  )
4949  {
4950  o = new SgVlbiObservable(obs, band);
4951  o->setMediaIdx(obsIdx);
4952  obs->addObservable(band->getKey(), o);
4953  obs->setupActiveObservable(bandKey);
4954 //std::cout << " -- 1 band \n";
4955 
4956  // 4band:
4957  // band's station #1:
4958  if (band->stationsByName().contains(station1Name))
4959  bandStation1Info = band->stationsByName().value(station1Name);
4960  else // new station, add it to the container:
4961  {
4962  bandStation1Info = new SgVlbiStationInfo(station1Info->getIdx(), station1Name);
4963  band->stationsByName().insert(bandStation1Info->getKey(), bandStation1Info);
4964  band->stationsByIdx().insert(bandStation1Info->getIdx(), bandStation1Info);
4965  };
4966  // band's station #2:
4967  if (band->stationsByName().contains(station2Name))
4968  bandStation2Info = band->stationsByName().value(station2Name);
4969  else // new station, add it to the container:
4970  {
4971  bandStation2Info = new SgVlbiStationInfo(station2Info->getIdx(), station2Name);
4972  band->stationsByName().insert(bandStation2Info->getKey(), bandStation2Info);
4973  band->stationsByIdx().insert(bandStation2Info->getIdx(), bandStation2Info);
4974  };
4975  // band's source:
4976  if (band->sourcesByName().contains(sourceName))
4977  bandSourceInfo = band->sourcesByName().value(sourceName);
4978  else // new source, add it to the container:
4979  {
4980  bandSourceInfo = new SgVlbiSourceInfo(sourceInfo->getIdx(), sourceName);
4981  band->sourcesByName().insert(bandSourceInfo->getKey(), bandSourceInfo);
4982  band->sourcesByIdx().insert(bandSourceInfo->getIdx(), bandSourceInfo);
4983  };
4984  // band's baselines:
4985  if (band->baselinesByName().contains(baselineName))
4986  bandBaselineInfo = band->baselinesByName().value(baselineName);
4987  else // new baseline, add it to the container and register its index:
4988  {
4989  bandBaselineInfo = new SgVlbiBaselineInfo(baselineInfo->getIdx(), baselineName);
4990  band->baselinesByName().insert(bandBaselineInfo->getKey(), bandBaselineInfo);
4991  band->baselinesByIdx().insert(bandBaselineInfo->getIdx(), bandBaselineInfo);
4992  };
4993  //
4994  // plus additional info:
4995  if (hasFourFitFileName)
4996  o->setFourfitOutputFName(c1Data_.value(adFourfFile_.getLCode())->value(bndIdx, obsIdx, 0));
4997  else
4998  o->setFourfitOutputFName("n/a");
4999  //
5000  //
5001  // fringe error code:
5002  if (c1Data_.contains(adFourfErr_.getLCode()))
5003  {
5004  str = c1Data_.value(adFourfErr_.getLCode())->value(bndIdx, obsIdx, 0);
5005  o->setErrorCode(str=="_"?" ":str);
5006  }
5007  else
5008  o->setErrorCode(" ");
5009 
5010  // quality factor:
5011  if (c1Data_.contains(adQualCodes_.getLCode()))
5012  {
5013  str = c1Data_.value(adQualCodes_.getLCode())->value(bndIdx, obsIdx, 0)
5014  .replace('_', ' ').simplified();
5015  d = str.toInt(&isTmp);
5016  if (!isTmp)
5017  {
5018  d = 0;
5019  if (c1Data_.contains(adFourfErr_.getLCode()))
5021  "::initSession(): canot convert quality factor [" + str + "] to int");
5022  else // its ok
5023  o->setErrorCode(str);
5024  };
5025  o->setQualityFactor(d);
5026  };
5027 
5029  o->getErrorCode() != " ")
5030  {
5031 //std::cout << " ++ PIMA && errorCode!=' ': [" << qPrintable(o->getErrorCode()) << "]\n";
5032  }
5033  else
5034  {
5035  // collect observables:
5036  // single band delay:
5037  if (r8Data_.contains(adSbDelVal_.getLCode()))
5038  o->sbDelay().setValue(r8Data_.value(adSbDelVal_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5039  if (r8Data_.contains(adSbDelErr_.getLCode()))
5040  o->sbDelay().setSigma(r8Data_.value(adSbDelErr_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5041 
5042  // group delays:
5043  if (r8Data_.contains(adGrDelVal_.getLCode()))
5044  o->grDelay().setValue(r8Data_.value(adGrDelVal_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5045  if (r8Data_.contains(adGrDelErr_.getLCode()))
5046  o->grDelay().setSigma(r8Data_.value(adGrDelErr_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5047 
5048  // delay rates:
5049  if (r8Data_.contains(adDelRate_.getLCode()))
5050  o->phDRate().setValue(r8Data_.value(adDelRate_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5051  if (r8Data_.contains(adPhRatErr_.getLCode()))
5052  o->phDRate().setSigma(r8Data_.value(adPhRatErr_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5053  //
5054  // ambiguity spacing:
5055  if (pGrDelAmbg)
5056  o->grDelay().setAmbiguitySpacing(pGrDelAmbg->value(bndIdx, 0, obsIdx, 0));
5057  // ambiguity resolution:
5058  if (i4Data_.contains(adNumGrAmbg_.getLCode()))
5060  i4Data_.value(adNumGrAmbg_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5061  //
5062  if (pSnr)
5063  o->setSnr(pSnr->value(bndIdx, 0, obsIdx, 0));
5064 
5065 //std::cout << " -- 2 band \n";
5066 
5067  if (r8Data_.contains(adCorrelatn_.getLCode()))
5068  o->setCorrCoeff(
5069  r8Data_.value(adCorrelatn_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5070  if (r8Data_.contains(adFrnAmpl_.getLCode()))
5071  o->setCorrCoeff(
5072  r8Data_.value(adFrnAmpl_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5073 
5074  if (r8Data_.contains(adRefFreq_.getLCode())) // Hz->MHz
5076  r8Data_.value(adRefFreq_.getLCode())->value(bndIdx, 0, obsIdx, 0)*1.0E-6);
5077 
5078  if (r8Data_.contains(adEffFreq_.getLCode()))
5079  {
5080  o->grDelay().setEffFreq(
5081  r8Data_.value(adEffFreq_.getLCode())->value(0, bndIdx, obsIdx, 0)*1.0e-6);
5082  o->phDelay().setEffFreq(
5083  r8Data_.value(adEffFreq_.getLCode())->value(1, bndIdx, obsIdx, 0)*1.0e-6);
5084  o->phDRate().setEffFreq(
5085  r8Data_.value(adEffFreq_.getLCode())->value(2, bndIdx, obsIdx, 0)*1.0e-6);
5086  };
5087  if (r8Data_.contains(adEffFrew_.getLCode()))
5088  {
5089  o->grDelay().setEffFreqEqWgt(
5090  r8Data_.value(adEffFrew_.getLCode())->value(0, bndIdx, obsIdx, 0)*1.0e-6);
5091  o->phDelay().setEffFreqEqWgt(
5092  r8Data_.value(adEffFrew_.getLCode())->value(1, bndIdx, obsIdx, 0)*1.0e-6);
5093  o->phDRate().setEffFreqEqWgt(
5094  r8Data_.value(adEffFrew_.getLCode())->value(2, bndIdx, obsIdx, 0)*1.0e-6);
5095  };
5096 
5097  if (r8Data_.contains(adIonCorr_.getLCode()))
5098  {
5099  o->grDelay().setIonoValue(
5100  r8Data_.value(adIonCorr_.getLCode())->value(0, bndIdx, obsIdx, 0));
5101  o->phDRate().setIonoValue(
5102  r8Data_.value(adIonCorr_.getLCode())->value(1, bndIdx, obsIdx, 0));
5103  };
5104  }; // end of the letter error code == just a placeholder
5105  //
5106  //
5107 
5108 
5109 
5110  //
5111  if (r8Data_.contains(adTotPhase_.getLCode()))
5112  o->setTotalPhase(
5113  r8Data_.value(adTotPhase_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5114 
5115  if (i2Data_.contains(adDelayFlag_.getLCode()))
5116  o->grDelay().setUnweightFlag(
5117  i2Data_.value(adDelayFlag_.getLCode())->value(0, 0, obsIdx, 0));
5118 
5119  // config_ can be NULL:
5121  (o->grDelay().getUnweightFlag()==1 || o->grDelay().getUnweightFlag()==2))
5123 
5124  if (i2Data_.contains(adRateFlag_.getLCode()))
5125  o->phDRate().setUnweightFlag(
5126  i2Data_.value(adRateFlag_.getLCode())->value(0, 0, obsIdx, 0));
5127  if (i2Data_.contains(adPhaseFlag_.getLCode()))
5128  o->phDelay().setUnweightFlag(
5129  i2Data_.value(adPhaseFlag_.getLCode())->value(0, 0, obsIdx, 0));
5130 
5131  if (r8Data_.contains(adIonRms_.getLCode()))
5132  {
5133  o->grDelay().setIonoSigma(
5134  r8Data_.value(adIonRms_.getLCode())->value(0, bndIdx, obsIdx, 0));
5135  o->phDRate().setIonoSigma(
5136  r8Data_.value(adIonRms_.getLCode())->value(1, bndIdx, obsIdx, 0));
5137  };
5138 
5139 // if (cppSoft == SgVlbiSessionInfo::CPPS_HOPS)
5140  if (expectedStyle_ == ACS_NATIVE)
5141  {
5142  if (r8Data_.contains(adUnPhaseCl_.getLCode()) &&
5143  datumByKey_.value(adUnPhaseCl_.getLCode())->getIsUsable())
5144  {
5145  o->setPhaseCalGrDelays(0, r8Data_.value(adUnPhaseCl_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5146  o->setPhaseCalGrDelays(1, r8Data_.value(adUnPhaseCl_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5147  };
5148  }
5149  else if (cppSoft == SgVlbiSessionInfo::CPPS_PIMA)
5150  {
5151 
5152  };
5153  dd = datumByKey_.value(adSamplRate_.getLCode());
5154  if (r8Data_.contains(dd->getLCode()))
5155  {
5156  if (dd->getDataScope() == ADS_BASELINE)
5157  o->setSampleRate(r8Data_.value(dd->getLCode())->value(bndIdx, 0, obsIdx, 0));
5158  else if (dd->getDataScope() == ADS_SESSION &&
5159  dd->getDim3() == 1 &&
5160  dd->getDim4() == 1)
5161  o->setSampleRate(r8Data_.value(dd->getLCode())->value(0, 0, 0, 0));
5162  else
5164  "::initSession(): got an uknown format of \"" + dd->getLCode() + "\" lCode");
5165  };
5166  if (r8Data_.contains(adEffDura_.getLCode()))
5167  o->setEffIntegrationTime(r8Data_.value(adEffDura_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5168  else if (r8Data_.contains(adScanDur_.getLCode()))
5169  o->setEffIntegrationTime(r8Data_.value(adScanDur_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5170 
5171  if (c1Data_.contains(adFourfCmd_.getLCode()))
5173  c1Data_.value(adFourfCmd_.getLCode())->value(bndIdx, obsIdx, 0));
5174  else
5175  o->setFourfitCommandOverride("n/a");
5176  if (c1Data_.contains(adFourfCtrl_.getLCode()))
5178  c1Data_.value(adFourfCtrl_.getLCode())->value(bndIdx, obsIdx, 0));
5179  else
5180  o->setFourfitControlFile("n/a");
5181 
5182  if (i2Data_.contains(adNumLags_.getLCode()))
5183  o->setNlags(
5184  i2Data_.value(adNumLags_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5185  if (r8Data_.contains(adUvf_Asec_.getLCode()))
5186  {
5187  o->setUvFrPerAsec(0, r8Data_.value(adUvf_Asec_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5188  o->setUvFrPerAsec(1, r8Data_.value(adUvf_Asec_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5189  };
5190 //std::cout << " -- 3 band \n";
5191  //
5192  //
5193  // per channel data:
5194  QString chanIds(""), polariz("");
5195  int numOfChannels=0;
5196  double re, im;
5197  //
5198  dd = datumByKey_.value(adBitsSampl_.getLCode());
5199  if (dd && i2Data_.contains(dd->getLCode()))
5200  {
5201  if (dd->getDataScope() == ADS_BASELINE)
5202  o->setBitsPerSample(i2Data_.value(dd->getLCode())->value(bndIdx, 0, obsIdx, 0));
5203  else if ( dd->getDataScope() == ADS_SESSION &&
5204  dd->getDim3() == 1 &&
5205  dd->getDim4() == 1)
5206  o->setBitsPerSample(i2Data_.value(dd->getLCode())->value(0, 0, 0, 0));
5207  else
5209  "::initSession(): got an uknown format of \"" + dd->getLCode() + "\" lCode");
5210  };
5211  if (i2Data_.contains(adNusedChnl_.getLCode()))
5212  o->setNumOfChannels(
5213  (numOfChannels=i2Data_.value(adNusedChnl_.getLCode())->value(bndIdx, 0, obsIdx, 0)));
5214  o->allocateChannelsSetupStorages(numOfChannels);
5215 
5216 //std::cout << " -- 3.1 numOfChannels=" << numOfChannels << "\n";
5217 
5218  dd = *(adChanId + bndIdx);
5219  if (dd && c1Data_.contains(dd->getLCode()))
5220  chanIds = c1Data_.value(dd->getLCode())->value(0, obsIdx, 0);
5221  //
5222  dd = *(adPolarz + bndIdx);
5223  if (dd && c1Data_.contains(dd->getLCode()))
5224  polariz = c1Data_.value(dd->getLCode())->value(0, obsIdx, 0);
5225  //
5226 //std::cout << " -- 3.2\n";
5227  for (int chIdx=0; chIdx<numOfChannels; chIdx++)
5228  {
5229  //
5230 //std::cout << " -- 3.2.0 chIdx=" << chIdx << "\n";
5231  dd = *(adNumOfAp + bndIdx);
5232  if (dd && i2Data_.contains(dd->getLCode()))
5233  {
5235  i2Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5237  i2Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0));
5238  };
5239  //
5240 //std::cout << " -- 3.2.1\n";
5241  dd = *(adNumSmpls + bndIdx);
5242  if (dd && r8Data_.contains(dd->getLCode()))
5243  {
5244  o->numOfSamplesByChan_USB()->setElement(chIdx,
5245  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5246  if (dd->getDim2() == 2) // PIMA could skip zeros
5247  o->numOfSamplesByChan_LSB()->setElement(chIdx,
5248  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0));
5249  };
5250  //
5251 //std::cout << " -- 3.2.2\n";
5252  dd = *(adRfFreq + bndIdx);
5253  if (dd && r8Data_.contains(dd->getLCode()))
5254  o->refFreqByChan()->setElement(chIdx,
5255  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5256  //
5257 //std::cout << " -- 3.2.3\n";
5258  dd = *(adIndChn + bndIdx);
5259  if (dd && frqByChanNum && i2Data_.contains(dd->getLCode()))
5260  {
5261  d = i2Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0) - 1;
5262  if (0<=d && d<numOfAllChannels)
5263  o->refFreqByChan()->setElement(chIdx, frqByChanNum[d]);
5264  else
5265  {
5267  ": initSession(): the channel index " + QString("").setNum(d) + " is out of range [0.." +
5268  QString("").setNum(numOfAllChannels) + "]");
5269  };
5270  };
5271  //
5272 //std::cout << " -- 3.2.4\n";
5273  dd = *(adChAmpPhs + bndIdx);
5274  if (dd && r8Data_.contains(dd->getLCode()))
5275  {
5276  o->fringeAmplitudeByChan()->setElement(chIdx,
5277  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5278  o->fringePhaseByChan()->setElement(chIdx,
5279  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0)/RAD2DEG);
5280  };
5281  // PIMA:
5282 //std::cout << " -- 3.2.5\n";
5283  dd = *(adUvChn + bndIdx);
5284  if (dd && r4Data_.contains(dd->getLCode()))
5285  {
5286  re = r4Data_.value(dd->getLCode())->value(0, chIdx, obsIdx, 0);
5287  im = r4Data_.value(dd->getLCode())->value(1, chIdx, obsIdx, 0);
5288  o->fringeAmplitudeByChan()->setElement(chIdx, sqrt(re*re + im*im));
5289  o->fringePhaseByChan ()->setElement(chIdx, atan2(im, re));
5290  };
5291  //
5292  //
5293 //std::cout << " -- 3.2.6\n";
5294  dd = *(adPhcFrq + bndIdx);
5295  if (dd && r8Data_.contains(dd->getLCode()))
5296  {
5297  if (dd->getDataScope()==ADS_BASELINE)
5298  {
5300  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5302  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0));
5303  }
5304  else if (dd->getDataScope()==ADS_STATION)
5305  {
5307  r8Data_.value(dd->getLCode())->
5308  value(0, chIdx, station1Info->auxObservationByScanId()->size()-1, stn_1Idx));
5310  r8Data_.value(dd->getLCode())->
5311  value(0, chIdx, station2Info->auxObservationByScanId()->size()-1, stn_2Idx));
5312  }
5313  else
5315  "::initSession(): got unexpected scope of \"" + dd->getLCode() + "\" lCode");
5316  };
5317 //std::cout << " -- 3.2.6.1\n";
5318  //
5319  //
5320  dd = adPhcCm?*(adPhcCm + bndIdx):NULL;
5321 //std::cout << " -- 3.2.6.2\n";
5322  if (dd && r8Data_.contains(dd->getLCode()))
5323  {
5324 //std::cout << " -- 3.2.6.3\n";
5325  if (dd->getDataScope()==ADS_STATION)
5326  {
5327  re = r8Data_.value(dd->getLCode())->
5328  value(0, chIdx, station1Info->auxObservationByScanId()->size()-1, stn_1Idx);
5329  im = r8Data_.value(dd->getLCode())->
5330  value(1, chIdx, station1Info->auxObservationByScanId()->size()-1, stn_1Idx);
5332  sqrt(re*re + im*im));
5333  o->phaseCalData_1ByChan()->setElement(SgVlbiObservable::PCCI_PHASE, chIdx, atan2(im, re));
5335 
5336  re = r8Data_.value(dd->getLCode())->
5337  value(0, chIdx, station2Info->auxObservationByScanId()->size()-1, stn_2Idx);
5338  im = r8Data_.value(dd->getLCode())->
5339  value(1, chIdx, station2Info->auxObservationByScanId()->size()-1, stn_2Idx);
5341  sqrt(re*re + im*im));
5342  o->phaseCalData_2ByChan()->setElement(SgVlbiObservable::PCCI_PHASE, chIdx, atan2(im, re));
5344 //std::cout << " -- 3.2.6.10\n";
5345  }
5346  else
5348  "::initSession(): got unexpected scope of \"" + dd->getLCode() + "\" lCode");
5349  };
5350  //
5351  // eop
5352  //
5353  //
5354 //std::cout << " -- 3.2.7\n";
5355  if (cppSoft==SgVlbiSessionInfo::CPPS_HOPS && (dd=*(adPhcAmp + bndIdx)))
5356  {
5358  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5360  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0));
5361  };
5362  //
5363 //std::cout << " -- 3.2.8\n";
5364 // dd = *(adPhcPhs + bndIdx);
5365 // if (dd && r8Data_.contains(dd->getLCode()))
5366  if (cppSoft==SgVlbiSessionInfo::CPPS_HOPS && (dd=*(adPhcPhs + bndIdx)))
5367  {
5369  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0)/(RAD2DEG*100.0));
5371  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0)/(RAD2DEG*100.0));
5372  };
5373  //
5374 //std::cout << " -- 3.2.9\n";
5375 // dd = *(adPhcOff + bndIdx);
5376 // if (dd && r8Data_.contains(dd->getLCode()))
5377  if (cppSoft==SgVlbiSessionInfo::CPPS_HOPS && (dd=*(adPhcOff + bndIdx)))
5378  {
5380  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0)/(RAD2DEG*100.0));
5382  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0)/(RAD2DEG*100.0));
5383  };
5384  //
5385 //std::cout << " -- 3.2.10\n";
5386  dd = *(adIndexNum + bndIdx);
5387  if (dd && i2Data_.contains(dd->getLCode()))
5388  {
5389  (*o->corelIndexNumUSB())[chIdx] =
5390  i2Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0);
5391  (*o->corelIndexNumLSB())[chIdx] =
5392  i2Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0);
5393  };
5394  //
5395 //std::cout << " -- 3.2.11\n";
5396  dd = *(adBbcIdx + bndIdx);
5397  if (dd && i2Data_.contains(dd->getLCode()))
5398  {
5399  (*o->bbcIdxByChan_1())[chIdx] =
5400  i2Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0);
5401  (*o->bbcIdxByChan_2())[chIdx] =
5402  i2Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0);
5403  };
5404  //
5405 //std::cout << " -- 3.2.12\n";
5406  dd = *(adErrRate + bndIdx);
5407  if (dd && i2Data_.contains(dd->getLCode()))
5408  {
5409  o->phaseCalData_1ByChan()->setElement(4, chIdx,
5410  i2Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5411  o->phaseCalData_2ByChan()->setElement(4, chIdx,
5412  i2Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0));
5413  };
5414  //
5415 //std::cout << " -- 3.2.13\n";
5416  dd = *(adLoRfFreq + bndIdx);
5417  if (dd && r8Data_.contains(dd->getLCode()))
5418  {
5419  o->loFreqByChan_1()->setElement(chIdx,
5420  r8Data_.value(dd->getLCode())->value(chIdx, 0, obsIdx, 0));
5421  o->loFreqByChan_2()->setElement(chIdx,
5422  r8Data_.value(dd->getLCode())->value(chIdx, 1, obsIdx, 0));
5423  };
5424  //
5425 //std::cout << " -- 3.2.15\n";
5426  if (chanIds.size() == numOfChannels)
5427  (*o->chanIdByChan())[chIdx] = chanIds.at(chIdx).toLatin1();
5428  //
5429 //std::cout << " -- 3.2.16\n";
5430  if (polariz.size() == 2*numOfChannels)
5431  {
5432  (*o->polarization_1ByChan())[chIdx] = polariz.at(2*chIdx ).toLatin1();
5433  (*o->polarization_2ByChan())[chIdx] = polariz.at(2*chIdx + 1).toLatin1();
5434  };
5435 //std::cout << " -- 3.2.--\n";
5436  }; // end of channel iteration
5437  //
5438 
5439 
5440 
5441 
5442 //std::cout << " -- 4 band \n";
5443  //
5444  SgVector& numOfAccPeriodsByChan_USB = *o->numOfAccPeriodsByChan_USB();
5445  SgVector& numOfAccPeriodsByChan_LSB = *o->numOfAccPeriodsByChan_LSB();
5446  SgVector& numOfSamplesByChan_USB = *o->numOfSamplesByChan_USB();
5447  SgVector& numOfSamplesByChan_LSB = *o->numOfSamplesByChan_LSB();
5448  SgVector& refFreqByChan = *o->refFreqByChan();
5449  SgVector& fringeAmplitudeByChan = *o->fringeAmplitudeByChan();
5450  double sampleRate=0.0, effFreq4GR=0.0, effFreq4PH=0.0, effFreq4RT=0.0;
5451  //
5452 // if (cppSoft == SgVlbiSessionInfo::CPPS_HOPS)
5453 
5454  if (*(adPhcFrq + bndIdx) /*&& !r8Data_.contains(adUnPhaseCl_.getLCode())*/)
5455  o->calcPhaseCalDelay();
5456 
5457  if (expectedStyle_ == ACS_NATIVE)
5458  {
5459  if (*(adPhcFrq + bndIdx) && !r8Data_.contains(adUnPhaseCl_.getLCode()))
5460  o->calcPhaseCalDelay();
5461  if (!r8Data_.contains(adEffFreq_.getLCode()))
5462  {
5463  if (numOfChannels)
5464  evaluateEffectiveFreqs(numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
5465  fringeAmplitudeByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
5466  sampleRate, o->getReferenceFrequency(), numOfChannels,
5467  effFreq4GR, effFreq4PH, effFreq4RT, band->getCorrelatorType(), o->strId());
5468  else
5469  effFreq4GR = effFreq4PH = effFreq4RT = o->getReferenceFrequency();
5470  o->grDelay().setEffFreq(effFreq4GR);
5471  o->phDelay().setEffFreq(effFreq4PH);
5472  o->phDRate().setEffFreq(effFreq4RT);
5473  //
5474  if (numOfChannels)
5475  evaluateEffectiveFreqs(numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
5476  fringeAmplitudeByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
5477  sampleRate, o->getReferenceFrequency(), numOfChannels,
5478  effFreq4GR, effFreq4PH, effFreq4RT, band->getCorrelatorType(), o->strId(), true);
5479  o->grDelay().setEffFreqEqWgt(effFreq4GR);
5480  o->phDelay().setEffFreqEqWgt(effFreq4PH);
5481  o->phDRate().setEffFreqEqWgt(effFreq4RT);
5482  };
5483  }
5484  else if (cppSoft==SgVlbiSessionInfo::CPPS_PIMA)
5485  {
5486 // ...
5487  }
5488  else
5489  {
5490 
5491  };
5492 
5493 
5494  //
5495  if (i2Data_.contains(adStrtOffst_.getLCode()))
5496  o->setStartOffset(i2Data_.value(adStrtOffst_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5497  if (i2Data_.contains(adStopOffst_.getLCode()))
5498  o->setStopOffset(i2Data_.value(adStopOffst_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5499 
5500  if (c1Data_.contains(adTapQcode_.getLCode()))
5501  o->setTapeQualityCode(c1Data_.value(adTapQcode_.getLCode())->value(bndIdx, obsIdx, 0));
5502 
5503  if (i2Data_.contains(adHopsVer_.getLCode()))
5504  o->setHopsRevisionNumber(i2Data_.value(adHopsVer_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5505 
5506  if (i2Data_.contains(adFourFtVer_.getLCode()))
5507  {
5508  o->setFourfitVersion(0,
5509  i2Data_.value(adFourFtVer_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5510  o->setFourfitVersion(1,
5511  i2Data_.value(adFourFtVer_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5512  }
5513  else
5514  {
5515  o->setFourfitVersion(0, 0);
5516  o->setFourfitVersion(1, 0);
5517  };
5518 
5519  if (i2Data_.contains(adScanUtc_.getLCode()))
5520  {
5521  nYear = i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 0, obsIdx, 0);
5522  nMonth= i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 1, obsIdx, 0);
5523  nDay = i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 2, obsIdx, 0);
5524  nHour = i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 3, obsIdx, 0);
5525  nMin = i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 4, obsIdx, 0);
5526  dSec = i2Data_.value(adScanUtc_.getLCode())->value(bndIdx, 5, obsIdx, 0);
5527  o->setEpochOfScan(SgMJD(nYear, nMonth, nDay, nHour, nMin, dSec));
5528  };
5529  if (i2Data_.contains(adUtcMtag_.getLCode()))
5530  {
5531  nYear = i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 0, obsIdx, 0);
5532  nMonth= i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 1, obsIdx, 0);
5533  nDay = i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 2, obsIdx, 0);
5534  nHour = i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 3, obsIdx, 0);
5535  nMin = i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 4, obsIdx, 0);
5536  dSec = i2Data_.value(adUtcMtag_.getLCode())->value(bndIdx, 5, obsIdx, 0);
5537  o->setEpochCentral(SgMJD(nYear, nMonth, nDay, nHour, nMin, dSec));
5538  };
5539  if (i2Data_.contains(adCorrUtc_.getLCode()))
5540  {
5541  nYear = i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 0, obsIdx, 0);
5542  nMonth= i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 1, obsIdx, 0);
5543  nDay = i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 2, obsIdx, 0);
5544  nHour = i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 3, obsIdx, 0);
5545  nMin = i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 4, obsIdx, 0);
5546  dSec = i2Data_.value(adCorrUtc_.getLCode())->value(bndIdx, 5, obsIdx, 0);
5547  o->setEpochOfCorrelation(SgMJD(nYear, nMonth, nDay, nHour, nMin, dSec));
5548  };
5549  if (i2Data_.contains(adFourUtc_.getLCode()))
5550  {
5551  nYear = i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 0, obsIdx, 0);
5552  nMonth= i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 1, obsIdx, 0);
5553  nDay = i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 2, obsIdx, 0);
5554  nHour = i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 3, obsIdx, 0);
5555  nMin = i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 4, obsIdx, 0);
5556  dSec = i2Data_.value(adFourUtc_.getLCode())->value(bndIdx, 5, obsIdx, 0);
5557  o->setEpochOfFourfitting(SgMJD(nYear, nMonth, nDay, nHour, nMin, dSec));
5558  };
5559  //
5560 //std::cout << " -- 5 band \n";
5561  // start & stop seconds:
5562  if (r8Data_.contains(adStartSec_.getLCode()) && r8Data_.contains(adStopSec_.getLCode()))
5563  {
5564  SgMJD::MJD_reverse(o->owner()->getDate(), o->owner()->getTime(),
5565  nYear, nMonth, nDay, nHour, nMin, dSec);
5566 
5567  tStart = SgMJD(nYear, nMonth, nDay, nHour, 0,
5568  r8Data_.value(adStartSec_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5569  tStop = SgMJD(nYear, nMonth, nDay, nHour, 0,
5570  r8Data_.value(adStopSec_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5571  if (tStart - *o->owner() > 40.0/24.0/60.0)
5572  tStart -= 1.0/24.0;
5573  if (*o->owner() - tStart > 40.0/24.0/60.0)
5574  tStart += 1.0/24.0;
5575  if (*o->owner() - tStop > 40.0/24.0/60.0)
5576  tStop += 1.0/24.0;
5577  if (tStop - *o->owner() > 40.0/24.0/60.0)
5578  tStop -= 1.0/24.0;
5579  if (tStart < tStop)
5580  {
5581  o->setTstart(tStart);
5582  o->setTstop (tStop);
5583  }
5584  else
5585  {
5586  o->setTstart(tStop);
5587  o->setTstop (tStart);
5588  };
5589  };
5590  //
5591  if (r8Data_.contains(adQbFactor_.getLCode()))
5592  o->setAcceptedRatio(
5593  r8Data_.value(adQbFactor_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5594  if (r8Data_.contains(adDiscard_.getLCode()))
5595  o->setDiscardRatio(
5596  r8Data_.value(adDiscard_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5597  if (r8Data_.contains(adDeltaEpo_.getLCode()))
5598  o->setCentrOffset(
5599  r8Data_.value(adDeltaEpo_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5600 
5601  if (r8Data_.contains(adGcPhsRes_.getLCode()))
5603  r8Data_.value(adGcPhsRes_.getLCode())->value(bndIdx, 0, obsIdx, 0)/RAD2DEG);
5604  if (r8Data_.contains(adGcPhase_.getLCode()))
5606  r8Data_.value(adGcPhase_.getLCode())->value(bndIdx, 0, obsIdx, 0)/RAD2DEG);
5607 
5608  if (r8Data_.contains(adGcSbDel_.getLCode()))
5610  r8Data_.value(adGcSbDel_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5611  if (r8Data_.contains(adGcMbDel_.getLCode()))
5613  r8Data_.value(adGcMbDel_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5614  if (r8Data_.contains(adGcRate_.getLCode()))
5616  r8Data_.value(adGcRate_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5617  if (r8Data_.contains(adSbResid_.getLCode()))
5619  r8Data_.value(adSbResid_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5620  if (r8Data_.contains(adGrResid_.getLCode()))
5622  r8Data_.value(adGrResid_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5623  if (r8Data_.contains(adRtResid_.getLCode()))
5625  r8Data_.value(adRtResid_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5626 
5627  if (r8Data_.contains(adFalseDet_.getLCode()))
5629  r8Data_.value(adFalseDet_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5630 
5631  if (r8Data_.contains(adAprioriDl_.getLCode()) && (pD=r8Data_.value(adAprioriDl_.getLCode())))
5632  o->setAprioriDra(0, pD->value(bndIdx, 0, obsIdx, 0));
5633  else if (r8Data_.contains(adAprDel_.getLCode()) && (pD=r8Data_.value(adAprDel_.getLCode())))
5634  o->setAprioriDra(0, pD->value(bndIdx, 0, obsIdx, 0));
5635  if (r8Data_.contains(adAprioriRt_.getLCode()) && (pD=r8Data_.value(adAprioriRt_.getLCode())))
5636  o->setAprioriDra(1, pD->value(bndIdx, 0, obsIdx, 0));
5637  else if (r8Data_.contains(adAprRate_.getLCode()) && (pD=r8Data_.value(adAprRate_.getLCode())))
5638  o->setAprioriDra(1, pD->value(bndIdx, 0, obsIdx, 0));
5639 
5640 
5641  if (r8Data_.contains(adAprioriAc_.getLCode()))
5642  o->setAprioriDra(2,
5643  r8Data_.value(adAprioriAc_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5644 
5645 
5646 
5647 
5648 
5649  if (r8Data_.contains(adIncohAmp_.getLCode()))
5650  o->setIncohChanAddAmp(
5651  r8Data_.value(adIncohAmp_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5652  if (r8Data_.contains(adIncohAmp2_.getLCode()))
5653  o->setIncohSegmAddAmp(
5654  r8Data_.value(adIncohAmp2_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5655 
5656  if (r8Data_.contains(adUrVr_.getLCode()))
5657  {
5658  o->setUrVr(0,
5659  r8Data_.value(adUrVr_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5660  o->setUrVr(1,
5661  r8Data_.value(adUrVr_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5662  };
5663  if (r8Data_.contains(adFeedCor_.getLCode()))
5664  {
5665  o->setCalcFeedCorrDelay(r8Data_.value(adFeedCor_.getLCode())->value(0, bndIdx, obsIdx, 0));
5666  o->setCalcFeedCorrRate (r8Data_.value(adFeedCor_.getLCode())->value(1, bndIdx, obsIdx, 0));
5667  };
5668  if (r8Data_.contains(adIdelay_.getLCode()))
5669  {
5670  o->setInstrDelay(0,
5671  r8Data_.value(adIdelay_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5672  o->setInstrDelay(1,
5673  r8Data_.value(adIdelay_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5674  };
5675  for (int j=0; j<6; j++)
5676  if (r8Data_.contains(adSrchPar_.getLCode()))
5678  r8Data_.value(adSrchPar_.getLCode())->value(bndIdx, j, obsIdx, 0));
5679  else
5680  o->setFourfitSearchParameters(j, 0);
5681 //std::cout << " -- 6 band \n";
5682 
5683  if (r8Data_.contains(adCorrClock_.getLCode()))
5684  {
5685  o->setCorrClocks(0, 0,
5686  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5687  o->setCorrClocks(0, 1,
5688  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5689  o->setCorrClocks(1, 0,
5690  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 2, obsIdx, 0));
5691  o->setCorrClocks(1, 1,
5692  r8Data_.value(adCorrClock_.getLCode())->value(bndIdx, 3, obsIdx, 0));
5693  };
5694 
5695  if (r8Data_.contains(adAprCloOf_.getLCode()) && (pD=r8Data_.value(adAprCloOf_.getLCode())))
5696  {
5698  if (pD2)
5699  {
5700  o->setCorrClocks(0, 0,
5701  pD->value(0, 0, station1Info->auxObservationByScanId()->size()-1, stn_1Idx));
5702  o->setCorrClocks(0, 1,
5703  pD->value(0, 0, station2Info->auxObservationByScanId()->size()-1, stn_2Idx));
5704  o->setCorrClocks(1, 0,
5705  pD2->value(0, 0, station1Info->auxObservationByScanId()->size()-1, stn_1Idx));
5706  o->setCorrClocks(1, 1,
5707  pD2->value(0, 0, station2Info->auxObservationByScanId()->size()-1, stn_2Idx));
5708  };
5709  };
5710 
5711  if (c1Data_.contains(adCorBasCd_.getLCode()) &&
5712  c1Data_.value(adCorBasCd_.getLCode())->value(bndIdx, obsIdx, 0).size() == 2)
5713  {
5714  char cid;
5715  cid = c1Data_.value(adCorBasCd_.getLCode())->value(bndIdx, obsIdx, 0).at(0).toLatin1();
5716 
5717  if (station1Info->getCid() == ' ')
5718  {
5719  station1Info->setCid(cid);
5721  "::initSession(): station#1 " + station1Info->getKey() + " set CID to \"" +
5722  cid + "\" at " + o->strId());
5723  }
5724  else if (station1Info->getCid() != cid)
5725  {
5727  "::initSession(): station#1 " + station1Info->getKey() + " CID missmatch: \"" +
5728  station2Info->getCid() + "\" vs \"" + cid + "\" at " + o->strId());
5729  };
5730 
5731  cid = c1Data_.value(adCorBasCd_.getLCode())->value(bndIdx, obsIdx, 0).at(1).toLatin1();
5732  if (station2Info->getCid() == ' ')
5733  {
5734  station2Info->setCid(cid);
5736  "::initSession(): station#2 " + station2Info->getKey() + " set CID to \"" +
5737  cid + "\" at " + o->strId());
5738  }
5739  else if (station2Info->getCid() != cid)
5740  {
5742  "::initSession(): station#2 " + station2Info->getKey() + " CID missmatch: \"" +
5743  station2Info->getCid() + "\" vs \"" + cid + "\" at " + o->strId());
5744  };
5745  };
5746  if (r8Data_.contains(adZdelay_.getLCode()))
5747  {
5748  o->setCorrelZdelay_1(r8Data_.value(adZdelay_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5749  o->setCorrelZdelay_2(r8Data_.value(adZdelay_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5750  };
5751  if (r8Data_.contains(adStarElev_.getLCode()))
5752  {
5753  o->setCorrelStarElev_1(r8Data_.value(adStarElev_.getLCode())->value(bndIdx, 0, obsIdx, 0));
5754  o->setCorrelStarElev_2(r8Data_.value(adStarElev_.getLCode())->value(bndIdx, 1, obsIdx, 0));
5755  };
5756  //
5757  // per band statistics:
5758  band->incNumTotal(DT_DELAY);
5759  band->incNumTotal(DT_RATE);
5760  bandStation1Info->incNumTotal(DT_DELAY);
5761  bandStation1Info->incNumTotal(DT_RATE);
5762  bandStation2Info->incNumTotal(DT_DELAY);
5763  bandStation2Info->incNumTotal(DT_RATE);
5764  bandSourceInfo->incNumTotal(DT_DELAY);
5765  bandSourceInfo->incNumTotal(DT_RATE);
5766  bandBaselineInfo->incNumTotal(DT_DELAY);
5767  bandBaselineInfo->incNumTotal(DT_RATE);
5768  }
5769  else
5771  "::initSession(): skipped observable #" + QString("").setNum(obsIdx) +
5772  " at the " + bandKey + "-band: no data");
5773  //
5774  //
5775  };// end of band iteration
5776  //
5777  //
5778 //std::cout << " -- 7 \n";
5779  //
5780  //
5781  //
5782  //4CALC:
5783  if (r8Data_.contains(adConsnDel_.getLCode()))
5784  obs->setCalcConsensusDelay(
5785  r8Data_.value(adConsnDel_.getLCode())->value(0, 0, obsIdx, 0));
5786  if (r8Data_.contains(adConsnRat_.getLCode()))
5787  obs->setCalcConsensusRate(
5788  r8Data_.value(adConsnRat_.getLCode())->value(0, 0, obsIdx, 0));
5789  if (r8Data_.contains(adCtSite1_.getLCode()))
5790  obs->setFractC(
5791  r8Data_.value(adCtSite1_.getLCode())->value(0, 0, obsIdx, 0));
5792 
5793  // contributions:
5794 
5795  if (r8Data_.contains(adEtdCont_.getLCode()))
5796  {
5797  obs->setCalcEarthTideDelay(r8Data_.value(adEtdCont_.getLCode())->value(0, 0, obsIdx, 0));
5798  obs->setCalcEarthTideRate (r8Data_.value(adEtdCont_.getLCode())->value(1, 0, obsIdx, 0));
5799  };
5800  if (r8Data_.contains(adOceCont_.getLCode()))
5801  {
5802  obs->setCalcOceanTideDelay(r8Data_.value(adOceCont_.getLCode())->value(0, 0, obsIdx, 0));
5803  obs->setCalcOceanTideRate (r8Data_.value(adOceCont_.getLCode())->value(1, 0, obsIdx, 0));
5804  };
5805  if (r8Data_.contains(adOceOld_.getLCode()))
5806  {
5807  obs->setCalcOceanTideOldDelay(r8Data_.value(adOceOld_.getLCode())->value(0, 0, obsIdx, 0));
5808  obs->setCalcOceanTideOldRate (r8Data_.value(adOceOld_.getLCode())->value(1, 0, obsIdx, 0));
5809  };
5810  if (r8Data_.contains(adOptlCont_.getLCode()))
5811  {
5812  obs->setCalcOceanPoleTideLdDelay(r8Data_.value(adOptlCont_.getLCode())->value(0, 0, obsIdx, 0));
5813  obs->setCalcOceanPoleTideLdRate (r8Data_.value(adOptlCont_.getLCode())->value(1, 0, obsIdx, 0));
5814  };
5815  if (r8Data_.contains(adPtdCont_.getLCode()))
5816  {
5817  obs->setCalcPoleTideDelay(r8Data_.value(adPtdCont_.getLCode())->value(0, 0, obsIdx, 0));
5818  obs->setCalcPoleTideRate (r8Data_.value(adPtdCont_.getLCode())->value(1, 0, obsIdx, 0));
5819  };
5820  if (r8Data_.contains(adPtoLdCon_.getLCode()))
5821  {
5822  obs->setCalcPoleTideOldDelay(r8Data_.value(adPtoLdCon_.getLCode())->value(0, 0, obsIdx, 0));
5823  obs->setCalcPoleTideOldRate (r8Data_.value(adPtoLdCon_.getLCode())->value(1, 0, obsIdx, 0));
5824  };
5825  if (r8Data_.contains(adTiltRmvr_.getLCode()))
5826  {
5827  obs->setCalcTiltRemvrDelay(r8Data_.value(adTiltRmvr_.getLCode())->value(0, 0, obsIdx, 0));
5828  obs->setCalcTiltRemvrRate (r8Data_.value(adTiltRmvr_.getLCode())->value(1, 0, obsIdx, 0));
5829  };
5830  if (r8Data_.contains(adUt1Ortho_.getLCode()))
5831  {
5832  obs->setCalcHiFyUt1Delay(r8Data_.value(adUt1Ortho_.getLCode())->value(0, 0, obsIdx, 0));
5833  obs->setCalcHiFyUt1Rate (r8Data_.value(adUt1Ortho_.getLCode())->value(1, 0, obsIdx, 0));
5834  };
5835  if (r8Data_.contains(adWobOrtho_.getLCode()))
5836  {
5837  obs->setCalcHiFyPxyDelay(r8Data_.value(adWobOrtho_.getLCode())->value(0, 0, obsIdx, 0));
5838  obs->setCalcHiFyPxyRate (r8Data_.value(adWobOrtho_.getLCode())->value(1, 0, obsIdx, 0));
5839  };
5840  if (r8Data_.contains(adUt1Libra_.getLCode()))
5841  {
5842  obs->setCalcHiFyUt1LibrationDelay(r8Data_.value(adUt1Libra_.getLCode())->value(0, 0, obsIdx, 0));
5843  obs->setCalcHiFyUt1LibrationRate (r8Data_.value(adUt1Libra_.getLCode())->value(1, 0, obsIdx, 0));
5844  };
5845  if (r8Data_.contains(adWobLibra_.getLCode()))
5846  {
5847  obs->setCalcHiFyPxyLibrationDelay(r8Data_.value(adWobLibra_.getLCode())->value(0, 0, obsIdx, 0));
5848  obs->setCalcHiFyPxyLibrationRate (r8Data_.value(adWobLibra_.getLCode())->value(1, 0, obsIdx, 0));
5849  };
5850  if (r8Data_.contains(adWobXcont_.getLCode()))
5851  {
5852  obs->setCalcPxDelay(r8Data_.value(adWobXcont_.getLCode())->value(0, 0, obsIdx, 0));
5853  obs->setCalcPxRate (r8Data_.value(adWobXcont_.getLCode())->value(1, 0, obsIdx, 0));
5854  };
5855  if (r8Data_.contains(adWobYcont_.getLCode()))
5856  {
5857  obs->setCalcPyDelay(r8Data_.value(adWobYcont_.getLCode())->value(0, 0, obsIdx, 0));
5858  obs->setCalcPyRate (r8Data_.value(adWobYcont_.getLCode())->value(1, 0, obsIdx, 0));
5859  };
5860  if (r8Data_.contains(adConCont_.getLCode()))
5861  {
5862  obs->setCalcConsBendingDelay(r8Data_.value(adConCont_.getLCode())->value(0, 0, obsIdx, 0));
5863  obs->setCalcConsBendingRate (r8Data_.value(adConCont_.getLCode())->value(1, 0, obsIdx, 0));
5864  };
5865  if (r8Data_.contains(adSunCont_.getLCode()))
5866  {
5867  obs->setCalcConsBendingSunDelay(r8Data_.value(adSunCont_.getLCode())->value(0, 0, obsIdx, 0));
5868  obs->setCalcConsBendingSunRate (r8Data_.value(adSunCont_.getLCode())->value(1, 0, obsIdx, 0));
5869  };
5870  if (r8Data_.contains(adSun2cont_.getLCode()))
5871  {
5872  obs->setCalcConsBendingSunHigherDelay(r8Data_.value(adSun2cont_.getLCode())->value(0, 0, obsIdx, 0));
5873  obs->setCalcConsBendingSunHigherRate (r8Data_.value(adSun2cont_.getLCode())->value(1, 0, obsIdx, 0));
5874  };
5875  if (r8Data_.contains(adPlx1pSec_.getLCode()))
5876  {
5877  obs->setDdel_dParallaxRev(r8Data_.value(adPlx1pSec.getLCode())->value(0, 0, obsIdx, 0));
5878  obs->setDrat_dParallaxRev(r8Data_.value(adPlx1pSec.getLCode())->value(1, 0, obsIdx, 0));
5879  };
5880 
5881  if (r8Data_.contains(adBendPart_.getLCode()))
5882  {
5883  obs->setDdel_dBend(r8Data_.value(adBendPart_.getLCode())->value(0, 0, obsIdx, 0));
5884  obs->setDrat_dBend(r8Data_.value(adBendPart_.getLCode())->value(1, 0, obsIdx, 0));
5885  };
5886  if (r8Data_.contains(adWobPart_.getLCode()))
5887  {
5888  obs->setDdel_dPx(r8Data_.value(adWobPart_.getLCode())->value(0, 0, obsIdx, 0));
5889  obs->setDrat_dPx(r8Data_.value(adWobPart_.getLCode())->value(1, 0, obsIdx, 0));
5890  obs->setDdel_dPy(r8Data_.value(adWobPart_.getLCode())->value(0, 1, obsIdx, 0));
5891  obs->setDrat_dPy(r8Data_.value(adWobPart_.getLCode())->value(1, 1, obsIdx, 0));
5892  };
5893  if (r8Data_.contains(adUt1Part_.getLCode()))
5894  {
5895  obs->setDdel_dUT1(r8Data_.value(adUt1Part_.getLCode())->value(0, 0, obsIdx, 0)*86400.0);
5896  obs->setDrat_dUT1(r8Data_.value(adUt1Part_.getLCode())->value(1, 0, obsIdx, 0)*86400.0);
5897  obs->setD2del_dUT12(r8Data_.value(adUt1Part_.getLCode())->value(0, 1, obsIdx, 0));
5898  obs->setD2rat_dUT12(r8Data_.value(adUt1Part_.getLCode())->value(1, 1, obsIdx, 0));
5899  };
5900  if (r8Data_.contains(adConsPart_.getLCode()))
5901  {
5902  obs->setDdel_dGamma(r8Data_.value(adConsPart_.getLCode())->value(0, 0, obsIdx, 0));
5903  obs->setDrat_dGamma(r8Data_.value(adConsPart_.getLCode())->value(1, 0, obsIdx, 0));
5904  };
5905  if (r8Data_.contains(adNut06Xyp_.getLCode()))
5906  {
5907  obs->setDdel_dCipX(r8Data_.value(adNut06Xyp_.getLCode())->value(0, 0, obsIdx, 0));
5908  obs->setDrat_dCipX(r8Data_.value(adNut06Xyp_.getLCode())->value(1, 0, obsIdx, 0));
5909  obs->setDdel_dCipY(r8Data_.value(adNut06Xyp_.getLCode())->value(0, 1, obsIdx, 0));
5910  obs->setDrat_dCipY(r8Data_.value(adNut06Xyp_.getLCode())->value(1, 1, obsIdx, 0));
5911  };
5912  if (r8Data_.contains(adPlxPart_.getLCode()))
5913  {
5914  obs->setDdel_dParallax(r8Data_.value(adPlxPart_.getLCode())->value(0, 0, obsIdx, 0));
5915  obs->setDrat_dParallax(r8Data_.value(adPlxPart_.getLCode())->value(1, 0, obsIdx, 0));
5916  };
5917  if (r8Data_.contains(adPtdXyPar_.getLCode()))
5918  {
5919  obs->setDdel_dPolTideX(r8Data_.value(adPtdXyPar_.getLCode())->value(0, 0, obsIdx, 0));
5920  obs->setDrat_dPolTideX(r8Data_.value(adPtdXyPar_.getLCode())->value(1, 0, obsIdx, 0));
5921  obs->setDdel_dPolTideY(r8Data_.value(adPtdXyPar_.getLCode())->value(0, 1, obsIdx, 0));
5922  obs->setDrat_dPolTideY(r8Data_.value(adPtdXyPar_.getLCode())->value(1, 1, obsIdx, 0));
5923  };
5924  if (r8Data_.contains(adStrPart_.getLCode()))
5925  {
5926  obs->setDdel_dRA(r8Data_.value(adStrPart_.getLCode())->value(0, 0, obsIdx, 0));
5927  obs->setDrat_dRA(r8Data_.value(adStrPart_.getLCode())->value(1, 0, obsIdx, 0));
5928  obs->setDdel_dDN(r8Data_.value(adStrPart_.getLCode())->value(0, 1, obsIdx, 0));
5929  obs->setDrat_dDN(r8Data_.value(adStrPart_.getLCode())->value(1, 1, obsIdx, 0));
5930  };
5931  if (r8Data_.contains(adSitPart_.getLCode()))
5932  {
5933  Sg3dVector r(r8Data_.value(adSitPart_.getLCode())->value(0, 0, obsIdx, 0),
5934  r8Data_.value(adSitPart_.getLCode())->value(0, 1, obsIdx, 0),
5935  r8Data_.value(adSitPart_.getLCode())->value(0, 2, obsIdx, 0));
5936  obs->setDdel_dR_1( r);
5937  obs->setDdel_dR_2(-r);
5938 
5939  r = Sg3dVector( r8Data_.value(adSitPart_.getLCode())->value(1, 0, obsIdx, 0),
5940  r8Data_.value(adSitPart_.getLCode())->value(1, 1, obsIdx, 0),
5941  r8Data_.value(adSitPart_.getLCode())->value(1, 2, obsIdx, 0));
5942  obs->setDrat_dR_1( r);
5943  obs->setDrat_dR_2(-r);
5944  };
5945 
5946  // per scan data:
5947  //
5948  if (r8Data_.contains(adSunData_.getLCode()) && (pD=r8Data_.value(adSunData_.getLCode())))
5949  {
5950  obs->setRsun(Sg3dVector(pD->value(0, 0, scanIdx, 0),
5951  pD->value(0, 1, scanIdx, 0),
5952  pD->value(0, 2, scanIdx, 0)));
5953  obs->setVsun(Sg3dVector(pD->value(1, 0, scanIdx, 0),
5954  pD->value(1, 1, scanIdx, 0),
5955  pD->value(1, 2, scanIdx, 0)));
5956  };
5957  //
5958  if (r8Data_.contains(adMunData_.getLCode()) && (pD=r8Data_.value(adMunData_.getLCode())))
5959  {
5960  obs->setRmoon(Sg3dVector(pD->value(0, 0, scanIdx, 0),
5961  pD->value(0, 1, scanIdx, 0),
5962  pD->value(0, 2, scanIdx, 0)));
5963  obs->setVmoon(Sg3dVector(pD->value(1, 0, scanIdx, 0),
5964  pD->value(1, 1, scanIdx, 0),
5965  pD->value(1, 2, scanIdx, 0)));
5966  };
5967  //
5968  if (r8Data_.contains(adEarthCe_.getLCode()) && (pD=r8Data_.value(adEarthCe_.getLCode())))
5969  {
5970  obs->setRearth(Sg3dVector(pD->value(0, 0, scanIdx, 0),
5971  pD->value(0, 1, scanIdx, 0),
5972  pD->value(0, 2, scanIdx, 0)));
5973  obs->setVearth(Sg3dVector(pD->value(1, 0, scanIdx, 0),
5974  pD->value(1, 1, scanIdx, 0),
5975  pD->value(1, 2, scanIdx, 0)));
5976  obs->setAearth(Sg3dVector(pD->value(2, 0, scanIdx, 0),
5977  pD->value(2, 1, scanIdx, 0),
5978  pD->value(2, 2, scanIdx, 0)));
5979  };
5980  //
5981  if (r8Data_.contains(adNutWahr_.getLCode()) && (pD=r8Data_.value(adNutWahr_.getLCode())))
5982  {
5983  obs->setCalcNutWahr_dPsiV(pD->value(0, 0, scanIdx, 0));
5984  obs->setCalcNutWahr_dEpsV(pD->value(1, 0, scanIdx, 0));
5985  obs->setCalcNutWahr_dPsiR(pD->value(0, 1, scanIdx, 0));
5986  obs->setCalcNutWahr_dEpsR(pD->value(1, 1, scanIdx, 0));
5987  };
5988  if (r8Data_.contains(adNut2006a_.getLCode()) && (pD=r8Data_.value(adNut2006a_.getLCode())))
5989  {
5990  obs->setCalcNut2006_dPsiV(pD->value(0, 0, scanIdx, 0));
5991  obs->setCalcNut2006_dEpsV(pD->value(1, 0, scanIdx, 0));
5992  obs->setCalcNut2006_dPsiR(pD->value(0, 1, scanIdx, 0));
5993  obs->setCalcNut2006_dEpsR(pD->value(1, 1, scanIdx, 0));
5994  };
5995  if (r8Data_.contains(adNut06xys_.getLCode()) && (pD=r8Data_.value(adNut06xys_.getLCode())))
5996  {
5997  obs->setCalcCipXv(pD->value(0, 0, scanIdx, 0));
5998  obs->setCalcCipYv(pD->value(1, 0, scanIdx, 0));
5999  obs->setCalcCipSv(pD->value(2, 0, scanIdx, 0));
6000 
6001  obs->setCalcCipXr(pD->value(0, 1, scanIdx, 0));
6002  obs->setCalcCipYr(pD->value(1, 1, scanIdx, 0));
6003  obs->setCalcCipSr(pD->value(2, 1, scanIdx, 0));
6004  };
6005  if (r8Data_.contains(adCf2J2k_0_.getLCode()) && (pD=r8Data_.value(adCf2J2k_0_.getLCode())))
6006  for (int k=0; k<3; k++)
6007  for (int l=0; l<3; l++)
6008  obs->trf2crfVal()((DIRECTION)k, (DIRECTION)l) = pD->value(k, l, scanIdx, 0);
6009  if (r8Data_.contains(adCf2J2k_1_.getLCode()) && (pD=r8Data_.value(adCf2J2k_1_.getLCode())))
6010  for (int k=0; k<3; k++)
6011  for (int l=0; l<3; l++)
6012  obs->trf2crfRat()((DIRECTION)k, (DIRECTION)l) = pD->value(k, l, scanIdx, 0);
6013  if (r8Data_.contains(adCf2J2k_2_.getLCode()) && (pD=r8Data_.value(adCf2J2k_2_.getLCode())))
6014  for (int k=0; k<3; k++)
6015  for (int l=0; l<3; l++)
6016  obs->trf2crfAcc()((DIRECTION)k, (DIRECTION)l) = pD->value(k, l, scanIdx, 0);
6017 
6018  if (r8Data_.contains(adUt1_tai_.getLCode()) && (pD=r8Data_.value(adUt1_tai_.getLCode())))
6019  obs->setCalcUt1_Tai(pD->value(0, 0, scanIdx, 0));
6020  if (r8Data_.contains(adPolarXy_.getLCode()) && (pD=r8Data_.value(adPolarXy_.getLCode())))
6021  {
6022  obs->setCalcPmX(pD->value(0, 0, scanIdx, 0));
6023  obs->setCalcPmY(pD->value(1, 0, scanIdx, 0));
6024  };
6025  //-----> end of calc
6026 
6027  // cumulative statistics (do we need it?):
6028  station1Info->incNumTotal(DT_DELAY);
6029  station2Info->incNumTotal(DT_DELAY);
6030  sourceInfo ->incNumTotal(DT_DELAY);
6031  baselineInfo->incNumTotal(DT_DELAY);
6032 
6033  station1Info->incNumTotal(DT_RATE);
6034  station2Info->incNumTotal(DT_RATE);
6035  sourceInfo ->incNumTotal(DT_RATE);
6036  baselineInfo->incNumTotal(DT_RATE);
6037  };// end of obs iteration
6038  //
6039  if (frqByChanNum)
6040  {
6041  delete[] frqByChanNum;
6042  frqByChanNum = NULL;
6043  };
6044  //
6045 
6046  //
6047  for (int i=0; i<numOfBands_; i++)
6048  {
6049  band = session_->bands().at(i);
6050  bandKey = band->getKey();
6051  n = 0;
6052  o = session_->observations().at(n)->observable(bandKey);
6053  while (!o && n<session_->observations().size())
6054  o = session_->observations().at(n++)->observable(bandKey);
6055  if (o)
6056  band->setFrequency(o->getReferenceFrequency());
6057  //
6058  // histories:
6059  if (band->history().size())
6060  {
6061  for (int j=0; j<band->history().size(); j++)
6062  delete band->history().at(j);
6063  band->history().clear();
6065  ": initSession(): history of the band " + bandKey + " has been cleared");
6066  };
6067  // pick up history records:
6068  n = 0;
6069  for (int cIdx=0; cIdx<size(); cIdx++)
6070  {
6071  for (int j=0; j<at(cIdx)->history().size(); j++)
6072  {
6073 /*
6074  SgVlbiHistoryRecord *rec=at(cIdx)->history().at(j);
6075  if (rec->getVersion() < 0)
6076  n = cIdx;
6077  else
6078  n = rec->getVersion();
6079  band->history().append(new SgVlbiHistoryRecord(rec->getEpoch(), n, rec->getText()));
6080 */
6081  band->history().append(new SgVlbiHistoryRecord(*at(cIdx)->history().at(j)));
6082  };
6083  };
6084  n = 1;
6085  if (!band->history().isEmpty())
6086  n = band->history().last()->getVersion();
6087  else
6089  "::initSession(): no history records exist for the band " + bandKey);
6090  // put fingerprint: (should it be here?)
6091 // band->history().append(new SgVlbiHistoryRecord(SgMJD::currentMJD().toUtc(), n,
6092 // libraryVersion.name() + ": data have been read from vgosDa file"));
6093  band->setInputFileVersion(n);
6094  };
6095  //
6096  //
6097 
6098  //4CALC:
6099  if (!session_->calcInfo().ut1InterpData())
6100  {
6101  session_->calcInfo().ut1InterpData() = new SgMatrix(1, 2);
6102  };
6103  if (!session_->calcInfo().wobInterpData())
6104  {
6105  session_->calcInfo().wobInterpData() = new SgMatrix(1, 2);
6106  };
6107 
6108  //4CALC:
6109  if (c1Data_.contains(adCalcFlgN_.getLCode()) && i2Data_.contains(adCalcFlgV_.getLCode()))
6110  {
6111  n = datumByKey_.value(adCalcFlgN_.getLCode())->d2();
6112  QList<int>* flagVals =&session_->calcInfo().controlFlagValues();
6114  flagVals->clear();
6115  flagNames->clear();
6116  for (int i=0; i<n; i++)
6117  {
6118  flagVals->append(i2Data_.value(adCalcFlgV_.getLCode())->value(i, 0, 0, 0));
6119  flagNames->append(c1Data_.value(adCalcFlgN_.getLCode())->value(i, 0, 0));
6120  };
6121  };
6122 
6123  if (i2Data_.contains(adTidalUt1_.getLCode()))
6124  session_->calcInfo().setFlagTidalUt1(i2Data_.value(adTidalUt1_.getLCode())->value(0, 0, 0, 0));
6125  if (r8Data_.contains(adCalcVer_.getLCode()))
6126  session_->calcInfo().setDversion(r8Data_.value(adCalcVer_.getLCode())->value(0, 0, 0, 0));
6127  if (r8Data_.contains(adRelData_.getLCode()))
6128  session_->calcInfo().setRelativityData(r8Data_.value(adRelData_.getLCode())->value(0, 0, 0, 0));
6129  if (r8Data_.contains(adPreData_.getLCode()))
6130  session_->calcInfo().setPrecessionData(r8Data_.value(adPreData_.getLCode())->value(0, 0, 0, 0));
6131  if (r8Data_.contains(adEtdData_.getLCode()))
6132  {
6133  session_->calcInfo().setEarthTideData(0, r8Data_.value(adEtdData_.getLCode())->value(0, 0, 0, 0));
6134  session_->calcInfo().setEarthTideData(1, r8Data_.value(adEtdData_.getLCode())->value(1, 0, 0, 0));
6135  session_->calcInfo().setEarthTideData(2, r8Data_.value(adEtdData_.getLCode())->value(2, 0, 0, 0));
6136  };
6137  //
6143  session_->calcInfo().earthTide());
6145  session_->calcInfo().poleTide());
6147  session_->calcInfo().nutation());
6155  session_->calcInfo().parallax());
6157  session_->calcInfo().star());
6160 
6161  if (c1Data_.contains(adSitMess_.getLCode()))
6162  session_->calcInfo().site().setDefinition(c1Data_.value(adSitMess_.getLCode())->value(0, 0, 0));
6163  if (c1Data_.contains(adPanMess_.getLCode()))
6164  session_->calcInfo().feedHorn().setDefinition(c1Data_.value(adPanMess_.getLCode())->value(0, 0, 0));
6165  if (c1Data_.contains(adPepMess_.getLCode()))
6166  session_->calcInfo().ephemeris().setDefinition(c1Data_.value(adPepMess_.getLCode())->value(0, 0, 0));
6167  if (c1Data_.contains(adWobCflg_.getLCode()))
6169  c1Data_.value(adWobCflg_.getLCode())->value(0, 0, 0));
6170  if (c1Data_.contains(adUt1Cflg_.getLCode()))
6171  session_->calcInfo().ut1().setControlFlag(c1Data_.value(adUt1Cflg_.getLCode())->value(0, 0, 0));
6172 
6173  if (c1Data_.contains(adOceStat_.getLCode()))
6174  {
6175  session_->calcInfo().oLoadStationStatus().clear();
6176  n = datumByKey_.value(adOceStat_.getLCode())->d2();
6177  for (int i=0; i<n; i++)
6179  append(c1Data_.value(adOceStat_.getLCode())->value(i, 0, 0));
6180  };
6181 
6182  if (r8Data_.contains(adSiteZens_.getLCode()))
6183  {
6184  session_->calcInfo().siteZenDelays().clear();
6185  n = datumByKey_.value(adSiteZens_.getLCode())->d1();
6186  for (int i=0; i<n; i++)
6188  append(r8Data_.value(adSiteZens_.getLCode())->value(i, 0, 0, 0));
6189  };
6190 
6191  if (r8Data_.contains(adUt1Epoch_.getLCode()))
6192  {
6193  n = datumByKey_.value(adUt1Epoch_.getLCode())->d2();
6195  for (unsigned int i=0; i<session_->calcInfo().ut1InterpData()->nRow(); i++)
6196  for (unsigned int j=0; j<session_->calcInfo().ut1InterpData()->nCol(); j++)
6198  r8Data_.value(adUt1Epoch_.getLCode())->value(j, i, 0, 0));
6199  };
6200  //
6201  if (r8Data_.contains(adWobEpoch_.getLCode()))
6202  {
6203  n = datumByKey_.value(adWobEpoch_.getLCode())->d2();
6205  for (unsigned int i=0; i<session_->calcInfo().wobInterpData()->nRow(); i++)
6206  for (unsigned int j=0; j<session_->calcInfo().wobInterpData()->nCol(); j++)
6208  r8Data_.value(adWobEpoch_.getLCode())->value(j, i, 0, 0));
6209  };
6210 
6211  //
6212  //
6213  // end of phase 1 / skeleton
6214  // figure out the index of "CABL_DEL":
6215  int cableCalFlagIdx;
6216  bool isCableCalMatched=false;
6217  cableCalFlagIdx = -1;
6218  if (c1Data_.contains(adStnCalNam_.getLCode()))
6219  {
6220  n = datumByKey_.value(adStnCalNam_.getLCode())->d2();
6221  for (int i=0; i<n; i++)
6222  if (c1Data_.value(adStnCalNam_.getLCode())->value(i, 0, 0) == "CABL_DEL")
6223  {
6224  isCableCalMatched = true;
6225  cableCalFlagIdx = i;
6226  };
6227  };
6228 
6229 
6230  //
6231  //
6232  // phase 2, stations:
6233  Sg3dVector v3;
6234  for (int stnIdx=0; stnIdx<numOfStn_; stnIdx++) // use station order from the input file
6235  {
6236  const QString stnName(stnNames_.at(stnIdx));
6237  SgVlbiStationInfo *stn=session_->stationsByName().value(stnName);
6238  if (stn)
6239  {
6240  //int nObs=numOfObsByStn_[stnName];
6241  int obsIdx=0;
6242  bool hasMeteoT, hasMeteoP, hasMeteoR, hasMeteo, hasCable;
6243  hasMeteoT = r8Data_.contains(adAirTemp_.getLCode());
6244  hasMeteoP = r8Data_.contains(adAirPress_.getLCode());
6245  hasMeteoR = r8Data_.contains(adRelHumd_.getLCode());
6246  hasMeteo = hasMeteoT || hasMeteoP || hasMeteoR;
6247  hasCable = r8Data_.contains(adCableDel_.getLCode());
6248  //
6249  if (hasMeteo)
6250  {
6253  //
6255  stn->setCableCalsOriginTxt("Data are from somewhere");
6256  };
6257  if (hasCable)
6258  {
6261  //:
6263  stn->setCableCalsOriginTxt("Data are from somewhere");
6264  };
6265  //
6266  for (QMap<QString, SgVlbiAuxObservation*>::iterator jt=stn->auxObservationByScanId()->begin();
6267  jt!=stn->auxObservationByScanId()->end(); ++jt, obsIdx++)
6268  {
6269  SgVlbiAuxObservation *auxObs=jt.value();
6270  if (hasMeteoT)
6271  auxObs->meteoData().setTemperature(
6272  r8Data_.value(adAirTemp_.getLCode())->value(0, 0, obsIdx, stnIdx) - 273.15);
6273  if (hasMeteoP)
6274  auxObs->meteoData().setPressure(
6275  r8Data_.value(adAirPress_.getLCode())->value(0, 0, obsIdx, stnIdx)/100.0);
6276  if (hasMeteoR)
6277  auxObs->meteoData().setRelativeHumidity(
6278  r8Data_.value(adRelHumd_.getLCode())->value(0, 0, obsIdx, stnIdx));
6279 
6280  if (hasCable)
6281  auxObs->setCableCalibration(
6282  r8Data_.value(adCableDel_.getLCode())->value(0, 0, obsIdx, stnIdx));
6283 
6284  //4CALC:
6285  if (r8Data_.contains(adElTheo_.getLCode()) && (pD=r8Data_.value(adElTheo_.getLCode())))
6286  {
6287  auxObs->setElevationAngle (pD->value(0, 0, obsIdx, stnIdx));
6288  auxObs->setElevationAngleRate (pD->value(1, 0, obsIdx, stnIdx));
6289  }
6290  else if (r8Data_.contains(adElev_.getLCode()) && (pD=r8Data_.value(adElev_.getLCode())))
6291  auxObs->setElevationAngle (pD->value(0, 0, obsIdx, stnIdx));
6292 
6293  if (r8Data_.contains(adAzTheo_.getLCode()) && (pD=r8Data_.value(adAzTheo_.getLCode())))
6294  {
6295  auxObs->setAzimuthAngle (pD->value(0, 0, obsIdx, stnIdx));
6296  auxObs->setAzimuthAngleRate (pD->value(1, 0, obsIdx, stnIdx));
6297  }
6298  else if (r8Data_.contains(adAzimuth_.getLCode()) && (pD=r8Data_.value(adAzimuth_.getLCode())))
6299  auxObs->setAzimuthAngle (pD->value(0, 0, obsIdx, stnIdx));
6300 
6301  if (r8Data_.contains(adAxoCont_.getLCode()) && (pD=r8Data_.value(adAxoCont_.getLCode())))
6302  {
6303  auxObs->setCalcAxisOffset4Delay(pD->value(0, 0, obsIdx, stnIdx));
6304  auxObs->setCalcAxisOffset4Rate (pD->value(1, 0, obsIdx, stnIdx));
6305  };
6306  if (r8Data_.contains(adNdryCont_.getLCode()) && (pD=r8Data_.value(adNdryCont_.getLCode())))
6307  {
6308  auxObs->setCalcNdryCont4Delay(pD->value(0, 0, obsIdx, stnIdx));
6309  auxObs->setCalcNdryCont4Rate (pD->value(1, 0, obsIdx, stnIdx));
6310  };
6311  if (r8Data_.contains(adNwetCont_.getLCode()) && (pD=r8Data_.value(adNwetCont_.getLCode())))
6312  {
6313  auxObs->setCalcNwetCont4Delay(pD->value(0, 0, obsIdx, stnIdx));
6314  auxObs->setCalcNwetCont4Rate (pD->value(1, 0, obsIdx, stnIdx));
6315  };
6316  if (r8Data_.contains(adOceVert_.getLCode()) && (pD=r8Data_.value(adOceVert_.getLCode())))
6317  {
6318  auxObs->setCalcOLoadVert4Delay(pD->value(0, 0, obsIdx, stnIdx));
6319  auxObs->setCalcOLoadVert4Rate (pD->value(1, 0, obsIdx, stnIdx));
6320  };
6321  if (r8Data_.contains(adOceHorz_.getLCode()) && (pD=r8Data_.value(adOceHorz_.getLCode())))
6322  {
6323  auxObs->setCalcOLoadHorz4Delay(pD->value(0, 0, obsIdx, stnIdx));
6324  auxObs->setCalcOLoadHorz4Rate (pD->value(1, 0, obsIdx, stnIdx));
6325  };
6326  if (r8Data_.contains(adOceDeld_.getLCode()) && (pD=r8Data_.value(adOceDeld_.getLCode())))
6327  {
6328  auxObs->setOcnLdR(Sg3dVector( pD->value(0, 0, obsIdx, stnIdx),
6329  pD->value(0, 1, obsIdx, stnIdx),
6330  pD->value(0, 2, obsIdx, stnIdx)));
6331  auxObs->setOcnLdV(Sg3dVector( pD->value(1, 0, obsIdx, stnIdx),
6332  pD->value(1, 1, obsIdx, stnIdx),
6333  pD->value(1, 2, obsIdx, stnIdx)));
6334  };
6335  if (r8Data_.contains(adParangle_.getLCode()) && (pD=r8Data_.value(adParangle_.getLCode())))
6336  auxObs->setParallacticAngle(pD->value(0, 0, obsIdx, stnIdx));
6337  if (r8Data_.contains(adAxoPart_.getLCode()) && (pD=r8Data_.value(adAxoPart_.getLCode())))
6338  {
6339  auxObs->setDdel_dAxsOfs(pD->value(0, 0, obsIdx, stnIdx));
6340  auxObs->setDrat_dAxsOfs(pD->value(1, 0, obsIdx, stnIdx));
6341  };
6342  if (r8Data_.contains(adNgradPar_.getLCode()) && (pD=r8Data_.value(adNgradPar_.getLCode())))
6343  {
6344  auxObs->setDdel_dTzdGrdN(pD->value(0, 0, obsIdx, stnIdx));
6345  auxObs->setDdel_dTzdGrdE(pD->value(0, 1, obsIdx, stnIdx));
6346  auxObs->setDrat_dTzdGrdN(pD->value(1, 0, obsIdx, stnIdx));
6347  auxObs->setDrat_dTzdGrdE(pD->value(1, 1, obsIdx, stnIdx));
6348  };
6349  if (r8Data_.contains(adNdryPart_.getLCode()) && (pD=r8Data_.value(adNdryPart_.getLCode())))
6350  {
6351  auxObs->setDdel_dTzdDry(pD->value(0, 0, obsIdx, stnIdx));
6352  auxObs->setDrat_dTzdDry(pD->value(1, 0, obsIdx, stnIdx));
6353  };
6354  if (r8Data_.contains(adNwetPart_.getLCode()) && (pD=r8Data_.value(adNwetPart_.getLCode())))
6355  {
6356  auxObs->setDdel_dTzdWet(pD->value(0, 0, obsIdx, stnIdx));
6357  auxObs->setDrat_dTzdWet(pD->value(1, 0, obsIdx, stnIdx));
6358  };
6359  // eo4c
6360 
6361 
6362 
6363  };
6364  //
6365  // from <<session>> scope:
6366  if (r8Data_.contains(adStnCoord_.getLCode()))
6367  {
6368  v3(X_AXIS) = r8Data_.value(adStnCoord_.getLCode())->value(0, stnIdx, 0, 0);
6369  v3(Y_AXIS) = r8Data_.value(adStnCoord_.getLCode())->value(1, stnIdx, 0, 0);
6370  v3(Z_AXIS) = r8Data_.value(adStnCoord_.getLCode())->value(2, stnIdx, 0, 0);
6371  stn->setR(v3);
6372  };
6373  if (c1Data_.contains(adTectPlNm_.getLCode()))
6374  stn->setTectonicPlateName(c1Data_.value(adTectPlNm_.getLCode())->value(stnIdx, 0, 0));
6375 
6376  session_->calcInfo().stations().append(stn);
6377 
6378  if (r8Data_.contains(adAtmInterv_.getLCode()))
6379  stn->pcZenith()->setPwlStep(
6380  r8Data_.value(adAtmInterv_.getLCode())->value(stnIdx, 0, 0, 0)/24.0);
6381  if (r8Data_.contains(adAtmConstr_.getLCode()))
6382  stn->pcZenith()->setPwlAPriori(
6383  r8Data_.value(adAtmConstr_.getLCode())->value(stnIdx, 0, 0, 0)*1.0e-12*24.0*vLight*100.0);
6384 
6385  if (r8Data_.contains(adClkInterv_.getLCode()))
6386  stn->pcClocks()->setPwlStep(
6387  r8Data_.value(adClkInterv_.getLCode())->value(stnIdx, 0, 0, 0)/24.0);
6388  if (r8Data_.contains(adClkConstr_.getLCode()))
6389  stn->pcClocks()->setPwlAPriori(
6390  r8Data_.value(adClkConstr_.getLCode())->value(stnIdx, 0, 0, 0)*864.0);
6391 
6392  // i2:
6393  if (i2Data_.contains(adCableSgn_.getLCode()))
6394  {
6395  if (i2Data_.value(adCableSgn_.getLCode())->value(stnIdx, 0, 0, 0) == 0)
6397  else
6398  stn->setCableCalMultiplierDBCal(i2Data_.value(adCableSgn_.getLCode())->value(stnIdx, 0, 0, 0));
6399  };
6400  // cable cal and meteo origin info:
6401  if (i2Data_.contains(adCablOnTp_.getLCode()))
6403  (i2Data_.value(adCablOnTp_.getLCode())->value(stnIdx, 0, 0, 0)));
6404  if (i2Data_.contains(adMeteOnTp_.getLCode()))
6406  (i2Data_.value(adMeteOnTp_.getLCode())->value(stnIdx, 0, 0, 0)));
6407  // strings:
6408  if (c1Data_.contains(adCablOnTx_.getLCode()))
6409  {
6410  const QString &s=c1Data_.value(adCablOnTx_.getLCode())->value(stnIdx, 0, 0);
6411  stn->setCableCalsOriginTxt(s==QString("_")?QString(""):s);
6412  };
6413  if (c1Data_.contains(adMeteOnTx_.getLCode()))
6414  {
6415  const QString &s=c1Data_.value(adMeteOnTx_.getLCode())->value(stnIdx, 0, 0);
6416  stn->setMeteoDataOriginTxt(s==QString("_")?QString(""):s);
6417  };
6418 
6419  // station calibrations:
6420  // currently, we use only cable cal from the list:
6421  if (isCableCalMatched && i2Data_.contains(adStnCalFlg_.getLCode()))
6422  {
6423  d = i2Data_.value(adStnCalFlg_.getLCode())->value(stnIdx, 0, 0, 0);
6424  if (d & 1<<cableCalFlagIdx)
6426  else
6428  };
6429  //
6430  //
6431  //
6432  if (i2Data_.contains(adBlnStatus_.getLCode()))
6433  {
6434  SgVlbiBaselineInfo *bi=NULL, *biR=NULL;
6435  for (int j=0; j<numOfStn_; j++)
6436  {
6437  station2Name = stnNames_.at(j);
6438  d = i2Data_.value(adBlnStatus_.getLCode())->value(stnIdx, j, 0, 0);
6439 
6440  if (session_->baselinesByName().contains(stnName + ":" + station2Name))
6441  bi = session_->baselinesByName().value(stnName + ":" + station2Name);
6442  else
6443  bi = NULL;
6444  if (session_->baselinesByName().contains (station2Name + ":" + stnName))
6445  biR = session_->baselinesByName().value(station2Name + ":" + stnName);
6446  else
6447  biR = NULL;
6448  // check for deselect flag:
6449  if (!(d & (1<<1)))
6450  {
6452  {
6455  "::initSession(): the baseline " + bi->getKey() + " has been deselected");
6456  };
6457  if (biR && !biR->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
6458  {
6459  biR->addAttr(SgVlbiBaselineInfo::Attr_NOT_VALID);
6461  "::initSession(): the baseline " + biR->getKey() + " has been deselected");
6462  };
6463  };
6464  // check for baseline clocks flag:
6465  if ((d & (1<<3)))
6466  {
6467  if (bi)
6468  {
6471  "::initSession(): clock estimation has been assigned to the baseline " + bi->getKey());
6472  };
6473  if (biR)
6474  {
6477  "::initSession(): clock estimation has been assigned to the baseline " + biR->getKey());
6478  };
6479  };
6480  };
6481  };
6482  }
6483  else
6485  "::initSession(): cannot find a station #" + stnIdx + " in the map");
6486  };
6487  //
6488  //
6489  // sources:
6490  for (int srcIdx=0; srcIdx<numOfSrc_; srcIdx++) // use sources order from the input file
6491  {
6492  sourceName = sourceNames.at(srcIdx);
6493  SgVlbiSourceInfo *src=session_->sourcesByName().value(sourceName);
6494  if (src)
6495  {
6496  if (r8Data_.contains(adSrcCoord_.getLCode()))
6497  {
6498  src->setRA(r8Data_.value(adSrcCoord_.getLCode())->value(0, srcIdx, 0, 0));
6499  src->setDN(r8Data_.value(adSrcCoord_.getLCode())->value(1, srcIdx, 0, 0));
6500  }
6501  else
6503  "::initSession(): cannot find coordinates of the source \"" + sourceName + "\"");
6504 
6505  if (c1Data_.contains(adSrcApRef_.getLCode()))
6506  src->setAprioriReference(c1Data_.value(adSrcApRef_.getLCode())->value(srcIdx, 0, 0));
6507 
6508  if (i2Data_.contains(adSrcStatus_.getLCode()))
6509  {
6510  d = i2Data_.value(adSrcStatus_.getLCode())->value(srcIdx, 0, 0, 0);
6511  src->applyStatusBits(d);
6512  };
6513  }
6514  else
6516  "::initSession(): cannot find source \"" + sourceName + "\" in the map");
6517  };
6518 
6519  //4CALC:
6520  //
6521  if (r8Data_.contains(adOPTLCoef_.getLCode()) &&
6522  r8Data_.contains(adSitOcPhs_.getLCode()) &&
6523  r8Data_.contains(adSitOcAmp_.getLCode()) &&
6524  r8Data_.contains(adSitHWOPh_.getLCode()) &&
6525  r8Data_.contains(adSitHWOAm_.getLCode()) &&
6526  r8Data_.contains(adSitHSOPh_.getLCode()) &&
6527  r8Data_.contains(adSitHSOAm_.getLCode()) )
6528  {
6529  int l;
6530  n = datumByKey_.value(adOPTLCoef_.getLCode())->d1();
6531  l = datumByKey_.value(adSitOcPhs_.getLCode())->d2();
6532 
6533  if (n != datumByKey_.value(adSitOcPhs_.getLCode())->d1())
6535  "::initSession(): dimensions of OceanPoleTideCoef and OceanUpPhase mismatch");
6536  else if (n != datumByKey_.value(adSitHWOPh_.getLCode())->d1())
6538  "::initSession(): dimensions of OceanPoleTideCoef and OceanHorizontalWestPhase mismatch");
6539  else if (n != datumByKey_.value(adSitHSOPh_.getLCode())->d1())
6541  "::initSession(): dimensions of OceanPoleTideCoef and OceanHorizontalSouthPhase mismatch");
6542  else if (n != datumByKey_.value(adSitOcAmp_.getLCode())->d1())
6544  "::initSession(): dimensions of OceanPoleTideCoef and OceanUpAmp mismatch");
6545  else if (n != datumByKey_.value(adSitHWOAm_.getLCode())->d1())
6547  "::initSession(): dimensions of OceanPoleTideCoef and OceanHorizontalWestAmp mismatch");
6548  else if (n != datumByKey_.value(adSitHSOAm_.getLCode())->d1())
6550  "::initSession(): dimensions of OceanPoleTideCoef and OceanHorizontalSouthAmp mismatch");
6551  else if (n != session_->calcInfo().stations().size())
6553  "::initSession(): dimensions of OceanPoleTideCoef and number of stations mismatch");
6554  else if (l != 11)
6556  "::initSession(): unexpected dimension of OceanUpPhase");
6557  else if (l != datumByKey_.value(adSitHWOPh_.getLCode())->d2())
6559  "::initSession(): unexpected dimension(2) of OceanHorizontalWestPhase");
6560  else if (l != datumByKey_.value(adSitHSOPh_.getLCode())->d2())
6562  "::initSession(): unexpected dimension(2) of OceanHorizontalSouthPhase");
6563  else if (l != datumByKey_.value(adSitOcAmp_.getLCode())->d2())
6565  "::initSession(): unexpected dimension of OceanUpAmp");
6566  else
6567  {
6568  for (int i=0; i<n; i++)
6569  {
6571  if (si)
6572  {
6573  for (int j=0; j<l; j++)
6574  {
6575  si->setOLoadPhase(j, 0, r8Data_.value(adSitOcPhs_.getLCode())->value(i, j, 0, 0));
6576  si->setOLoadPhase(j, 1, r8Data_.value(adSitHWOPh_.getLCode())->value(i, j, 0, 0));
6577  si->setOLoadPhase(j, 2, r8Data_.value(adSitHSOPh_.getLCode())->value(i, j, 0, 0));
6578 
6579  si->setOLoadAmplitude(j, 0, r8Data_.value(adSitOcAmp_.getLCode())->value(i, j, 0, 0));
6580  si->setOLoadAmplitude(j, 1, r8Data_.value(adSitHWOAm_.getLCode())->value(i, j, 0, 0));
6581  si->setOLoadAmplitude(j, 2, r8Data_.value(adSitHSOAm_.getLCode())->value(i, j, 0, 0));
6582  };
6583  for (int j=0; j<6; j++)
6584  si->setOptLoadCoeff(j, r8Data_.value(adOPTLCoef_.getLCode())->value(i, j, 0, 0));
6585  }
6586  else
6588  "::initSession(): the station # " + QString("").setNum(i) + " is NULL");
6589  };
6590  };
6591  };
6592  //
6593  //
6594  if (r8Data_.contains(adFwobInf_ .getLCode()) &&
6595  r8Data_.contains(adFut1Inf_ .getLCode()) &&
6596  c1Data_.contains(adUt1Intrp_.getLCode()) &&
6597  c1Data_.contains(adUt1Mess_ .getLCode()) &&
6598  c1Data_.contains(adWobMess_ .getLCode()) &&
6599  c1Data_.contains(adWobIntrp_.getLCode()) &&
6600  c1Data_.contains(adFut1Text_.getLCode()) &&
6601  c1Data_.contains(adFwobText_.getLCode()) &&
6602  r8Data_.contains(adFut1Pts_ .getLCode()) &&
6603  r8Data_.contains(adFwobXnYt_.getLCode()) )
6604  {
6605  double t0;
6606  double dt;
6607  unsigned int numOfPts;
6608 
6609  t0 = r8Data_.value(adFut1Inf_.getLCode())->value(0, 0, 0, 0);
6610  dt = r8Data_.value(adFut1Inf_.getLCode())->value(1, 0, 0, 0);
6611  numOfPts = round(r8Data_.value(adFut1Inf_.getLCode())->value(2, 0, 0, 0));
6612 
6613  SgVector *utValues=new SgVector(numOfPts);
6614  for (unsigned int i=0; i<numOfPts; i++)
6615  utValues->setElement(i, r8Data_.value(adFut1Pts_.getLCode())->value(i, 0, 0, 0));
6616 
6617  if (t0 > 2390000.0)
6618  t0 -= 2400000.5;
6619 
6620  session_->allocUt1InterpolEpochs(t0, dt, numOfPts);
6621  *utValues *= -1.0;
6622  session_->allocUt1InterpolValues(utValues);
6625  "::getDataFromVgosDb(): loaded " + QString().setNum(numOfPts) +
6626  " records for UT1 interpolation");
6627 
6628  t0 = r8Data_.value(adFwobInf_.getLCode())->value(0, 0, 0, 0);
6629  dt = r8Data_.value(adFwobInf_.getLCode())->value(1, 0, 0, 0);
6630  numOfPts = round(r8Data_.value(adFwobInf_.getLCode())->value(2, 0, 0, 0));
6631  if (t0 > 2390000.0)
6632  t0 -= 2400000.5;
6633 
6634  SgMatrix *pmValues=new SgMatrix(numOfPts, 2);
6635  for (unsigned int i=0; i<numOfPts; i++)
6636  {
6637  pmValues->setElement(i, 0, r8Data_.value(adFwobXnYt_.getLCode())->value(i, 0, 0, 0));
6638  pmValues->setElement(i, 1, r8Data_.value(adFwobXnYt_.getLCode())->value(i, 1, 0, 0));
6639  };
6640 
6641  session_->allocPxyInterpolEpochs(t0, dt, numOfPts);
6642  session_->allocPxyInterpolValues(pmValues);
6645  "::getDataFromVgosDb(): loaded " + QString().setNum(numOfPts) +
6646  " records for polar motion interpolation");
6647 
6649  c1Data_.value(adUt1Intrp_.getLCode())->value(0, 0, 0));
6651  c1Data_.value(adWobIntrp_.getLCode())->value(0, 0, 0));
6653  c1Data_.value(adUt1Mess_.getLCode())->value(0, 0, 0));
6655  c1Data_.value(adWobMess_.getLCode())->value(0, 0, 0));
6657  c1Data_.value(adFut1Text_.getLCode())->value(0, 0, 0));
6659  c1Data_.value(adFwobText_.getLCode())->value(0, 0, 0));
6660  //
6661  switch (session_->calcInfo().getFlagTidalUt1())
6662  {
6663  case 1:
6665  str = "Seriesfull of tides";
6666  break;
6667  case -1: // UT1R
6669  str = "Only short period tidal terms are removed";
6670  break;
6671  case -2: // UT1S
6673  str = "All tidal terms are removed";
6674  break;
6675  default:
6677  "::getDataFromVgosDb(): got undocumented value for the TIDALUT1 value: " +
6678  QString().setNum(session_->calcInfo().getFlagTidalUt1()) +
6679  "; the UT1 type has been reverted to default");
6680  break;
6681  };
6683  "::getDataFromVgosDb(): the type of the UT1 inner series has been set to " + str);
6684  //
6685  }
6686  else
6687  {
6689  {
6690  delete session_->args4Ut1Interpolation();
6691  session_->args4Ut1Interpolation() = NULL;
6692  };
6694  {
6695  delete session_->tabs4Ut1Interpolation();
6696  session_->tabs4Ut1Interpolation() = NULL;
6697  };
6699 
6701  {
6702  delete session_->args4PxyInterpolation();
6703  session_->args4PxyInterpolation() = NULL;
6704  };
6706  {
6707  delete session_->tabs4PxyInterpolation();
6708  session_->tabs4PxyInterpolation() = NULL;
6709  };
6711  };
6712  //
6713  //
6714 
6715 
6716  if (i2Data_.contains(adAxisTyps_.getLCode()))
6717  {
6718  if ((n = datumByKey_.value(adAxisTyps_.getLCode())->d1()) != session_->calcInfo().stations().size())
6720  "::initSession(): dimensions of AxisTyps and number of stations mismatch");
6721  else
6722  for (int i=0; i<n; i++)
6723  {
6725  if (si)
6727  i2Data_.value(adAxisTyps_.getLCode())->value(i, 0, 0, 0)));
6728  else
6730  "::initSession(): the station # " + QString("").setNum(i) + " is NULL");
6731  };
6732  };
6733 
6734  if (r8Data_.contains(adAxisOffs_.getLCode()))
6735  {
6736  if ((n = datumByKey_.value(adAxisOffs_.getLCode())->d1()) != session_->calcInfo().stations().size())
6738  "::initSession(): dimensions of AxisOffs and number of stations mismatch");
6739  else
6740  for (int i=0; i<n; i++)
6741  {
6743  if (si)
6744  si->setAxisOffset(r8Data_.value(adAxisOffs_.getLCode())->value(i, 0, 0, 0));
6745  else
6747  "::initSession(): the station # " + QString("").setNum(i) + " is NULL");
6748  };
6749  };
6750  if (r8Data_.contains(adAxisTilt_.getLCode()))
6751  {
6752  if ((n = datumByKey_.value(adAxisTilt_.getLCode())->d1()) != session_->calcInfo().stations().size())
6754  "::initSession(): dimensions of AxisTilt and number of stations mismatch");
6755  else
6756  for (int i=0; i<n; i++)
6757  {
6759  if (si)
6760  {
6761  si->setTilt(0, r8Data_.value(adAxisTilt_.getLCode())->value(i, 0, 0, 0));
6762  si->setTilt(1, r8Data_.value(adAxisTilt_.getLCode())->value(i, 1, 0, 0));
6763  }
6764  else
6766  "::initSession(): the station # " + QString("").setNum(i) + " is NULL");
6767  };
6768  };
6769  //
6770  // ECCs:
6771  if (c1Data_.contains(adEccTypes_.getLCode()) &&
6772  r8Data_.contains(adEccCoord_.getLCode()) &&
6773  c1Data_.contains(adEccNames_.getLCode()) )
6774  {
6775  if ((n = datumByKey_.value(adEccTypes_.getLCode())->d2()) != session_->calcInfo().stations().size())
6777  "::initSession(): dimensions of EccTypes and number of stations mismatch");
6778  else
6779  for (int i=0; i<n; i++)
6780  {
6782  if (si)
6783  {
6784  si->eccRec() = new SgEccRec();
6785  if (c1Data_.value(adEccTypes_.getLCode())->value(i, 0, 0) == "XY")
6787  else if (c1Data_.value(adEccTypes_.getLCode())->value(i, 0, 0) == "NE")
6789  else
6790  {
6793  "::initSession(): cannot figure out Ecc type from the string \"" +
6794  c1Data_.value(adEccTypes_.getLCode())->value(i, 0, 0) + "\" for the station \"" +
6795  si->getKey() + "\"");
6796  };
6797  //
6798  si->eccRec()->setDR(
6799  Sg3dVector( r8Data_.value(adEccCoord_.getLCode())->value(i, 0, 0, 0),
6800  r8Data_.value(adEccCoord_.getLCode())->value(i, 1, 0, 0),
6801  r8Data_.value(adEccCoord_.getLCode())->value(i, 2, 0, 0)));
6802  //
6803  si->eccRec()->setCdpNumber(c1Data_.value(adEccNames_.getLCode())->value(i, 0, 0).simplified());
6804  }
6805  else
6807  "::initSession(): the station # " + QString("").setNum(i) + " is NULL");
6808  };
6809  };
6810  //
6811  //
6812  //
6813  //
6814  // phase three:
6815 
6816  // reference clocks:
6817  bool hasRC(false);
6818  if (c1Data_.contains(adRefClocks_.getLCode()))
6819  {
6820  for (int i=0; i<datumByKey_.value(adRefClocks_.getLCode())->d2(); i++)
6821  {
6822  QString clockSiteName(
6823  c1Data_.value(adRefClocks_.getLCode())->value(i, 0, 0).
6824  leftJustified(8, ' '));
6825  if (session_->stationsByName().contains(clockSiteName))
6826  {
6827  session_->stationsByName().value(clockSiteName)->
6829  hasRC = true;
6831  "::initSession(): Reference Clock attribute has been assigned to the station " +
6832  session_->stationsByName().value(clockSiteName)->getKey());
6833  };
6834  };
6835  }
6836  else if (c1Data_.contains(adStaClRf_.getLCode()))
6837  {
6838  for (int i=0; i<datumByKey_.value(adStaClRf_.getLCode())->d2(); i++)
6839  {
6840  QString clockSiteName(
6841  c1Data_.value(adStaClRf_.getLCode())->value(i, 0, 0).
6842  leftJustified(8, ' '));
6843  if (session_->stationsByName().contains(clockSiteName))
6844  {
6845  session_->stationsByName().value(clockSiteName)->
6847  hasRC = true;
6849  "::initSession(): Reference Clock attribute has been assigned to the station " +
6850  session_->stationsByName().value(clockSiteName)->getKey() + ", PIMA's version");
6851  };
6852  };
6853  };
6854  if (!hasRC)
6856  "::initSession(): no Reference Clock attribute has been found for the session");
6857 
6858  //
6859  // clock breaks:
6860  if (i4Data_.contains(adCbrNumber_.getLCode()) && c1Data_.contains(adCbrSite_.getLCode()) &&
6861  i4Data_.contains(adCbrImjd_.getLCode()) && r8Data_.contains(adCbrTime_.getLCode()))
6862  {
6863  int numOfClockBreak=
6864  i4Data_.value(adCbrNumber_.getLCode())->value(0, 0, 0, 0);
6865  //
6866  for (int i=0; i<numOfClockBreak; i++)
6867  {
6868  epoch.setDate(i4Data_.value(adCbrImjd_.getLCode())->value(i, 0, 0, 0));
6869  epoch.setTime(r8Data_.value(adCbrTime_.getLCode())->value(i, 0, 0, 0)/86400.0);
6870  station1Name = c1Data_.value(adCbrSite_.getLCode())->value(i, 0, 0).leftJustified(8, ' ');
6871  if (session_->stationsByName().contains(station1Name))
6872  {
6873  station1Info = session_->stationsByName().value(station1Name);
6874  SgParameterBreak *clockBreak=new SgParameterBreak(epoch, 0.0);
6876  if (station1Info->clockBreaks().addBreak(clockBreak))
6878  "::initSession(): a clock break at station " + station1Info->getKey() +
6879  " that occurred on " + epoch.toString() + " has been added");
6880  else
6882  "::initSession(): adding new clock break at " + station1Info->getKey() +
6883  " station on " + epoch.toString() + " has failed");
6884  }
6885  else
6887  "::initSession(): cannot find station \"" + station1Name +
6888  "\" in the map of stations, adding a clock break has failed");
6889  };
6891  };
6892 
6893 
6894  // calibrations:
6895  if (c1Data_.contains(adStnCalNam_.getLCode()))
6896  {
6897  adStnCalNam_.setDim2(6);
6898  c1Data_.value(adStnCalNam_.getLCode())->allocateSpace();
6899  for (int i=0; i<6; i++)
6900  {
6901  c1Data_.value(adStnCalNam_.getLCode())->value(i, 0, 0) = sCalList[i];
6902  // special case:
6903  c1Data_.value(adStnCalNam_.getLCode())->value(i, 0, 0).replace(' ', '_');
6904  }
6905  };
6906  if (c1Data_.contains(adFlyCalNam_.getLCode()))
6907  {
6908  adFlyCalNam_.setDim2(8);
6909  c1Data_.value(adFlyCalNam_.getLCode())->allocateSpace();
6910  for (int i=0; i<8; i++)
6911  c1Data_.value(adFlyCalNam_.getLCode())->value(i, 0, 0) = sFclList[i];
6912  };
6913 
6914  //
6915  //
6916  // aux weights for baselines:
6917  if (c1Data_.contains(adErrorBl_.getLCode()) && r8Data_.contains(adErrorK_.getLCode()))
6918  {
6919  numOfBln_ = datumByKey_.value(adErrorBl_.getLCode())->d2();
6920  if (numOfBln_ != (d=datumByKey_.value(adErrorK_.getLCode())->d2()))
6922  "::initSession(): dimensions of ErrorBl (" + QString("").setNum(numOfBln_) +
6923  ") and ErrorK (" + QString("").setNum(d) + ") lCodes mismatch");
6924  else
6925  for (int i=0; i<numOfBln_; i++)
6926  {
6927  baselineName = c1Data_.value(adErrorBl_.getLCode())->value(i, 0, 0).leftJustified(16, ' ');
6928  baselineName.replace('_', ' ');
6929  baselineName = baselineName.insert(8, ":");
6930 // station1Name = baselineName.left(8);
6931 // station2Name = baselineName.right(8);
6932 // baselineName = station1Name + ":" + station2Name;
6933  if (session_->baselinesByName().contains(baselineName))
6934  {
6935  baselineInfo = session_->baselinesByName().value(baselineName);
6936  baselineInfo->setSigma2add(DT_DELAY, r8Data_.value(adErrorK_.getLCode())->value(0, i, 0, 0));
6937  baselineInfo->setSigma2add(DT_RATE, r8Data_.value(adErrorK_.getLCode())->value(1, i, 0, 0));
6938  }
6939  else
6941  "::initSession(): cannot find baseline \"" + baselineName +
6942  "\" in the map of baselines, cannot set up weight corrections");
6943  };
6945  };
6946  // baseline clocks:
6947  if (c1Data_.contains(adBlnClocks_.getLCode()))
6948  {
6949  // adjust the size:
6950  d = datumByKey_.value(adBlnClocks_.getLCode())->d2();
6951  for (int i=0; i<d; i++)
6952  {
6953  baselineName = c1Data_.value(adBlnClocks_.getLCode())->value(i, 0, 0).leftJustified(16, ' ');
6954  baselineName.replace('_', ' ');
6955  baselineName = baselineName.insert(8, ":");
6956  if (session_->baselinesByName().contains(baselineName))
6957  {
6958  baselineInfo = session_->baselinesByName().value(baselineName);
6959  if (!baselineInfo->isAttr(SgVlbiBaselineInfo::Attr_ESTIMATE_CLOCKS)) // wtf?
6960  {
6963  "::initSession(): baseline clocks were corrected for \"" + baselineName +
6964  "\" (missed in BASLSTAT)");
6965  };
6966  }
6967  else
6969  "::initSession(): cannot find baseline \"" + baselineName +
6970  "\" in the map of baselines, cannot set up baseline clocks");
6971  };
6972  };
6973 
6974 
6975  delete []adNumOfAp;
6976  delete []adIndexNum;
6977  delete []adChanId;
6978  delete []adPolarz;
6979  delete []adBbcIdx;
6980  delete []adErrRate;
6981  delete []adRfFreq;
6982  delete []adLoRfFreq;
6983  delete []adNumSmpls;
6984  delete []adChAmpPhs;
6985  delete []adUvChn;
6986  delete []adPhcFrq;
6987  delete []adPhcAmp;
6988  delete []adPhcPhs;
6989  delete []adPhcCm;
6990  delete []adPhcOff;
6991 
6992 
6993 /*
6994 std::cout << " extr: UserName = [" << qPrintable(inputIdentities_->getUserName()) << "]\n";
6995 std::cout << " extr: UserEmailAddress = [" << qPrintable(inputIdentities_->getUserEmailAddress()) << "]\n";
6996 std::cout << " extr: AcAbbrevName = [" << qPrintable(inputIdentities_->getAcAbbrevName()) << "]\n";
6997 
6998 std::cout << " extr: creator= [" << qPrintable(inputIdentities_->getDriverVersion().name())
6999 << "] released " << qPrintable(inputIdentities_->getDriverVersion().getReleaseEpoch().toString()) << "\n";
7000 std::cout << " extr: released by= [" << qPrintable(inputIdentities_->getDriverVersion().name())
7001 << "] released " << qPrintable(inputIdentities_->getDriverVersion().getReleaseEpoch().toString()) << "\n";
7002 
7003 
7004 std::cout << "initSession(): done"
7005 << qPrintable(QString("").sprintf(", dt= %.2f ms", (SgMJD::currentMJD() - startEpoch_)*86400000.0))
7006 << "\n";
7007 */
7008 };
7009 
7010 
7011 
7012 //
7013 void SgAgvDriver::setCalcInfoModelMessNCtrlF(const QString& messLc, const QString& cflgLc,
7014  const SgModelsInfo::DasModel& model)
7015 {
7016  if (c1Data_.contains(messLc) && c1Data_.contains(cflgLc))
7017  {
7018  c1Data_.value(messLc)->value(0, 0, 0) = model.getDefinition();
7019  c1Data_.value(cflgLc)->value(0, 0, 0) = model.getControlFlag();
7020  };
7021 };
7022 
7023 
7024 
7025 //
7026 void SgAgvDriver::getCalcInfoModelMessNCtrlF(const QString& messLc, const QString& cflgLc,
7027  SgModelsInfo::DasModel& model)
7028 {
7029  if (c1Data_.contains(messLc) && c1Data_.contains(cflgLc))
7030  {
7031  model.setDefinition (c1Data_.value(messLc)->value(0, 0, 0));
7032  model.setControlFlag(c1Data_.value(cflgLc)->value(0, 0, 0));
7033  };
7034 };
7035 
7036 /*=====================================================================================================*/
7037 
7038 
7039 
7040 
7041 
7042 
7043 
7044 
7045 /*=====================================================================================================*/
7046 
7047 /*=====================================================================================================*/
const double vLight
Definition: SgConstants.cpp:33
const QString sFclList[]
const QString sCalList[]
const SgAgvDatumDescriptor adNumGrAmbg
const SgAgvDatumDescriptor adUserRec
const SgAgvDatumDescriptor adUvf_Asec
const SgAgvDatumDescriptor adEccCoord
const SgAgvDatumDescriptor adSrcIdx
const SgAgvDatumDescriptor adNumAp1
const SgAgvDatumDescriptor adResPhas
const SgAgvDatumDescriptor adSrchPar
const SgAgvDatumDescriptor adFourfCtrl
const SgAgvDatumDescriptor adSitHSOPh
const SgAgvDatumDescriptor adTsys2
const SgAgvDatumDescriptor adWobYcont
const SgAgvDatumDescriptor adExpCode
const SgAgvDatumDescriptor adEccNames
const SgAgvDatumDescriptor adAprDel
const SgAgvDatumDescriptor adResGrDl
const SgAgvDatumDescriptor adAirPress
const SgAgvDatumDescriptor adCf2J2k_1
const SgAgvDatumDescriptor adPhaseFlag
const SgAgvDatumDescriptor adObsCalFlg
const SgAgvDatumDescriptor adStartSec
const SgAgvDatumDescriptor adNumbSta
const SgAgvDatumDescriptor adEtdData
const SgAgvDatumDescriptor adCbrTime
const SgAgvDatumDescriptor adSupMet
const SgAgvDatumDescriptor adEopTab
const SgAgvDatumDescriptor adApByFrq1
const SgAgvDatumDescriptor adDelWcen
const SgAgvDatumDescriptor adAxoCflg
const SgAgvDatumDescriptor adNSampls1
const SgAgvDatumDescriptor adWobLibra
const SgAgvDatumDescriptor adPtdCflg
const SgAgvDatumDescriptor adChanSdb
const SgAgvDatumDescriptor adAtmIntr
const SgAgvDatumDescriptor adAprCloOf
const SgAgvDatumDescriptor adPhDelErr
const SgAgvDatumDescriptor adDerDel
const SgAgvDatumDescriptor adSunCont
const SgAgvDatumDescriptor adPanMess
const SgAgvDatumDescriptor adAprEop
const SgAgvDatumDescriptor adStnCalNam
const SgAgvDatumDescriptor adPhCAmp2
const SgAgvDatumDescriptor adGrDelVal
const SgAgvDatumDescriptor adEffDura
const SgAgvDatumDescriptor adFalseDet
const SgAgvDatumDescriptor adBand2nd
const SgAgvDatumDescriptor adCorBasCd
const SgAgvDatumDescriptor adFrTypFit
const SgAgvDatumDescriptor adTlOfCns
const SgAgvDatumDescriptor adWobCflg
const SgAgvDatumDescriptor adSoCoCns
const SgAgvDatumDescriptor adLoFreq1
const SgAgvDatumDescriptor adNutMess
const SgAgvDatumDescriptor adSrcName
const SgAgvDatumDescriptor adSunData
const SgAgvDatumDescriptor adNumSam2
const SgAgvDatumDescriptor adAprCloRt
const SgAgvDatumDescriptor adPlxMess
const SgAgvDatumDescriptor adHopsVer
const SgAgvDatumDescriptor adApByFrq2
const SgAgvDatumDescriptor adRateFlag
const SgAgvDatumDescriptor adIdelay
const SgAgvDatumDescriptor adCtiMess
const SgAgvDatumDescriptor adWobEpoch
const SgAgvDatumDescriptor adGcMbDel
const SgAgvDatumDescriptor adRfFreq2
const SgAgvDatumDescriptor adGrDelAmbg
const SgAgvDatumDescriptor adCloCns
const SgAgvDatumDescriptor adGrResid
const SgAgvDatumDescriptor adRelCflg
const SgAgvDatumDescriptor adIonDtFlg
const SgAgvDatumDescriptor adPhCFrq1
const SgAgvDatumDescriptor adAirTemp
const SgAgvDatumDescriptor adIonRms
const SgAgvDatumDescriptor adCalcFlgN
const SgAgvDatumDescriptor adFourfCmd
const SgAgvDatumDescriptor adMeteOnTx
const SgAgvDatumDescriptor adConsnRat
const SgAgvDatumDescriptor adUvStaOrd
const SgAgvDatumDescriptor adSiteNames
const SgAgvDatumDescriptor adElev
const SgAgvDatumDescriptor adBandNames
const SgAgvDatumDescriptor adUvCoord
const SgAgvDatumDescriptor adRtResid
const SgAgvDatumDescriptor adOptlCont
const SgAgvDatumDescriptor adSrcCoord
const SgAgvDatumDescriptor adAzimuth
const SgAgvDatumDescriptor adPhCOff2
const SgAgvDatumDescriptor adPolariz1
const SgAgvDatumDescriptor adNumSam1
const SgAgvDatumDescriptor adFut1Pts
const SgAgvDatumDescriptor adOceCflg
const SgAgvDatumDescriptor adAtmInterv
const SgAgvDatumDescriptor adQbFactor
const SgAgvDatumDescriptor adBbcIdx2
const SgAgvDatumDescriptor adIndChn1
const SgAgvDatumDescriptor adNutCflg
const SgAgvDatumDescriptor adCalInfo
const SgAgvDatumDescriptor adSitOcPhs
const SgAgvDatumDescriptor adDaTyp
const SgAgvDatumDescriptor adCalName
const SgAgvDatumDescriptor adAtmMess
const SgAgvDatumDescriptor adPtdCont
const SgAgvDatumDescriptor adTotPhase
const SgAgvDatumDescriptor adDtecSig
const SgAgvDatumDescriptor adThPhRat
const SgAgvDatumDescriptor adAxoCont
const SgAgvDatumDescriptor adPepMess
const SgAgvDatumDescriptor adScanNames
const SgAgvDatumDescriptor adTsys1
const SgAgvDatumDescriptor adPindObs
const SgAgvDatumDescriptor adPimaVer
const SgAgvDatumDescriptor adSitPart
const SgAgvDatumDescriptor adGrDelIonV
const SgAgvDatumDescriptor adRelHumd
const SgAgvDatumDescriptor adOceHorz
const SgAgvDatumDescriptor adResSbDel
const SgAgvDatumDescriptor adUt1Intrp
const SgAgvDatumDescriptor adCorrPlace
const SgAgvDatumDescriptor adAtmConstr
const SgAgvDatumDescriptor adCalSts
const SgAgvDatumDescriptor adNoiseRms
const SgAgvDatumDescriptor adScanPima
const SgAgvDatumDescriptor adObsTab
const SgAgvDatumDescriptor adBasUse
const SgAgvDatumDescriptor adResMbDel
const SgAgvDatumDescriptor adCorVers
const SgAgvDatumDescriptor adThGrDel
const SgAgvDatumDescriptor adThPhDel
const SgAgvDatumDescriptor adPCalCm1
const SgAgvDatumDescriptor adUt1Part
const SgAgvDatumDescriptor adPhCPhs1
const SgAgvDatumDescriptor adNutDer
const SgAgvDatumDescriptor adAzTheo
const SgAgvDatumDescriptor adUvChn1
const SgAgvDatumDescriptor adBbcIdx1
const SgAgvDatumDescriptor adFourfErr
const SgAgvDatumDescriptor adConsnDel
const SgAgvDatumDescriptor adStrMess
const SgAgvDatumDescriptor adAntGain
const SgAgvDatumDescriptor adBendPart
const SgAgvDatumDescriptor adFut1Inf
const SgAgvDatumDescriptor adPCalCm2
const SgAgvDatumDescriptor adMunData
const SgAgvDatumDescriptor adEtdCont
const SgAgvDatumDescriptor adCbrNumber
const SgAgvDatumDescriptor adBsclEst
const SgAgvDatumDescriptor adCableDel
const SgAgvDatumDescriptor adApLength
const SgAgvDatumDescriptor adNwetPart
const SgAgvDatumDescriptor adGrDelErr
const SgAgvDatumDescriptor adAxisTyps
const SgAgvDatumDescriptor adCloIntr
const SgAgvDatumDescriptor adCableSgn
const SgAgvDatumDescriptor adNumAvaBnd
const SgAgvDatumDescriptor adStrPart
const SgAgvDatumDescriptor adGcRate
const SgAgvDatumDescriptor adLoFreq2
const SgAgvDatumDescriptor adResRate
const SgAgvDatumDescriptor adDelWwdt
const SgAgvDatumDescriptor adWobIntrp
const SgAgvDatumDescriptor adNutWahr
const SgAgvDatumDescriptor adUrVr
const SgAgvDatumDescriptor adMeteOnTp
const SgAgvDatumDescriptor adUtcMtai
const SgAgvDatumDescriptor adNobsSta
const SgAgvDatumDescriptor adUt1_tai
const SgAgvDatumDescriptor adGrDelIonE
const SgAgvDatumDescriptor adTilIntr
const SgAgvDatumDescriptor adRateWdt
const SgAgvDatumDescriptor adNaprEop
const SgAgvDatumDescriptor adRwRatVal
const SgAgvDatumDescriptor adErrorK
const SgAgvDatumDescriptor adDtec
const SgAgvDatumDescriptor adResPhRat
const SgAgvDatumDescriptor adAtmCns
const SgAgvDatumDescriptor adOceDeld
const SgAgvDatumDescriptor adGcSbDel
const SgAgvDatumDescriptor adRefClocks
const SgAgvDatumDescriptor adNut06Xyp
const SgAgvDatumDescriptor adInterval4
const SgAgvDatumDescriptor adEtdMess
const SgAgvDatumDescriptor adCorrelatn
const SgAgvDatumDescriptor adDelRate
const SgAgvDatumDescriptor adEopCns
const SgAgvDatumDescriptor adThProg
const SgAgvDatumDescriptor adFeedCor
const SgAgvDatumDescriptor adPolarXy
const SgAgvDatumDescriptor adErrRate1
const SgAgvDatumDescriptor adSrcStatus
const SgAgvDatumDescriptor adPolariz
const SgAgvDatumDescriptor adPCalFr1
const SgAgvDatumDescriptor adBlnClocks
const SgAgvDatumDescriptor adStaClRf
const SgAgvDatumDescriptor adObsCalNam
const SgAgvDatumDescriptor adExpName
const SgAgvDatumDescriptor adTectPlNm
const SgAgvDatumDescriptor adAtmCflg
const SgAgvDatumDescriptor adPlxCflg
const SgAgvDatumDescriptor adStrCflg
const SgAgvDatumDescriptor adMk3DbName
const SgAgvDatumDescriptor adGrRate
const SgAgvDatumDescriptor adRelData
const SgAgvDatumDescriptor adElTheo
const SgAgvDatumDescriptor adTlRtCns
const SgAgvDatumDescriptor adChanId2
const SgAgvDatumDescriptor adCorrType
const SgAgvDatumDescriptor adResGrRat
const SgAgvDatumDescriptor adThRuDat
const SgAgvDatumDescriptor adUt1Ortho
const SgAgvDatumDescriptor adNSampls2
const SgAgvDatumDescriptor adUserSup
const SgAgvDatumDescriptor adNumSrc
const SgAgvDatumDescriptor adStrtOffst
const SgAgvDatumDescriptor adFourUtc
const SgAgvDatumDescriptor adWobPart
const SgAgvDatumDescriptor adTidalUt1
const SgAgvDatumDescriptor adRwBasNam
const SgAgvDatumDescriptor adScanUtc
const SgAgvDatumDescriptor adChanWdt
const SgAgvDatumDescriptor adNdryPart
const SgAgvDatumDescriptor adCtiCflg
const SgAgvDatumDescriptor adCablOnTp
const SgAgvDatumDescriptor adUvChn2
const SgAgvDatumDescriptor adAprPhGc
const SgAgvDatumDescriptor adOceVert
const SgAgvDatumDescriptor adSitHWOPh
const SgAgvDatumDescriptor adNumbObs
const SgAgvDatumDescriptor adUAcSup
const SgAgvDatumDescriptor adAxisTilt
const SgAgvDatumDescriptor adOceMess
const SgAgvDatumDescriptor adPlxPart
const SgAgvDatumDescriptor adStnIdx
const SgAgvDatumDescriptor adCablOnTx
const SgAgvDatumDescriptor adCf2J2k_2
const SgAgvDatumDescriptor adNusedChnl
const SgAgvDatumDescriptor adChanId1
const SgAgvDatumDescriptor adEditSts
const SgAgvDatumDescriptor adFwobInf
const SgAgvDatumDescriptor adAtiMess
const SgAgvDatumDescriptor adCalcFlgV
const SgAgvDatumDescriptor adFourFtVer
const SgAgvDatumDescriptor adNwetCont
const SgAgvDatumDescriptor adWobOrtho
const SgAgvDatumDescriptor adZdelay
const SgAgvDatumDescriptor adOceOld
const SgAgvDatumDescriptor adMjdEop
const SgAgvDatumDescriptor adNumChnBnd
const SgAgvDatumDescriptor adEffFreq
const SgAgvDatumDescriptor adNumbSca
const SgAgvDatumDescriptor adFut1Text
const SgAgvDatumDescriptor adRateCen
const SgAgvDatumDescriptor adNcalib
const SgAgvDatumDescriptor adClkConstr
const SgAgvDatumDescriptor adAprioriAc
const SgAgvDatumDescriptor adStaUse
const SgAgvDatumDescriptor adPlx1pSec
const SgAgvDatumDescriptor adUt1Cflg
const SgAgvDatumDescriptor adPhCPhs2
const SgAgvDatumDescriptor adExpSerNo
const SgAgvDatumDescriptor adIonCorr
const SgAgvDatumDescriptor adNumChnTot
const SgAgvDatumDescriptor adClkInterv
const SgAgvDatumDescriptor adStPsCns
const SgAgvDatumDescriptor adPtdMess
const SgAgvDatumDescriptor adEffFrew
const SgAgvDatumDescriptor adFlyCalNam
const SgAgvDatumDescriptor adSitHWOAm
const SgAgvDatumDescriptor adTheMess
const SgAgvDatumDescriptor adStopOffst
const SgAgvDatumDescriptor adIncohAmp
const SgAgvDatumDescriptor adNut06xys
const SgAgvDatumDescriptor adWobMess
const SgAgvDatumDescriptor adErrRate2
const SgAgvDatumDescriptor adDelayFlag
const SgAgvDatumDescriptor adNumAp2
const SgAgvDatumDescriptor adPhRatIonE
const SgAgvDatumDescriptor adErrorBl
const SgAgvDatumDescriptor adFlybyFlg
const SgAgvDatumDescriptor adAxoMess
const SgAgvDatumDescriptor adTiltRmvr
const SgAgvDatumDescriptor adFwobText
const SgAgvDatumDescriptor adSiteZens
const SgAgvDatumDescriptor adStnCoord
const SgAgvDatumDescriptor adOceCont
const SgAgvDatumDescriptor adConsPart
const SgAgvDatumDescriptor adCtSite1
const SgAgvDatumDescriptor adNut2006a
const SgAgvDatumDescriptor adCiNum1
const SgAgvDatumDescriptor adAprRate
const SgAgvDatumDescriptor adTapQcode
const SgAgvDatumDescriptor adSoCoEst
const SgAgvDatumDescriptor adParangle
const SgAgvDatumDescriptor adQualCodes
const SgAgvDatumDescriptor adCalcVer
const SgAgvDatumDescriptor adExpDesc
const SgAgvDatumDescriptor adFourfFile
const SgAgvDatumDescriptor adEccTypes
const SgAgvDatumDescriptor adStepEop
const SgAgvDatumDescriptor adSamplRate
const SgAgvDatumDescriptor adRfFreq1
const SgAgvDatumDescriptor adNgradPar
const SgAgvDatumDescriptor adNumClRf
const SgAgvDatumDescriptor adOPTLCoef
const SgAgvDatumDescriptor adPtoLdCon
const SgAgvDatumDescriptor adCf2J2k_0
const SgAgvDatumDescriptor adUt1Mess
const SgAgvDatumDescriptor adUtcMtag
const SgAgvDatumDescriptor adOceStat
const SgAgvDatumDescriptor adPiName
const SgAgvDatumDescriptor adStnCalFlg
const SgAgvDatumDescriptor adDiscard
const SgAgvDatumDescriptor adSouUse
const SgAgvDatumDescriptor adAprPhas
const SgAgvDatumDescriptor adSun2cont
const SgAgvDatumDescriptor adUt1Libra
const SgAgvDatumDescriptor adSbDelErr
const SgAgvDatumDescriptor adWobXcont
const SgAgvDatumDescriptor adPhCAmp1
const SgAgvDatumDescriptor adFScanName
const SgAgvDatumDescriptor adAtiCflg
const SgAgvDatumDescriptor adIonoBits
const SgAgvDatumDescriptor adBlnStatus
const SgAgvDatumDescriptor adCorrUtc
const SgAgvDatumDescriptor adConCont
const SgAgvDatumDescriptor adTecSts
const SgAgvDatumDescriptor adSpChWdt
const SgAgvDatumDescriptor adPhRatErr
const SgAgvDatumDescriptor adFwobXnYt
const SgAgvDatumDescriptor adCbrSite
const SgAgvDatumDescriptor adNdryCont
const SgAgvDatumDescriptor adSkyFrqChn
const SgAgvDatumDescriptor adRecMode
const SgAgvDatumDescriptor adRefFreq
const SgAgvDatumDescriptor adStopSec
const SgAgvDatumDescriptor adCorrClock
const SgAgvDatumDescriptor adAxisOffs
const SgAgvDatumDescriptor adDeltaEpo
const SgAgvDatumDescriptor adFrnAmpl
const SgAgvDatumDescriptor adAutoSup
const SgAgvDatumDescriptor adNPhAmb
const SgAgvDatumDescriptor adCbrImjd
const SgAgvDatumDescriptor adIncohAmp2
const SgAgvDatumDescriptor adFrtOffs
const SgAgvDatumDescriptor adMjdObs
const SgAgvDatumDescriptor adPolariz2
const SgAgvDatumDescriptor adNumBands
const SgAgvDatumDescriptor adGcPhase
const SgAgvDatumDescriptor adGrRatErr
const SgAgvDatumDescriptor adIndChn2
const SgAgvDatumDescriptor adPhRatIonV
const SgAgvDatumDescriptor adAxoPart
const SgAgvDatumDescriptor adStarElev
const SgAgvDatumDescriptor adSitHSOAm
const SgAgvDatumDescriptor adPhcRate
const SgAgvDatumDescriptor adEarthCe
const SgAgvDatumDescriptor adGcPhsRes
const SgAgvDatumDescriptor adSrcApRef
const SgAgvDatumDescriptor adPhCOff1
const SgAgvDatumDescriptor adScanDur
const SgAgvDatumDescriptor adPhCFrq2
const SgAgvDatumDescriptor adNumLags
const SgAgvDatumDescriptor adAprioriRt
const SgAgvDatumDescriptor adSitOcAmp
const SgAgvDatumDescriptor adPCalFr2
const SgAgvDatumDescriptor adStPsEst
const SgAgvDatumDescriptor adCrootFnam
const SgAgvDatumDescriptor adSnr
const SgAgvDatumDescriptor adSitMess
const SgAgvDatumDescriptor adDerRat
const SgAgvDatumDescriptor adPtdXyPar
const SgAgvDatumDescriptor adUtcObs
const SgAgvDatumDescriptor adTaiEop
const SgAgvDatumDescriptor adUnPhaseCl
const SgAgvDatumDescriptor adPimaCnt
const SgAgvDatumDescriptor adBitsSampl
const SgAgvDatumDescriptor adDgClEst
const SgAgvDatumDescriptor adEopEst
const SgAgvDatumDescriptor adSbDelVal
const SgAgvDatumDescriptor adEtdCflg
const SgAgvDatumDescriptor adBsclCns
const SgAgvDatumDescriptor adUt1Epoch
const SgAgvDatumDescriptor adPreData
const SgAgvDatumDescriptor adSbResid
const SgAgvDatumDescriptor adAprioriDl
const SgAgvDatumDescriptor adSrtOffs
const SgAgvDatumDescriptor adResPhGc
const SgAgvDatumDescriptor adRwDelVal
const SgAgvDatumDescriptor adMeanCabl
@ ADS_SESSION
session scope
Definition: SgIoAgv.h:59
@ ADS_BASELINE
baseline scope
Definition: SgIoAgv.h:62
@ ADS_STATION
station scope
Definition: SgIoAgv.h:61
@ ADT_I8
baseline scope
Definition: SgIoAgv.h:72
@ ADT_CHAR
session scope
Definition: SgIoAgv.h:69
@ ADT_R4
baseline scope
Definition: SgIoAgv.h:73
@ ADT_R8
baseline scope
Definition: SgIoAgv.h:74
@ ADT_NONE
undefinite
Definition: SgIoAgv.h:68
@ ADT_I2
scan scope
Definition: SgIoAgv.h:70
@ ADT_I4
station scope
Definition: SgIoAgv.h:71
@ ACS_ANY
Definition: SgIoAgv.h:86
@ ACS_NATIVE
Definition: SgIoAgv.h:81
@ ACS_NONE
undefinited
Definition: SgIoAgv.h:80
@ ACS_GVH
Definition: SgIoAgv.h:85
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
#define DAY2SEC
radians to mas:
Definition: SgMathSupport.h:56
DIRECTION
Definition: SgMathSupport.h:68
@ Z_AXIS
Definition: SgMathSupport.h:68
@ X_AXIS
Definition: SgMathSupport.h:68
@ Y_AXIS
Definition: SgMathSupport.h:68
#define RAD2DEG
< radians to degrees:
Definition: SgMathSupport.h:32
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
double at(DIRECTION i, DIRECTION j) const
Definition: Sg3dMatrix.h:93
double at(DIRECTION i) const
Definition: Sg3dVector.h:91
void fillDataStructures(const SgVlbiSession *session, SgAgvDriver *drv)
Definition: SgIoAgv.cpp:1687
void importData(QTextStream &ts, SgAgvDriver *drv)
Definition: SgIoAgv.cpp:1728
int getIdx() const
Definition: SgIoAgv.h:497
void setDim2(int d)
Definition: SgIoAgv.h:138
AgvDataType getDataType() const
Definition: SgIoAgv.h:120
void setDim1(int d)
Definition: SgIoAgv.h:137
static QString dataType2str(AgvDataType)
Definition: SgIoAgv.cpp:201
int d3() const
Definition: SgIoAgv.h:152
int getDim1() const
Definition: SgIoAgv.h:122
void setDataType(AgvDataType typ)
Definition: SgIoAgv.h:135
void setDim4(int d)
Definition: SgIoAgv.h:140
void setLCode(const QString &lCode)
Definition: SgIoAgv.h:131
const QString & getLCode() const
Definition: SgIoAgv.h:116
int getDim3() const
Definition: SgIoAgv.h:124
bool getHasMutableScope() const
Definition: SgIoAgv.h:114
int d2() const
Definition: SgIoAgv.h:151
void setIsUsable(bool is)
Definition: SgIoAgv.h:143
const SgAgvDriver * getDriver() const
Definition: SgIoAgv.h:127
int d4() const
Definition: SgIoAgv.h:153
void setDataScope(AgvDataScope scope)
Definition: SgIoAgv.h:134
bool getHasData() const
Definition: SgIoAgv.h:112
bool isExpected(AgvContentStyle contentStyle) const
Definition: SgIoAgv.h:160
int getDim2() const
Definition: SgIoAgv.h:123
void setDim3(int d)
Definition: SgIoAgv.h:139
void setHasData(bool h)
Definition: SgIoAgv.h:142
AgvDataScope getDataScope() const
Definition: SgIoAgv.h:119
static QString dataScope2str(AgvDataScope)
Definition: SgIoAgv.cpp:210
void setDriver(SgAgvDriver *drv)
Definition: SgIoAgv.h:146
void setDescription(const QString &description)
Definition: SgIoAgv.h:132
int getDim4() const
Definition: SgIoAgv.h:125
const QString & getValue(int idx2, int idx3, int idx4) const
Definition: SgIoAgv.cpp:406
QString & value(int idx2, int idx3, int idx4)
Definition: SgIoAgv.cpp:426
SgAgvDatumDescriptor * descriptor()
Definition: SgIoAgv.h:242
C getValue(int idx1, int idx2, int idx3, int idx4) const
Definition: SgIoAgv.cpp:283
C & value(int idx1, int idx2, int idx3, int idx4)
Definition: SgIoAgv.cpp:305
void digestData(const QList< SgAgvRecord * > *)
SgAgvDatumDescriptor adDelWcen_
SgAgvDatumDescriptor adCbrSite_
SgAgvDatumDescriptor adResSbDel_
SgAgvDatumDescriptor adNcalib_
QMap< QString, int > bndIdxByKey_
SgAgvDatumDescriptor adResPhas_
SgAgvDatumDescriptor adFut1Pts_
void setCalcInfoModelMessNCtrlF(const QString &messLc, const QString &cflgLc, const SgModelsInfo::DasModel &model)
SgAgvDatumDescriptor adEffFrew_
SgAgvDatumDescriptor adUserRec_
QMap< int, int > numOfObsBySidx_
SgAgvDatumDescriptor adCalcFlgN_
SgAgvDatumDescriptor adAtiCflg_
SgAgvDatumDescriptor adSitHSOAm_
SgAgvDatumDescriptor adPhRatErr_
QMap< QString, SgAgvDatumDescriptor * > & datumByKey()
void getCalcInfoModelMessNCtrlF(const QString &messLc, const QString &cflgLc, SgModelsInfo::DasModel &model)
SgAgvDatumDescriptor adAtmConstr_
QMap< QString, SgAgvDatum< int > * > i4Data_
SgAgvDatumDescriptor adSitMess_
SgAgvDatumDescriptor adRelCflg_
SgAgvDatumDescriptor adDelWwdt_
SgAgvDatumDescriptor adSrtOffs_
SgAgvDatumDescriptor adFourUtc_
SgAgvDatumDescriptor adEtdCont_
SgAgvDatumDescriptor adWobPart_
SgAgvDatumDescriptor adClkConstr_
void allocateFuzzyDescriptors()
SgAgvDatumDescriptor adAutoSup_
SgAgvDatumDescriptor * adPhcPhs_
SgAgvDatumDescriptor adAprPhGc_
SgAgvDatumDescriptor adIndChn2_
SgAgvDatumDescriptor adWobLibra_
SgAgvDatumDescriptor adSitHSOPh_
SgAgvDatumDescriptor adLoFreq2_
static bool doubleVal(const QString &content, QString &lCode, int &d1, int &d2, int &d3, int &d4, double &val)
SgAgvDatumDescriptor adIonDtFlg_
SgAgvDatumDescriptor adPlxCflg_
SgAgvDatumDescriptor adMk3DbName_
bool insertDatum(QMap< QString, SgAgvDatumDescriptor * > &datumByKey, SgAgvDatumDescriptor *dd)
SgAgvDatumDescriptor adExpName_
SgAgvDatumDescriptor adStarElev_
SgAgvDatumDescriptor adNaprEop_
SgAgvDatumDescriptor adScanNames_
static bool intValNoRegEx(const QString &content, int &d1, int &d2, int &d3, int &d4, int &val)
SgAgvDatumDescriptor adExpDesc_
SgAgvDatumDescriptor adAxoCflg_
SgAgvDatumDescriptor adEopTab_
void allocateData()
SgAgvDatumDescriptor adNumbSta_
QList< QString > stnNames_
SgAgvDatumDescriptor adWobIntrp_
SgAgvDatumDescriptor adSupMet_
SgAgvDatumDescriptor adErrRate1_
SgAgvDatumDescriptor adFrtOffs_
SgAgvDatumDescriptor adSitPart_
SgAgvDatumDescriptor adAtmIntr_
void createDatum(SgAgvDatumDescriptor *dd)
SgAgvDatumDescriptor adCalSts_
SgAgvDatumDescriptor adQbFactor_
SgAgvDatumDescriptor adNutWahr_
SgAgvDatumDescriptor adAtmCns_
SgAgvDatumDescriptor adPhCAmp1_
QString data2str(SgAgvDatumDescriptor *dd, int idx1, int idx2, int idx3, int idx4)
SgAgvDatumDescriptor adTsys1_
const QString & path2File() const
Definition: SgIoAgvDriver.h:68
SgAgvDatumDescriptor adNSampls1_
static bool sintVal(const QString &content, QString &lCode, int &d1, int &d2, int &d3, int &d4, short int &val)
SgAgvDatumDescriptor adApByFrq2_
SgAgvDatumDescriptor adStepEop_
SgAgvDatumDescriptor adErrorBl_
SgAgvDriver(const SgIdentities *ids, const SgVersion *dv)
SgAgvDatumDescriptor adWobEpoch_
SgAgvDatumDescriptor adPCalFr2_
SgAgvDatumDescriptor adAprioriAc_
QMap< QString, SgAgvDatumString * > c1Data_
SgAgvDatumDescriptor adGcPhase_
QString path2File_
SgAgvDatumDescriptor adBendPart_
SgAgvDatumDescriptor adRateWdt_
SgAgvDatumDescriptor adRelData_
SgAgvDatumDescriptor adRfFreq2_
SgAgvDatumDescriptor adErrRate2_
SgAgvDatumDescriptor adNumChnBnd_
void initMandatoryVars()
void prepare4output()
bool importData(const QString &fileName)
SgAgvDatumDescriptor adEarthCe_
SgAgvDatumDescriptor adAprCloOf_
SgAgvDatumDescriptor adFlyCalNam_
SgAgvDatumDescriptor adOptlCont_
SgAgvDatumDescriptor adIonCorr_
SgAgvDatumDescriptor adPhaseFlag_
SgAgvDatumDescriptor adGrDelErr_
QMap< QString, SgAgvDatum< float > * > r4Data_
static bool lintValNoRegEx(const QString &content, int &d1, int &d2, int &d3, int &d4, long int &val)
SgAgvDatumDescriptor adAprRate_
SgAgvDatumDescriptor adPreData_
SgAgvDatumDescriptor adBitsSampl_
SgAgvDatumDescriptor adConsnDel_
SgAgvDatumDescriptor adSitHWOAm_
SgAgvDatumDescriptor adRelHumd_
SgAgvDatumDescriptor adAxoPart_
SgAgvDatumDescriptor adScanPima_
SgAgvDatumDescriptor adFourfCmd_
SgAgvDatumDescriptor adEffDura_
SgAgvDatumDescriptor adFalseDet_
SgAgvDatumDescriptor adConCont_
SgAgvDatumDescriptor adSiteNames_
SgAgvDatumDescriptor adFlybyFlg_
SgAgvDatumDescriptor adDeltaEpo_
AgvContentStyle expectedStyle_
SgAgvDatumDescriptor adThPhDel_
SgAgvDatumDescriptor adSnr_
SgAgvDatumDescriptor adNumGrAmbg_
SgAgvDatumDescriptor * adIndexNum_
SgAgvDatumDescriptor adFwobXnYt_
SgAgvDatumDescriptor adEccCoord_
SgAgvDatumDescriptor adFourfErr_
SgAgvDatumDescriptor adObsCalNam_
SgAgvDatumDescriptor adOceCflg_
bool exportData(const QString &path2File, const QString &fileName)
SgAgvDatumDescriptor adPCalFr1_
SgAgvDatumDescriptor adSrcStatus_
SgAgvDatumDescriptor adUt1Part_
SgAgvDatumDescriptor adPimaCnt_
SgAgvDatumDescriptor adOPTLCoef_
SgAgvDatumDescriptor * adLoRfFreq_
SgAgvDatumDescriptor adBbcIdx1_
QMap< QString, SgAgvDatumDescriptor * > mandatoryDatumByKey_
SgAgvDatumDescriptor adAxisTilt_
SgAgvDatumDescriptor adPindObs_
QList< SgAgvDatumDescriptor * > knownKeys_
SgAgvDatumDescriptor adDtecSig_
SgAgvDatumDescriptor * adPolarz_
SgAgvDatumDescriptor adPimaVer_
QString fileName_
SgAgvDatumDescriptor adGrResid_
SgAgvDatumDescriptor adAirTemp_
SgAgvDatumDescriptor adBandNames_
SgAgvDatumDescriptor adPanMess_
QVector< int > scanIdxByObsIdx_
SgAgvDatumDescriptor adNoiseRms_
SgAgvDatumDescriptor adFwobInf_
static bool intVal(const QString &content, QString &lCode, int &d1, int &d2, int &d3, int &d4, int &val)
SgAgvDatumDescriptor adPlxPart_
static bool strValNoRegEx(const QString &content, int &d1, int &d2, int &d3, int &d4, QString &val)
SgAgvDatumDescriptor adAntGain_
SgAgvDatumDescriptor adEffFreq_
SgAgvDatumDescriptor adRwBasNam_
void fillMandatoryVars()
SgAgvDatumDescriptor adAxoCont_
SgAgvDatumDescriptor adTlRtCns_
SgAgvDatumDescriptor adCloCns_
SgAgvDatumDescriptor adSitHWOPh_
SgAgvDatumDescriptor adGrDelAmbg_
SgAgvDatumDescriptor * adChAmpPhs_
SgAgvDatumDescriptor adCalInfo_
SgAgvDatumDescriptor adNumClRf_
SgAgvDatumDescriptor adOceDeld_
SgAgvDatumDescriptor adTectPlNm_
SgAgvDatumDescriptor adElev_
SgAgvDatumDescriptor adPhRatIonE_
SgAgvDatumDescriptor adCalcFlgV_
SgAgvDatumDescriptor adPolariz1_
SgAgvDatumDescriptor adResMbDel_
SgAgvDatumDescriptor adCbrImjd_
SgAgvDatumDescriptor adDgClEst_
SgAgvDatumDescriptor adIncohAmp_
QList< QString > scanFullNames_
SgAgvDatumDescriptor * adPhcFrq_
SgAgvDatumDescriptor adOceVert_
SgAgvDatumDescriptor adFourFtVer_
SgAgvDatumDescriptor adWobXcont_
SgAgvDatumDescriptor adUt1Epoch_
SgAgvDatumDescriptor adHopsVer_
SgAgvDatumDescriptor adChanId1_
SgAgvDatumDescriptor adOceMess_
static bool floatValNoRegEx(const QString &content, int &d1, int &d2, int &d3, int &d4, float &val)
SgAgvDatumDescriptor adClkInterv_
SgAgvDatumDescriptor adGcRate_
SgAgvDatumDescriptor adFut1Inf_
SgAgvDatumDescriptor adSoCoCns_
SgAgvDatumDescriptor adRefClocks_
SgAgvDatumDescriptor adIndChn1_
SgAgvDatumDescriptor adApByFrq1_
SgAgvDatumDescriptor adScanUtc_
SgAgvDatumDescriptor adBsclEst_
SgAgvDatumDescriptor adPhCFrq2_
SgAgvDatumDescriptor adCrootFnam_
SgAgvDatumDescriptor adPhCOff2_
SgAgvDatumDescriptor adCorrType_
SgAgvDatumDescriptor adSrcApRef_
SgAgvDatumDescriptor adNumAp1_
SgAgvDatumDescriptor adTaiEop_
SgAgvDatumDescriptor adMunData_
SgAgvDatumDescriptor adUtcMtag_
static bool strVal(const QString &content, QString &lCode, int &d1, int &d2, int &d3, int &d4, QString &val)
SgAgvDatumDescriptor adCf2J2k_0_
SgAgvDatumDescriptor adThRuDat_
SgAgvDatumDescriptor adNut2006a_
QMap< QString, int > stnIdxByKey_
SgAgvDatumDescriptor adResPhGc_
SgAgvDatumDescriptor * adNumOfAp_
SgAgvDatumDescriptor adCbrNumber_
SgAgvDatumDescriptor adStPsCns_
SgAgvDatumDescriptor adBlnClocks_
SgAgvDatumDescriptor adRateCen_
SgAgvDatumDescriptor adGrRate_
SgAgvDatumDescriptor adSrchPar_
SgAgvDatumDescriptor adNumbObs_
SgAgvDatumDescriptor adQualCodes_
QMap< QString, int > srcIdxByKey_
SgAgvDatumDescriptor adRwDelVal_
SgAgvDatumDescriptor adNdryCont_
SgAgvDatumDescriptor adSunCont_
SgAgvDatumDescriptor adSunData_
SgAgvDatumDescriptor adUt1_tai_
SgAgvDatumDescriptor adSbDelVal_
SgAgvDatumDescriptor adBbcIdx2_
QMap< QString, SgAgvDatum< long int > * > i8Data_
SgAgvDatumDescriptor * adBbcIdx_
SgAgvDatumDescriptor adNutDer_
SgAgvDatumDescriptor adStopOffst_
static bool floatVal(const QString &content, QString &lCode, int &d1, int &d2, int &d3, int &d4, float &val)
void initEssentialVars()
SgAgvDatumDescriptor adSbResid_
SgAgvDatumDescriptor adUtcObs_
SgAgvDatumDescriptor adGrDelIonV_
SgAgvDatumDescriptor adIncohAmp2_
SgAgvDatumDescriptor adAprDel_
SgAgvDatumDescriptor adBasUse_
SgAgvDatumDescriptor adTotPhase_
SgAgvDatumDescriptor adNwetCont_
SgAgvDatumDescriptor adCtiMess_
SgAgvDatumDescriptor adTecSts_
SgAgvDatumDescriptor adPhDelErr_
SgAgvDatumDescriptor adSpChWdt_
SgAgvDatumDescriptor adObsCalFlg_
SgAgvDatumDescriptor adChanWdt_
SgAgvDatumDescriptor adUtcMtai_
SgAgvDatumDescriptor adRwRatVal_
SgAgvDatumDescriptor adEccTypes_
SgAgvDatumDescriptor * adPhcAmp_
SgAgvDatumDescriptor adFourfFile_
SgAgvDatumDescriptor adCtSite1_
SgAgvDatumDescriptor adPhCAmp2_
SgAgvDatumDescriptor adStrCflg_
SgAgvDatumDescriptor adUt1Intrp_
SgAgvDatumDescriptor adGcMbDel_
SgAgvDatumDescriptor adTidalUt1_
SgAgvDatumDescriptor adUt1Ortho_
SgAgvDatumDescriptor adAtiMess_
SgAgvDatumDescriptor adSitOcPhs_
SgAgvDatumDescriptor adStnCalNam_
SgAgvDatumDescriptor adGrDelIonE_
SgAgvDatumDescriptor adNumbSca_
SgAgvDatumDescriptor adPolariz_
SgAgvDatumDescriptor adGcSbDel_
QList< QString > scanNames_
SgAgvDatumDescriptor adCalcVer_
SgAgvDatumDescriptor adStrMess_
SgAgvDatumDescriptor adPhRatIonV_
SgAgvDatumDescriptor adElTheo_
SgAgvDatumDescriptor adCalName_
SgAgvDatumDescriptor adBsclCns_
SgAgvDatumDescriptor adAxisTyps_
QList< SgAgvDatumDescriptor * > fuzzyDescriptors_
SgAgvDatumDescriptor adSitOcAmp_
SgAgvDatumDescriptor adNut06xys_
SgAgvDatumDescriptor adCbrTime_
SgAgvDatumDescriptor adPhcRate_
SgAgvDatumDescriptor adPCalCm2_
SgAgvDatumDescriptor adUvChn2_
static QString className()
Definition: SgIoAgvDriver.h:66
const QString & fileName() const
Definition: SgIoAgvDriver.h:69
SgAgvDatumDescriptor adPtoLdCon_
SgAgvDatumDescriptor adCtiCflg_
SgAgvDatumDescriptor adEopCns_
SgAgvDatumDescriptor adAzTheo_
SgAgvDatumDescriptor adUt1Libra_
SgAgvDatumDescriptor adEtdData_
SgAgvDatumDescriptor adNumBands_
SgAgvDatumDescriptor adResRate_
SgAgvDatumDescriptor * adErrRate_
SgAgvDatumDescriptor adPCalCm1_
SgAgvDatumDescriptor adNutMess_
SgAgvDatumDescriptor adAprCloRt_
SgAgvDatumDescriptor adCorVers_
SgAgvDatumDescriptor adSkyFrqChn_
SgAgvDatumDescriptor adNumSrc_
SgAgvDatumDescriptor * adPhcOff_
SgAgvDatumDescriptor adThProg_
SgAgvDatumDescriptor adNobsSta_
SgAgvDatumDescriptor adNgradPar_
SgAgvDatumDescriptor adAirPress_
SgAgvDatumDescriptor adNutCflg_
QList< QString > crootFileNames_
SgAgvDatumDescriptor adCorrPlace_
SgAgvDatumDescriptor adFeedCor_
SgAgvDatumDescriptor adWobYcont_
SgAgvDatumDescriptor adInterval4_
SgAgvDatumDescriptor * adRfFreq_
SgAgvDatumDescriptor adAprEop_
SgAgvDatumDescriptor adAtmInterv_
SgAgvDatumDescriptor adDaTyp_
SgAgvDatumDescriptor adEtdMess_
SgMJD startEpoch_
SgAgvDatumDescriptor adPhCOff1_
SgAgvDatumDescriptor adUAcSup_
SgAgvDatumDescriptor adMjdObs_
SgAgvDatumDescriptor adResGrRat_
SgAgvDatumDescriptor adFwobText_
SgAgvDatumDescriptor adFrTypFit_
QMap< QString, SgAgvDatum< short int > * > i2Data_
SgAgvDatumDescriptor adNumSam1_
SgAgvDatumDescriptor adStPsEst_
QList< QString > scanSrcNames_
SgAgvDatumDescriptor adGcPhsRes_
SgAgvDatumDescriptor adPlx1pSec_
SgAgvDatumDescriptor adSbDelErr_
SgAgvDatumDescriptor adConsPart_
SgAgvDatumDescriptor adWobOrtho_
SgAgvDatumDescriptor adCorrelatn_
SgAgvDatumDescriptor adNdryPart_
static bool lintVal(const QString &content, QString &lCode, int &d1, int &d2, int &d3, int &d4, long int &val)
SgAgvDatumDescriptor adDerRat_
SgAgvDatumDescriptor adRtResid_
SgAgvDatumDescriptor adPtdXyPar_
SgAgvDatumDescriptor adAprioriRt_
SgAgvDatumDescriptor adEopEst_
SgAgvDatumDescriptor adUvStaOrd_
SgAgvDatumDescriptor adDelayFlag_
SgAgvDatumDescriptor adIdelay_
SgAgvDatumDescriptor * adChanId_
SgAgvDatumDescriptor adAxisOffs_
SgAgvDatumDescriptor adScanDur_
QMap< QString, int > numOfObsByStn_
SgAgvDatumDescriptor adZdelay_
SgAgvDatumDescriptor adSouUse_
SgAgvDatumDescriptor adFScanName_
SgAgvDatumDescriptor adLoFreq1_
SgAgvDatumDescriptor adAprioriDl_
SgAgvDatumDescriptor adPepMess_
SgAgvDatumDescriptor adFourfCtrl_
SgAgvDatumDescriptor adPtdCont_
SgAgvDatumDescriptor adDtec_
SgAgvDatumDescriptor adExpCode_
SgAgvDatumDescriptor adOceOld_
SgAgvDatumDescriptor adTsys2_
SgAgvDatumDescriptor adPhCPhs1_
SgAgvDatumDescriptor adGrRatErr_
SgAgvDatumDescriptor adResGrDl_
SgAgvDatumDescriptor adSiteZens_
SgAgvDatumDescriptor adCablOnTp_
SgAgvDatumDescriptor adAtmCflg_
SgAgvDatumDescriptor adSrcIdx_
QMap< QString, SgMJD > epochByScanFullName_
SgAgvDatumDescriptor adStaUse_
SgAgvDatumDescriptor adParangle_
SgAgvDatumDescriptor adSamplRate_
SgAgvDatumDescriptor adStopSec_
SgAgvDatumDescriptor adPhCFrq1_
SgAgvDatumDescriptor adNumAp2_
SgAgvDatumDescriptor adOceCont_
SgAgvDatumDescriptor adIonRms_
void figureOutImplicitDimensions(const QList< SgAgvRecord * > *)
SgAgvDatumDescriptor adStrPart_
SgAgvDatumDescriptor adCablOnTx_
SgAgvDatumDescriptor adMjdEop_
SgAgvDatumDescriptor adChanId2_
SgAgvDatumDescriptor adNumAvaBnd_
SgAgvDatumDescriptor adCf2J2k_1_
SgAgvDatumDescriptor adChanSdb_
AgvContentStyle getExpectedStyle() const
Definition: SgIoAgvDriver.h:71
SgAgvDatumDescriptor adPtdMess_
SgAgvDatumDescriptor adPolarXy_
SgAgvDatumDescriptor adOceHorz_
QMap< QString, int > numOfChansByBand_
SgAgvDatumDescriptor adUt1Mess_
SgAgvDatumDescriptor adNSampls2_
SgVlbiSession * session_
SgAgvDatumDescriptor adPtdCflg_
SgAgvDatumDescriptor adPolariz2_
SgAgvDatumDescriptor adCf2J2k_2_
virtual const QList< QString > listOfInputFiles() const
SgAgvDatumDescriptor adCorrClock_
SgAgvDatumDescriptor adConsnRat_
SgAgvDatumDescriptor adBlnStatus_
SgAgvDatumDescriptor adUvf_Asec_
SgAgvDatumDescriptor adThGrDel_
SgAgvDatumDescriptor adCorBasCd_
SgAgvDatumDescriptor adObsTab_
SgAgvDatumDescriptor adUserSup_
QMap< QString, SgAgvDatum< double > * > r8Data_
SgAgvDatumDescriptor adPiName_
SgAgvDatumDescriptor adWobMess_
static bool sintValNoRegEx(const QString &content, int &d1, int &d2, int &d3, int &d4, short int &val)
SgAgvDatumDescriptor adPlxMess_
SgAgvDatumDescriptor adStrtOffst_
SgAgvDatumDescriptor adNumSam2_
SgAgvDatumDescriptor adTlOfCns_
SgAgvDatumDescriptor adNut06Xyp_
SgAgvDatumDescriptor adUt1Cflg_
SgAgvDatumDescriptor adGrDelVal_
void lookupFuzzyDescriptor(const QString &lc, int bndIdx, const QList< QString > &bandNames, SgAgvDatumDescriptor *&dd, bool doCheckNumOfChannels, unsigned int expectedStyles)
SgAgvDatumDescriptor adSoCoEst_
SgAgvDatumDescriptor adStnCoord_
SgAgvDatumDescriptor adEditSts_
SgAgvDatumDescriptor adEccNames_
SgAgvDatumDescriptor adUvCoord_
SgAgvDatumDescriptor adDiscard_
SgAgvDatumDescriptor adCloIntr_
SgAgvDatumDescriptor adAprPhas_
SgAgvDatumDescriptor adSrcName_
SgAgvDatumDescriptor adIonoBits_
QMap< QString, SgAgvDatumDescriptor * > datumByKey_
static bool doubleValNoRegEx(const QString &content, int &d1, int &d2, int &d3, int &d4, double &val)
SgAgvDatumDescriptor adUvChn1_
SgAgvDatumDescriptor adNwetPart_
SgAgvDatumDescriptor adRefFreq_
SgAgvDatumDescriptor adNusedChnl_
SgAgvDatumDescriptor adPhCPhs2_
SgAgvDatumDescriptor adRateFlag_
SgAgvDatumDescriptor adExpSerNo_
SgAgvDatumDescriptor adStartSec_
SgAgvDatumDescriptor adStnIdx_
SgAgvDatumDescriptor adDelRate_
SgAgvDatumDescriptor adCorrUtc_
SgAgvDatumDescriptor * adNumSmpls_
SgAgvDatumDescriptor adAxoMess_
SgAgvDatumDescriptor adBand2nd_
SgAgvDatumDescriptor adSrcCoord_
SgAgvDatumDescriptor adMeanCabl_
SgAgvDatumDescriptor adMeteOnTx_
SgAgvDatumDescriptor adApLength_
SgAgvDatumDescriptor adRfFreq1_
SgAgvDatumDescriptor adErrorK_
SgAgvDatumDescriptor adMeteOnTp_
SgAgvDatumDescriptor adFut1Text_
SgAgvDatumDescriptor adNPhAmb_
void checkCollectedDescriptors()
SgAgvDatumDescriptor adCableDel_
SgAgvDatumDescriptor adDerDel_
SgAgvDatumDescriptor adUrVr_
SgAgvDatumDescriptor adTilIntr_
void fillDataStructures()
SgAgvDatumDescriptor adRecMode_
SgAgvDatumDescriptor adNumChnTot_
SgAgvDatumDescriptor adOceStat_
SgAgvDatumDescriptor adTheMess_
SgAgvDatumDescriptor adFrnAmpl_
SgAgvDatumDescriptor adWobCflg_
SgAgvDatumDescriptor * adIndChn_
SgAgvDatumDescriptor adUnPhaseCl_
SgAgvDatumDescriptor adResPhRat_
SgAgvDatumDescriptor adCiNum1_
SgAgvDatumDescriptor adEtdCflg_
SgAgvDatumDescriptor adSun2cont_
SgAgvDatumDescriptor adThPhRat_
static bool getContentIdxs(const QString &str, int &d1, int &d2, int &d3, int &d4)
SgAgvDatumDescriptor adNumLags_
SgAgvDatumDescriptor adCableSgn_
SgAgvDatumDescriptor adAzimuth_
void digestDataNoRegEx(const QList< SgAgvRecord * > *)
SgAgvDatumDescriptor adTapQcode_
SgAgvDatumDescriptor adStnCalFlg_
SgAgvDatumDescriptor adTiltRmvr_
SgAgvDatumDescriptor adAtmMess_
SgAgvDatumDescriptor adStaClRf_
bool isAttr(uint a) const
Definition: SgAttribute.h:226
void delAttr(uint a)
Definition: SgAttribute.h:210
void addAttr(uint a)
Definition: SgAttribute.h:202
bool addBreak(const SgMJD &t, double a0=0.0, double a1=0.0, double a2=0.0, bool isDynamic=false)
void setDR(const Sg3dVector &)
Definition: SgEccRec.h:299
@ ET_NEU
Definition: SgEccRec.h:51
@ ET_N_A
Definition: SgEccRec.h:50
@ ET_XYZ
Definition: SgEccRec.h:52
const QString & getCdpNumber() const
Definition: SgEccRec.h:211
EccType getEccType() const
Definition: SgEccRec.h:251
const Sg3dVector & getDR() const
Definition: SgEccRec.h:243
void setEccType(EccType)
Definition: SgEccRec.h:307
void setCdpNumber(const QString &)
Definition: SgEccRec.h:267
void setMachineMachineName(const QString &)
Definition: SgIdentities.h:415
void setAcAbbrevName(const QString &)
Definition: SgIdentities.h:367
void setAcFullName(const QString &)
Definition: SgIdentities.h:359
void setCurrentDir(const QString &)
Definition: SgIdentities.h:391
void setAcAbbName(const QString &)
Definition: SgIdentities.h:375
void setMachineNodeName(const QString &)
Definition: SgIdentities.h:407
void setMachineRelease(const QString &)
Definition: SgIdentities.h:431
void setUserDefaultInitials(const QString &)
Definition: SgIdentities.h:351
void setUserEmailAddress(const QString &)
Definition: SgIdentities.h:343
void setExecBinaryName(const QString &)
Definition: SgIdentities.h:399
void setMachineSysName(const QString &)
Definition: SgIdentities.h:423
void setUserName(const QString &)
Definition: SgIdentities.h:335
void setExecDir(const QString &)
Definition: SgIdentities.h:383
const SgMJD & getDateOfCreation() const
Definition: SgIoDriver.h:100
SgIdentities * inputIdentities_
Definition: SgIoDriver.h:135
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_NCDF
Definition: SgLogger.h:66
@ IO_TXT
Definition: SgLogger.h:65
@ IO_DBH
Definition: SgLogger.h:67
Definition: SgMJD.h:59
double getTime() const
Definition: SgMJD.h:457
void setTime(double dTime)
Definition: SgMJD.cpp:165
@ F_INTERNAL
Digits, date and time: 20100402.71.
Definition: SgMJD.h:72
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1007
void toYMDHMS_tr(int &nYear, int &nMonth, int &nDay, int &nHour, int &nMin, double &dSec) const
Definition: SgMJD.cpp:1305
int getDate() const
Definition: SgMJD.h:449
static SgMJD currentMJD()
Definition: SgMJD.cpp:118
static void MJD_reverse(int date, double time, int &nYear, int &nMonth, int &nDay, int &nHour, int &nMin, double &dSec)
Definition: SgMJD.cpp:74
void setDate(int nDays)
Definition: SgMJD.h:465
unsigned int nRow() const
Definition: SgMatrix.h:352
void setElement(unsigned int i, unsigned int j, double d)
Definition: SgMatrix.h:402
double getElement(unsigned int i, unsigned int j) const
Definition: SgMatrix.h:385
double getPressure() const
Definition: SgMeteoData.h:242
void setRelativeHumidity(double rho)
Definition: SgMeteoData.h:274
double getTemperature() const
Definition: SgMeteoData.h:234
void setTemperature(double t)
Definition: SgMeteoData.h:258
void setPressure(double p)
Definition: SgMeteoData.h:266
double getRelativeHumidity() const
Definition: SgMeteoData.h:250
void setDefinition(const QString &def)
Definition: SgModelsInfo.h:73
const QString & getDefinition() const
Definition: SgModelsInfo.h:68
void setOrigin(const QString &orig)
Definition: SgModelsInfo.h:74
const QString & getOrigin() const
Definition: SgModelsInfo.h:69
const QString & getControlFlag() const
Definition: SgModelsInfo.h:67
void setControlFlag(const QString &flag)
Definition: SgModelsInfo.h:72
void prepareWobInterpData(int nRow)
double getPrecessionData() const
Definition: SgModelsInfo.h:118
QList< SgVlbiStationInfo * > & stations()
Definition: SgModelsInfo.h:155
DasModel & troposphere()
Definition: SgModelsInfo.h:145
DasModel & ut1Interpolation()
Definition: SgModelsInfo.h:140
QList< QString > & oLoadStationStatus()
Definition: SgModelsInfo.h:151
DasModel & earthTide()
Definition: SgModelsInfo.h:142
SgMatrix *& wobInterpData()
Definition: SgModelsInfo.h:154
void setDversion(double d)
Definition: SgModelsInfo.h:123
short getFlagTidalUt1() const
Definition: SgModelsInfo.h:116
DasModel & nutation()
Definition: SgModelsInfo.h:141
DasModel & coordinateTime()
Definition: SgModelsInfo.h:134
double getRelativityData() const
Definition: SgModelsInfo.h:117
QList< QString > & controlFlagNames()
Definition: SgModelsInfo.h:149
void setEarthTideData(int i, double d)
Definition: SgModelsInfo.h:128
DasModel & feedHorn()
Definition: SgModelsInfo.h:148
void setFlagTidalUt1(short f)
Definition: SgModelsInfo.h:125
DasModel & polarMotion()
Definition: SgModelsInfo.h:137
DasModel & atomicTime()
Definition: SgModelsInfo.h:135
QList< double > & siteZenDelays()
Definition: SgModelsInfo.h:152
SgMatrix *& ut1InterpData()
Definition: SgModelsInfo.h:153
DasModel & oceanLoading()
Definition: SgModelsInfo.h:144
DasModel & parallax()
Definition: SgModelsInfo.h:147
DasModel & poleTide()
Definition: SgModelsInfo.h:143
DasModel & polarMotionInterpolation()
Definition: SgModelsInfo.h:138
void setPrecessionData(double d)
Definition: SgModelsInfo.h:127
DasModel & ephemeris()
Definition: SgModelsInfo.h:133
void prepareUt1InterpData(int nRow)
DasModel & star()
Definition: SgModelsInfo.h:132
double getDversion() const
Definition: SgModelsInfo.h:114
DasModel & site()
Definition: SgModelsInfo.h:131
QList< int > & controlFlagValues()
Definition: SgModelsInfo.h:150
DasModel & axisOffset()
Definition: SgModelsInfo.h:146
DasModel & ut1()
Definition: SgModelsInfo.h:139
double getEarthTideData(int i) const
Definition: SgModelsInfo.h:119
void setRelativityData(double d)
Definition: SgModelsInfo.h:126
DasModel & relativity()
Definition: SgModelsInfo.h:136
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
double getSigma2add(DataType) const
Definition: SgObjectInfo.h:367
const QString & getKey() const
Definition: SgObjectInfo.h:319
void setSigma2add(DataType dType, double d)
Definition: SgObjectInfo.h:471
int numTotal(DataType dType) const
Definition: SgObjectInfo.h:343
virtual void setMediaIdx(int idx)
virtual void setMJD(const SgMJD &)
@ Attr_NOT_VALID
omit the observation;
Definition: SgObservation.h:78
@ Attr_PROCESSED
the observation has been processed;
Definition: SgObservation.h:79
const SgMJD & getEpoch4Export() const
Definition: SgBreakModel.h:411
@ Attr_DYNAMIC
parameters supposed to be estimated during the common solution;
Definition: SgBreakModel.h:60
double getPwlStep() const
double getPwlAPriori() const
void setPwlStep(double s)
void setPwlAPriori(double)
bool getUseSolveObsSuppresionFlags() const
Definition: SgTaskConfig.h:913
@ CT_ALL_TERMS_REMOVED
Definition: SgTidalUt1.h:53
@ CT_SHORT_TERMS_REMOVED
Definition: SgTidalUt1.h:52
unsigned int n() const
Definition: SgVector.h:327
void setElement(unsigned int i, double d)
Definition: SgVector.h:348
double getElement(unsigned int i) const
Definition: SgVector.h:362
double getDrat_dAxsOfs() const
void setOcnLdV(const Sg3dVector &v)
double getCalcAxisOffset4Rate() const
void setCableCalibration(double cable)
void setAzimuthAngle(double angle)
void setDdel_dTzdDry(double v)
double getDdel_dTzdGrdN() const
double getCableCalibration() const
double getCalcOLoadHorz4Delay() const
double getCalcOLoadVert4Rate() const
double getCalcAxisOffset4Delay() const
void setCalcNwetCont4Delay(double v)
double getCalcOLoadVert4Delay() const
double getElevationAngle() const
double getDrat_dTzdWet() const
double getCalcNwetCont4Delay() const
void setCalcNdryCont4Delay(double v)
void setDrat_dTzdWet(double v)
const Sg3dVector & getOcnLdR() const
void setCalcOLoadHorz4Delay(double v)
void setCalcOLoadHorz4Rate(double v)
void setDdel_dTzdGrdE(double v)
double getElevationAngleRate() const
void setAzimuthAngleRate(double rate)
void setCalcOLoadVert4Rate(double v)
void setDrat_dTzdGrdE(double v)
void setParallacticAngle(double angle)
double getDrat_dTzdGrdN() const
double getCalcNdryCont4Rate() const
double getCalcNdryCont4Delay() const
void setDdel_dTzdGrdN(double v)
void setCalcOLoadVert4Delay(double v)
void setCalcAxisOffset4Delay(double v)
void setDrat_dTzdGrdN(double v)
double getParallacticAngle() const
double getDdel_dTzdWet() const
void setOcnLdR(const Sg3dVector &r)
double getCalcNwetCont4Rate() const
void setCalcNwetCont4Rate(double v)
void setElevationAngle(double angle)
void setElevationAngleRate(double rate)
double getAzimuthAngle() const
double getDrat_dTzdDry() const
void setCalcNdryCont4Rate(double v)
double getDdel_dTzdDry() const
void setDdel_dTzdWet(double v)
void setDrat_dTzdDry(double v)
double getAzimuthAngleRate() const
double getDdel_dAxsOfs() const
double getDrat_dTzdGrdE() const
void setCalcAxisOffset4Rate(double v)
double getCalcOLoadHorz4Rate() const
double getDdel_dTzdGrdE() const
const Sg3dVector & getOcnLdV() const
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
SgVlbiHistory & history()
Definition: SgVlbiBand.h:360
QMap< int, SgVlbiStationInfo * > & stationsByIdx()
Definition: SgVlbiBand.h:296
const QString & getCorrelatorType() const
Definition: SgVlbiBand.h:352
@ Attr_HAS_IONO_SOLUTION
the band contains ionospheric corrections;
Definition: SgVlbiBand.h:61
@ Attr_ESTIMATE_CLOCKS
estimate baseline clocks;
@ Attr_NOT_VALID
omit the baseline;
void setAmbiguitySpacing(double)
double getEffFreq() const
double getGeocenterValue() const
void setEffFreqEqWgt(double)
short int getUnweightFlag() const
void setIonoSigma(double)
double getAmbiguitySpacing() const
void setEffFreq(double)
void setNumOfAmbiguities(int)
double getValue() const
void setIonoValue(double)
int getNumOfAmbiguities() const
double getSigma() const
double getIonoValue() const
void setResidualFringeFitting(double r)
double getEffFreqEqWgt() const
void setGeocenterValue(double)
double getResidualFringeFitting() const
void setUnweightFlag(short int)
double getIonoSigma() const
QVector< int > * corelIndexNumLSB()
void setEpochOfCorrelation(const SgMJD &)
const QString & getFourfitOutputFName() const
void setNumOfChannels(int)
void setEpochCentral(const SgMJD &)
double getUvFrPerAsec(int i) const
double getPhaseCalGrDelays(int i) const
void setBitsPerSample(int bps)
int getQualityFactor() const
void setTstart(const SgMJD &t)
void setCorrClocks(int i, int j, double d)
void setTotalPhase(double)
void setHopsRevisionNumber(int num)
const SgMJD & getEpochOfCorrelation() const
void setPhaseCalGrDelays(int i, double d)
double getSampleRate() const
QVector< char > * polarization_1ByChan()
double getInstrDelay(int i) const
SgVector * loFreqByChan_1()
QVector< char > * chanIdByChan()
void setIncohSegmAddAmp(double d)
QVector< int > * corelIndexNumUSB()
double getFourfitSearchParameters(int i) const
int getNumOfChannels() const
const QString & getTapeQualityCode() const
SgMatrix * phaseCalData_2ByChan()
void setAcceptedRatio(double d)
const QString & getErrorCode() const
const SgMJD & getEpochOfScan() const
void setTstop(const SgMJD &t)
double getIncohChanAddAmp() const
void setEpochOfFourfitting(const SgMJD &)
SgVlbiObservation * owner()
SgVector * numOfAccPeriodsByChan_LSB()
double getAcceptedRatio() const
void setIncohChanAddAmp(double d)
const SgMJD & getEpochOfFourfitting() const
double getCalcFeedCorrDelay() const
void setCentrOffset(double offset)
double getProbabOfFalseDetection() const
void setEffIntegrationTime(double d)
void setFourfitOutputFName(const QString &)
QVector< char > * polarization_2ByChan()
SgVector * numOfAccPeriodsByChan_USB()
QVector< int > * bbcIdxByChan_1()
void setFourfitControlFile(const QString &cf)
SgVlbiMeasurement & phDRate()
void setGeocenterResidPhase(double d)
void setCorrelStarElev_2(double v)
void setSnr(double)
void setProbabOfFalseDetection(double d)
void setQualityFactor(int)
QString strId() const
double getCorrelZdelay_1() const
double getGeocenterTotalPhase() const
void setNlags(int n)
void setGeocenterTotalPhase(double d)
double getEffIntegrationTime() const
const SgMJD & getTstop() const
void setDiscardRatio(double d)
double getCorrClocks(int i, int j) const
SgVector * fringeAmplitudeByChan()
void setCorrCoeff(double)
void setEpochOfScan(const SgMJD &)
void setUrVr(int i, double d)
void setCorrelZdelay_1(double v)
int getStartOffset() const
double getUrVr(int i) const
double getCentrOffset() const
SgVector * numOfSamplesByChan_LSB()
double getAprioriDra(int i) const
void setAprioriDra(int i, double d)
void setInstrDelay(int i, double d)
double getCorrelStarElev_2() const
double getDiscardRatio() const
int getNlags() const
double getTotalPhase() const
void setStopOffset(int offset)
int getHopsRevisionNumber() const
int getFourfitVersion(int idx) const
const QString & getFourfitControlFile() const
double getIncohSegmAddAmp() const
int getStopOffset() const
void setUvFrPerAsec(int i, double d)
void setErrorCode(const QString &)
double getSnr() const
SgMatrix * phaseCalData_1ByChan()
const QString & getBandKey() const
SgVector * numOfSamplesByChan_USB()
void setFourfitCommandOverride(const QString &co)
const QString & getFourfitCommandOverride() const
void setReferenceFrequency(double)
double getPhaseCalRates(int i) const
void setCorrelZdelay_2(double v)
double getCalcFeedCorrRate() const
double getReferenceFrequency() const
void allocateChannelsSetupStorages(int numOfChans)
SgVlbiMeasurement & phDelay()
void setTapeQualityCode(const QString &code)
double getCorrelStarElev_1() const
int getBitsPerSample() const
void setCalcFeedCorrDelay(double v)
const SgMJD & getEpochCentral() const
double getCorrCoeff() const
SgVector * loFreqByChan_2()
SgVlbiMeasurement & grDelay()
void setStartOffset(int offset)
SgVlbiMeasurement & sbDelay()
SgVector * fringePhaseByChan()
double getGeocenterResidPhase() const
SgVector * refFreqByChan()
void setFourfitSearchParameters(int i, double d)
void setSampleRate(double sr)
void setCorrelStarElev_1(double v)
void setCalcFeedCorrRate(double v)
QVector< int > * bbcIdxByChan_2()
const SgMJD & getTstart() const
double getCorrelZdelay_2() const
void setFourfitVersion(int idx, int ver)
void setCalcOceanTideDelay(double v)
void setCalcHiFyPxyRate(double v)
double getDrat_dCipY() const
double getCalcCipXv() const
void setCalcNut2006_dPsiV(double v)
double getCalcNutWahr_dEpsV() const
void setStation1Idx(short int idx)
void setRearth(const Sg3dVector &r)
void setScanId(const QString &sId)
void setCalcConsBendingRate(double d)
double getCalcTiltRemvrRate() const
void setCalcHiFyPxyDelay(double v)
double getCalcPoleTideOldDelay() const
const Sg3dVector & getVearth() const
double getCalcCipSr() const
double getCalcTiltRemvrDelay() const
void setDdel_dRA(double d)
void setDrat_dPolTideY(double d)
void setCalcOceanPoleTideLdDelay(double v)
SgVlbiStationInfo * stn_1()
void setDrat_dR_1(const Sg3dVector &r)
void setCalcHiFyUt1Rate(double v)
void setCalcPxDelay(double v)
const Sg3dMatrix & getTrf2crfAcc() const
void setSourceIdx(short int idx)
double getCalcOceanPoleTideLdDelay() const
void setCalcNut2006_dEpsV(double v)
void setCalcPoleTideDelay(double v)
void setDdel_dGamma(double d)
void setApLength(double d)
void setCalcTiltRemvrRate(double v)
double getCalcConsBendingSunRate() const
void setCalcConsBendingSunRate(double d)
double getCalcNutWahr_dPsiV() const
bool addObservable(const QString &, const SgVlbiObservable &)
double getCalcPmX() const
void setRsun(const Sg3dVector &r)
SgVlbiSourceInfo * src()
void setCalcEarthTideDelay(double v)
void setCalcConsensusDelay(double tau)
void setDTecStdDev(double e)
void setCalcNut2006_dPsiR(double v)
double getCalcPxDelay() const
void setCalcNut2006_dEpsR(double v)
void setVsun(const Sg3dVector &v)
void setCalcHiFyPxyLibrationRate(double v)
double getCalcOceanTideDelay() const
double getDdel_dDN() const
double getDdel_dParallaxRev() const
void setCalcPyDelay(double v)
double getCalcOceanPoleTideLdRate() const
void setScanName(const QString &sName)
double getDTecStdDev() const
void setCalcCipSr(double v)
double getCalcNut2006_dPsiV() const
void setCalcPoleTideOldDelay(double v)
void setDrat_dPolTideX(double d)
void setCalcPoleTideRate(double v)
void setCalcHiFyUt1LibrationDelay(double v)
void setCalcPmY(double d)
const Sg3dVector & getRmoon() const
const Sg3dMatrix & getTrf2crfVal() const
double getCalcCipYv() const
const QString & getScanFullName() const
double getDrat_dGamma() const
void setDTec(double d)
double getCalcPyDelay() const
void setVmoon(const Sg3dVector &v)
void setCalcConsBendingSunHigherDelay(double d)
void setCalcConsensusRate(double r)
void setCalcUt1_Tai(double d)
void setCalcNutWahr_dEpsV(double v)
void setCalcNutWahr_dPsiV(double v)
double getDdel_dBend() const
const Sg3dVector & getVsun() const
double getDdel_dPy() const
double getCalcConsBendingSunHigherRate() const
void setDrat_dParallaxRev(double d)
double getApLength() const
void setDrat_dCipY(double d)
void setCalcCipYv(double v)
double getDrat_dPx() const
double getCalcNutWahr_dPsiR() const
void setDrat_dGamma(double d)
Sg3dMatrix & trf2crfRat()
void setCalcOceanTideOldRate(double v)
double getDdel_dPolTideX() const
void setupActiveObservable(const QString &)
void setDrat_dRA(double d)
void setCorrRootFileName(const QString &sName)
void setD2rat_dUT12(double d)
double getCalcConsBendingSunDelay() const
void setCalcHiFyPxyLibrationDelay(double v)
double getCalcCipXr() const
double getCalcPoleTideOldRate() const
void setCalcPmX(double d)
double getCalcConsBendingSunHigherDelay() const
double getCalcNut2006_dEpsV() const
double getCalcConsBendingDelay() const
double getCalcEarthTideDelay() const
const Sg3dVector & getDdel_dR_1() const
void setCalcOceanTideOldDelay(double v)
void setDdel_dR_1(const Sg3dVector &r)
void setDdel_dUT1(double d)
double getCalcConsensusRate() const
void setDrat_dBend(double d)
void setVearth(const Sg3dVector &v)
double getFractC() const
double getCalcHiFyPxyRate() const
double getD2rat_dUT12() const
double getDrat_dCipX() const
double getCalcCipYr() const
void setDdel_dPolTideX(double d)
void setCalcCipXr(double v)
void setCalcCipSv(double v)
double getDrat_dPolTideY() const
double getCalcPxRate() const
void setCalcConsBendingSunHigherRate(double d)
double getCalcPyRate() const
const Sg3dVector & getRearth() const
double getCalcPoleTideRate() const
double getDrat_dBend() const
double getCalcCipSv() const
double getCalcHiFyUt1LibrationRate() const
SgVlbiStationInfo * stn_2()
void setDdel_dCipY(double d)
const Sg3dVector & getVmoon() const
const QString & getCorrRootFileName() const
double getDdel_dCipY() const
void setStation2Idx(short int idx)
double getCalcNut2006_dPsiR() const
double getCalcHiFyPxyLibrationRate() const
double getDTec() const
void setCalcCipXv(double v)
void setDrat_dParallax(double d)
void setCalcNutWahr_dEpsR(double v)
double getD2del_dUT12() const
double getDrat_dUT1() const
void setDdel_dParallax(double d)
SgVlbiObservable * primeObs()
void setCalcEarthTideRate(double v)
double getCalcConsBendingRate() const
void setDdel_dPy(double d)
void setD2del_dUT12(double d)
const Sg3dMatrix & getTrf2crfRat() const
double getCalcEarthTideRate() const
const QString & getScanName() const
double getDdel_dPx() const
double getDrat_dPy() const
void setDdel_dPx(double d)
const Sg3dVector & getDrat_dR_1() const
QMap< QString, SgVlbiObservable * > & observableByKey()
void setCalcTiltRemvrDelay(double v)
void setDdel_dCipX(double d)
double getCalcHiFyPxyLibrationDelay() const
const QString & getScanId() const
void setRmoon(const Sg3dVector &r)
void setCalcOceanPoleTideLdRate(double v)
double getDrat_dPolTideX() const
void setCalcConsBendingDelay(double d)
double getCalcPmY() const
void setDdel_dBend(double d)
double getDdel_dUT1() const
void setCalcOceanTideRate(double v)
double getDrat_dRA() const
Sg3dMatrix & trf2crfAcc()
double getDrat_dParallax() const
void setDrat_dCipX(double d)
void setCalcHiFyUt1LibrationRate(double v)
void setCalcHiFyUt1Delay(double v)
void setDrat_dPx(double d)
void setDdel_dParallaxRev(double d)
void setAearth(const Sg3dVector &a)
void setCalcPyRate(double v)
void setDrat_dDN(double d)
double getDdel_dParallax() const
double getDdel_dGamma() const
void setBaselineIdx(short int idx)
void setCalcPxRate(double v)
double getCalcNut2006_dEpsR() const
void setDdel_dR_2(const Sg3dVector &r)
double getCalcOceanTideRate() const
void setCalcNutWahr_dPsiR(double v)
double getCalcNutWahr_dEpsR() const
void setScanFullName(const QString &sId)
void setCalcPoleTideOldRate(double v)
double getCalcPoleTideDelay() const
void setCalcConsBendingSunDelay(double d)
double getCalcHiFyUt1Delay() const
const Sg3dVector & getRsun() const
double getCalcOceanTideOldDelay() const
void setDrat_dUT1(double d)
double getCalcConsensusDelay() const
double getDdel_dPolTideY() const
double getDrat_dDN() const
const Sg3dVector & getAearth() const
double getCalcHiFyPxyDelay() const
void setFractC(double d)
void setDrat_dR_2(const Sg3dVector &r)
double getCalcHiFyUt1Rate() const
double getCalcHiFyUt1LibrationDelay() const
void setDrat_dPy(double d)
double getDrat_dParallaxRev() const
void setKey(const QString &)
double getCalcUt1_Tai() const
void setCalcCipYr(double v)
Sg3dMatrix & trf2crfVal()
double getDdel_dCipX() const
void setDdel_dPolTideY(double d)
double getDdel_dRA() const
void setDdel_dDN(double d)
double getCalcOceanTideOldRate() const
const QString & getCorrelatorType() const
const SgMJD & getTFinis() const
const QString & getName() const
const SgMJD & getTStart() const
void setRecordingMode(const QString &mode)
void setSessionCode(const QString &code)
void setDescription(const QString &description)
void setName(const QString &name)
void setCorrelatorType(const QString &name)
@ Attr_FF_AUX_OBS_MODIFIED
station log related data were modified; //vgosDbProcLogs
@ Attr_FF_EDIT_INFO_MODIFIED
edit info has been modified by user;
@ Attr_FF_WEIGHTS_CORRECTED
weights have been corrected;
@ Attr_PRE_PROCESSED
the observations has been prepared for analysis;
@ Attr_FF_ION_C_CALCULATED
ionospheric corrections have been calculated;
@ Attr_FF_CALC_DATA_MODIFIED
the theoretical values were modified; //vgosDbCalc
@ Attr_FF_OUTLIERS_PROCESSED
outliers have been processed;
@ Attr_HAS_CALC_DATA
the theoretical values are available;
@ Attr_HAS_DTEC
the session contains diffTec values;
@ Attr_FF_AMBIGS_RESOLVED
ambiguities have been resolved;
@ Attr_HAS_AUX_OBS
session contains aux.observations (e.g.: meteo data, cables);
@ Attr_HAS_IONO_CORR
the theoretical values are available;
@ Attr_HAS_CLOCK_BREAKS
there is at least one clock break at one of stations;
const QString & getCorrelatorName() const
@ CPPS_UNKNOWN
unknown (=all others);
int getExperimentSerialNumber() const
void setExperimentSerialNumber(int sn)
const QString & getPiAgencyName() const
const QString & getDescription() const
void setNetworkSuffix(const QString &suffix)
CorrelatorPostProcSoftware getCppsSoft() const
void setCorrelatorName(const QString &name)
const QString & getSessionCode() const
void setPiAgencyName(const QString &name)
void setCppsSoft(CorrelatorPostProcSoftware soft)
const QString & getRecordingMode() const
int numberOfBands() const
QMap< QString, SgVlbiBand * > & bandByKey()
void allocPxyInterpolValues(const SgMatrix *vals)
void setLeapSeconds(double s)
SgModelsInfo & calcInfo()
QList< SgVlbiBand * > & bands()
void formObsCalibrationSetup(int &bitFlags, QList< QString > &calList)
double getLeapSeconds()
QMap< QString, SgVlbiStationInfo * > & stationsByName()
void allocPxyInterpolEpochs(double t0, double dt, unsigned int numOfPts)
SgVector *& args4PxyInterpolation()
void allocUt1InterpolEpochs(double t0, double dt, unsigned int numOfPts)
QList< SgVlbiObservation * > & observations()
void setHasUt1Interpolation(bool has)
void allocUt1InterpolValues(const SgVector *vals)
SgMatrix *& tabs4Ut1Interpolation()
QMap< int, SgVlbiBaselineInfo * > & baselinesByIdx()
SgTaskConfig * getConfig()
SgMatrix *& tabs4PxyInterpolation()
void setHasPxyInterpolation(bool has)
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
QMap< QString, SgVlbiObservation * > & observationByKey()
QMap< int, SgVlbiSourceInfo * > & sourcesByIdx()
QMap< int, SgVlbiStationInfo * > & stationsByIdx()
SgVector *& args4Ut1Interpolation()
void setTabsUt1Type(SgTidalUt1::UT1TideContentType tp)
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
void applyStatusBits(short bitArray)
double getRA() const
void setDN(double dn)
void setRA(double ra)
void setAprioriReference(const QString &ref)
double getDN() const
const QString & getAprioriReference() const
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
void calcCBEpochs4Export(const QMap< QString, SgVlbiAuxObservation * > &)
void setR(const Sg3dVector &r)
double getOLoadPhase(int iWave, int iCoord) const
CableCalsOrigin getCableCalsOrigin() const
double getAxisOffset() const
void setMeteoDataOriginTxt(const QString &origin)
void setTilt(int i, double v)
const QString & getTectonicPlateName() const
void setMntType(MountingType m)
@ Attr_NOT_VALID
omit the station;
@ Attr_REFERENCE_CLOCKS
the clocks are the reference ones;
@ Attr_HAS_CABLE_CAL
a station has cable calibration readings;
@ Attr_IGNORE_CABLE_CAL
do not apply cable calibration;
@ Attr_METEO_MODIFIED
a station has meteo parameters;
@ Attr_CABLE_CAL_MODIFIED
a station has cable calibration readings;
@ Attr_HAS_METEO
a station has meteo parameters;
MeteoDataOrigin getMeteoDataOrigin() const
static int mntType2int(MountingType)
const SgParameterCfg & getPcClocks() const
SgParameterCfg * pcZenith()
void setMeteoDataOrigin(MeteoDataOrigin origin)
void setTectonicPlateName(const QString &name)
const Sg3dVector & getR()
SgParameterCfg * pcClocks()
double getCableCalMultiplierDBCal() const
void setCableCalMultiplierDBCal(double c)
const SgParameterCfg & getPcZenith() const
static MountingType int2mntType(int)
double getOptLoadCoeff(int idx) const
const QString & getCableCalsOriginTxt() const
void setCableCalsOriginTxt(const QString &origin)
void setOLoadPhase(int iWave, int iCoord, double phase)
void setAxisOffset(double v)
void setOptLoadCoeff(int idx, double c)
void setCableCalsOrigin(CableCalsOrigin origin)
void setOLoadAmplitude(int iWave, int iCoord, double amplitude)
double getTilt(int i) const
MountingType getMntType() const
SgBreakModel & clockBreaks()
double getOLoadAmplitude(int iWave, int iCoord) const
const QString & getMeteoDataOriginTxt() const