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