source: ntrip/trunk/BNC/src/upload/bncrtnetuploadcaster.cpp@ 5131

Last change on this file since 5131 was 5131, checked in by mervart, 11 years ago
File size: 19.0 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Server
3 * -------------------------------------------------------------------------
4 *
5 * Class: bncRtnetUploadCaster
6 *
7 * Purpose: Connection to NTRIP Caster
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Mar-2011
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <math.h>
18#include "bncrtnetuploadcaster.h"
19#include "bncsettings.h"
20#include "bncephuser.h"
21#include "bncclockrinex.h"
22#include "bncsp3.h"
23
24using namespace std;
25
26// Constructor
27////////////////////////////////////////////////////////////////////////////
28bncRtnetUploadCaster::bncRtnetUploadCaster(const QString& mountpoint,
29 const QString& outHost, int outPort,
30 const QString& password,
31 const QString& crdTrafo, bool CoM,
32 const QString& sp3FileName,
33 const QString& rnxFileName,
34 int PID, int SID, int IOD, int iRow) :
35 bncUploadCaster(mountpoint, outHost, outPort, password, iRow, 0) {
36
37 if (!outHost.isEmpty()) {
38 _casterID += outHost;
39 }
40 if (!crdTrafo.isEmpty()) {
41 _casterID += " " + crdTrafo;
42 }
43 if (!sp3FileName.isEmpty()) {
44 _casterID += " " + sp3FileName;
45 }
46 if (!rnxFileName.isEmpty()) {
47 _casterID += " " + rnxFileName;
48 }
49
50 _crdTrafo = crdTrafo;
51 _CoM = CoM;
52 _PID = PID;
53 _SID = SID;
54 _IOD = IOD;
55
56 // Member that receives the ephemeris
57 // ----------------------------------
58 _ephUser = new bncEphUser();
59
60 bncSettings settings;
61 QString intr = settings.value("uploadIntr").toString();
62
63 _samplRtcmEphCorr = settings.value("uploadSamplRtcmEphCorr").toDouble();
64 int samplClkRnx = settings.value("uploadSamplClkRnx").toInt();
65 int samplSp3 = settings.value("uploadSamplSp3").toInt() * 60;
66
67 if (_samplRtcmEphCorr == 0.0) {
68 _usedEph = 0;
69 }
70 else {
71 _usedEph = new QMap<QString, t_eph*>;
72 }
73
74 // RINEX writer
75 // ------------
76 if (!rnxFileName.isEmpty()) {
77 _rnx = new bncClockRinex(rnxFileName, intr, samplClkRnx);
78 }
79 else {
80 _rnx = 0;
81 }
82
83 // SP3 writer
84 // ----------
85 if (!sp3FileName.isEmpty()) {
86 _sp3 = new bncSP3(sp3FileName, intr, samplSp3);
87 }
88 else {
89 _sp3 = 0;
90 }
91
92 // Set Transformation Parameters
93 // -----------------------------
94 if (_crdTrafo == "ETRF2000") {
95 _dx = 0.0521;
96 _dy = 0.0493;
97 _dz = -0.0585;
98 _dxr = 0.0001;
99 _dyr = 0.0001;
100 _dzr = -0.0018;
101 _ox = 0.000891;
102 _oy = 0.005390;
103 _oz = -0.008712;
104 _oxr = 0.000081;
105 _oyr = 0.000490;
106 _ozr = -0.000792;
107 _sc = 1.34;
108 _scr = 0.08;
109 _t0 = 2000.0;
110 }
111 else if (_crdTrafo == "NAD83") {
112 _dx = 0.9963;
113 _dy = -1.9024;
114 _dz = -0.5210;
115 _dxr = 0.0005;
116 _dyr = -0.0006;
117 _dzr = -0.0013;
118 _ox = -0.025915;
119 _oy = -0.009426;
120 _oz = -0.011599;
121 _oxr = -0.000067;
122 _oyr = 0.000757;
123 _ozr = 0.000051;
124 _sc = 0.78;
125 _scr = -0.10;
126 _t0 = 1997.0;
127 }
128 else if (_crdTrafo == "GDA94") {
129 _dx = -0.08468;
130 _dy = -0.01942;
131 _dz = 0.03201;
132 _dxr = 0.00142;
133 _dyr = 0.00134;
134 _dzr = 0.00090;
135 _ox = 0.0004254;
136 _oy = -0.0022578;
137 _oz = -0.0024015;
138 _oxr = -0.0015461;
139 _oyr = -0.0011820;
140 _ozr = -0.0011551;
141 _sc = 9.710;
142 _scr = 0.109;
143 _t0 = 1994.0;
144 }
145 else if (_crdTrafo == "SIRGAS2000") {
146 _dx = 0.0020;
147 _dy = 0.0041;
148 _dz = 0.0039;
149 _dxr = 0.0000;
150 _dyr = 0.0000;
151 _dzr = 0.0000;
152 _ox = 0.000170;
153 _oy = -0.000030;
154 _oz = 0.000070;
155 _oxr = 0.000000;
156 _oyr = 0.000000;
157 _ozr = 0.000000;
158 _sc = 0.000;
159 _scr = 0.000;
160 _t0 = 0000.0;
161 }
162 else if (_crdTrafo == "SIRGAS95") {
163 _dx = 0.0077;
164 _dy = 0.0058;
165 _dz = -0.0138;
166 _dxr = 0.0000;
167 _dyr = 0.0000;
168 _dzr = 0.0000;
169 _ox = 0.000000;
170 _oy = 0.000000;
171 _oz = -0.000030;
172 _oxr = 0.000000;
173 _oyr = 0.000000;
174 _ozr = 0.000000;
175 _sc = 1.570;
176 _scr = 0.000;
177 _t0 = 0000.0;
178 }
179 else if (_crdTrafo == "Custom") {
180 _dx = settings.value("trafo_dx").toDouble();
181 _dy = settings.value("trafo_dy").toDouble();
182 _dz = settings.value("trafo_dz").toDouble();
183 _dxr = settings.value("trafo_dxr").toDouble();
184 _dyr = settings.value("trafo_dyr").toDouble();
185 _dzr = settings.value("trafo_dzr").toDouble();
186 _ox = settings.value("trafo_ox").toDouble();
187 _oy = settings.value("trafo_oy").toDouble();
188 _oz = settings.value("trafo_oz").toDouble();
189 _oxr = settings.value("trafo_oxr").toDouble();
190 _oyr = settings.value("trafo_oyr").toDouble();
191 _ozr = settings.value("trafo_ozr").toDouble();
192 _sc = settings.value("trafo_sc").toDouble();
193 _scr = settings.value("trafo_scr").toDouble();
194 _t0 = settings.value("trafo_t0").toDouble();
195 }
196}
197
198// Destructor
199////////////////////////////////////////////////////////////////////////////
200bncRtnetUploadCaster::~bncRtnetUploadCaster() {
201 if (isRunning()) {
202 wait();
203 }
204 delete _rnx;
205 delete _sp3;
206 delete _ephUser;
207 delete _usedEph;
208}
209
210//
211////////////////////////////////////////////////////////////////////////////
212void bncRtnetUploadCaster::decodeRtnetStream(char* buffer, int bufLen) {
213
214 QMutexLocker locker(&_mutex);
215
216 // Append to internal buffer
217 // -------------------------
218 _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));
219
220 // Select buffer part that contains last epoch
221 // -------------------------------------------
222 QStringList lines;
223 int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch
224 if (iEpoBeg == -1) {
225 _rtnetStreamBuffer.clear();
226 return;
227 }
228 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
229
230 int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch
231 if (iEpoEnd == -1) {
232 return;
233 }
234 else {
235 lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);
236 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);
237 }
238
239 if (lines.size() < 2) {
240 return;
241 }
242
243 // Keep the last unfinished line in buffer
244 // ---------------------------------------
245 int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n');
246 if (iLastEOL != -1) {
247 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1);
248 }
249
250 // Read first line (with epoch time)
251 // ---------------------------------
252 QTextStream in(lines[0].toAscii());
253 QString hlp;
254 int year, month, day, hour, min;
255 double sec;
256 in >> hlp >> year >> month >> day >> hour >> min >> sec;
257 bncTime epoTime; epoTime.set( year, month, day, hour, min, sec);
258
259 emit(newMessage("bncRtnetUploadCaster: decode " +
260 QByteArray(epoTime.datestr().c_str()) + " " +
261 QByteArray(epoTime.timestr().c_str()) + _casterID.toAscii(), false));
262
263 struct ClockOrbit co;
264 memset(&co, 0, sizeof(co));
265 co.GPSEpochTime = static_cast<int>(epoTime.gpssec());
266 co.GLONASSEpochTime = static_cast<int>(fmod(epoTime.gpssec(), 86400.0))
267 + 3 * 3600 - gnumleap(year, month, day);
268 co.ClockDataSupplied = 1;
269 co.OrbitDataSupplied = 1;
270 co.SatRefDatum = DATUM_ITRF;
271 co.SSRIOD = _IOD;
272 co.SSRProviderID = _PID; // 256 .. BKG, 257 ... EUREF
273 co.SSRSolutionID = _SID;
274
275 struct Bias bias;
276 memset(&bias, 0, sizeof(bias));
277 bias.GPSEpochTime = co.GPSEpochTime;
278 bias.GLONASSEpochTime = co.GLONASSEpochTime;
279
280 // Default Update Interval
281 // -----------------------
282 int clkUpdInd = 2; // 5 sec
283 int ephUpdInd = clkUpdInd; // default
284 if (_samplRtcmEphCorr == 10.0) {
285 ephUpdInd = 3;
286 }
287 else if (_samplRtcmEphCorr == 15.0) {
288 ephUpdInd = 4;
289 }
290 else if (_samplRtcmEphCorr == 30.0) {
291 ephUpdInd = 5;
292 }
293 else if (_samplRtcmEphCorr == 60.0) {
294 ephUpdInd = 6;
295 }
296 else if (_samplRtcmEphCorr == 120.0) {
297 ephUpdInd = 7;
298 }
299 else if (_samplRtcmEphCorr == 240.0) {
300 ephUpdInd = 8;
301 }
302 else if (_samplRtcmEphCorr == 300.0) {
303 ephUpdInd = 9;
304 }
305 else if (_samplRtcmEphCorr == 600.0) {
306 ephUpdInd = 10;
307 }
308 else if (_samplRtcmEphCorr == 900.0) {
309 ephUpdInd = 11;
310 }
311
312 co.UpdateInterval = clkUpdInd;
313 bias.UpdateInterval = clkUpdInd;
314
315 for (int ii = 1; ii < lines.size(); ii++) {
316
317 QString prn;
318 ColumnVector rtnAPC;
319 ColumnVector rtnVel;
320 ColumnVector rtnCoM;
321 double rtnClk;
322
323 QTextStream in(lines[ii].toAscii());
324
325 in >> prn;
326
327 t_eph* eph = 0;
328 const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
329 if (ephPair) {
330
331 eph = ephPair->last;
332
333 // Use previous ephemeris if the last one is too recent
334 // ----------------------------------------------------
335 const int MINAGE = 60; // seconds
336 if (ephPair->prev && eph->receptDateTime().isValid() &&
337 eph->receptDateTime().secsTo(currentDateAndTimeGPS()) < MINAGE) {
338 eph = ephPair->prev;
339 }
340
341 // Make sure the clock messages refer to same IOD as orbit messages
342 // ----------------------------------------------------------------
343 if (_usedEph) {
344 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
345 (*_usedEph)[prn] = eph;
346 }
347 else {
348 eph = 0;
349 if (_usedEph->contains(prn)) {
350 t_eph* usedEph = _usedEph->value(prn);
351 if (usedEph == ephPair->last) {
352 eph = ephPair->last;
353 }
354 else if (usedEph == ephPair->prev) {
355 eph = ephPair->prev;
356 }
357 }
358 }
359 }
360 }
361
362 if (eph) {
363
364 while (true) {
365 QString key;
366 int numVal = 0;
367 in >> key >> numVal;
368 if (in.status() != QTextStream::Ok) {
369 break;
370 }
371 if (key == "APC") {
372 rtnAPC.ReSize(3);
373 in >> rtnAPC[0] >> rtnAPC[1] >> rtnAPC[2];
374 }
375 else if (key == "Clk") {
376 in >> rtnClk;
377 }
378 else if (key == "Vel") {
379 rtnVel.ReSize(3);
380 in >> rtnVel[0] >> rtnVel[1] >> rtnVel[2];
381 }
382 else if (key == "CoM") {
383 rtnCoM.ReSize(3);
384 in >> rtnCoM[0] >> rtnCoM[1] >> rtnCoM[2];
385 }
386 else {
387 for (int ii = 0; ii < numVal; ii++) {
388 double dummy;
389 in >> dummy;
390 }
391 }
392 }
393 struct ClockOrbit::SatData* sd = 0;
394 if (prn[0] == 'G') {
395 sd = co.Sat + co.NumberOfGPSSat;
396 ++co.NumberOfGPSSat;
397 }
398 else if (prn[0] == 'R') {
399 sd = co.Sat + CLOCKORBIT_NUMGPS + co.NumberOfGLONASSSat;
400 ++co.NumberOfGLONASSSat;
401 }
402 if (sd) {
403 QString outLine;
404 processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prn,
405 rtnAPC, rtnClk, rtnVel, rtnCoM, sd, outLine);
406 }
407
408 struct Bias::BiasSat* biasSat = 0;
409 if (prn[0] == 'G') {
410 biasSat = bias.Sat + bias.NumberOfGPSSat;
411 ++bias.NumberOfGPSSat;
412 }
413 else if (prn[0] == 'R') {
414 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + bias.NumberOfGLONASSSat;
415 ++bias.NumberOfGLONASSSat;
416 }
417
418 // Coefficient of Ionosphere-Free LC
419 // ---------------------------------
420 // const static double a_L1_GPS = 2.54572778;
421 // const static double a_L2_GPS = -1.54572778;
422 // const static double a_L1_Glo = 2.53125000;
423 // const static double a_L2_Glo = -1.53125000;
424
425 if (biasSat) {
426 biasSat->ID = prn.mid(1).toInt();
427 biasSat->NumberOfCodeBiases = 3;
428 if (prn[0] == 'G') {
429 biasSat->Biases[0].Type = CODETYPEGPS_L1_Z;
430 // biasSat->Biases[0].Bias = - a_L2_GPS * xx(10);
431 biasSat->Biases[0].Bias = 0.0;
432 biasSat->Biases[1].Type = CODETYPEGPS_L1_CA;
433 // biasSat->Biases[1].Bias = - a_L2_GPS * xx(10) + xx(9);
434 biasSat->Biases[1].Bias = 0.0;
435 biasSat->Biases[2].Type = CODETYPEGPS_L2_Z;
436 // biasSat->Biases[2].Bias = a_L1_GPS * xx(10);
437 biasSat->Biases[2].Bias = 0.0;
438 }
439 else if (prn[0] == 'R') {
440 biasSat->Biases[0].Type = CODETYPEGLONASS_L1_P;
441 // biasSat->Biases[0].Bias = - a_L2_Glo * xx(10);
442 biasSat->Biases[0].Bias = 0.0;
443 biasSat->Biases[1].Type = CODETYPEGLONASS_L1_CA;
444 // biasSat->Biases[1].Bias = - a_L2_Glo * xx(10) + xx(9);
445 biasSat->Biases[1].Bias = 0.0;
446 biasSat->Biases[2].Type = CODETYPEGLONASS_L2_P;
447 // biasSat->Biases[2].Bias = a_L1_Glo * xx(10);
448 biasSat->Biases[2].Bias = 0.0;
449 }
450 }
451 }
452 }
453
454 QByteArray hlpBufferCo;
455
456 // Orbit and Clock Corrections together
457 // ------------------------------------
458 if (_samplRtcmEphCorr == 0.0) {
459 if (co.NumberOfGPSSat > 0 || co.NumberOfGLONASSSat > 0) {
460 char obuffer[CLOCKORBIT_BUFFERSIZE];
461 int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
462 if (len > 0) {
463 hlpBufferCo = QByteArray(obuffer, len);
464 }
465 }
466 }
467
468 // Orbit and Clock Corrections separately
469 // --------------------------------------
470 else {
471 if (co.NumberOfGPSSat > 0) {
472 char obuffer[CLOCKORBIT_BUFFERSIZE];
473 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
474 co.UpdateInterval = ephUpdInd;
475 int len1 = MakeClockOrbit(&co, COTYPE_GPSORBIT, 1, obuffer, sizeof(obuffer));
476 co.UpdateInterval = clkUpdInd;
477 if (len1 > 0) {
478 hlpBufferCo += QByteArray(obuffer, len1);
479 }
480 }
481 int mmsg = (co.NumberOfGLONASSSat > 0) ? 1 : 0;
482 int len2 = MakeClockOrbit(&co, COTYPE_GPSCLOCK, mmsg, obuffer, sizeof(obuffer));
483 if (len2 > 0) {
484 hlpBufferCo += QByteArray(obuffer, len2);
485 }
486 }
487 if (co.NumberOfGLONASSSat > 0) {
488 char obuffer[CLOCKORBIT_BUFFERSIZE];
489 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
490 co.UpdateInterval = ephUpdInd;
491 int len1 = MakeClockOrbit(&co, COTYPE_GLONASSORBIT, 1, obuffer, sizeof(obuffer));
492 co.UpdateInterval = clkUpdInd;
493 if (len1 > 0) {
494 hlpBufferCo += QByteArray(obuffer, len1);
495 }
496 }
497 int len2 = MakeClockOrbit(&co, COTYPE_GLONASSCLOCK, 0, obuffer, sizeof(obuffer));
498 if (len2 > 0) {
499 hlpBufferCo += QByteArray(obuffer, len2);
500 }
501 }
502 }
503
504 // Biases
505 // ------
506 QByteArray hlpBufferBias;
507 if (bias.NumberOfGPSSat > 0 || bias.NumberOfGLONASSSat > 0) {
508 char obuffer[CLOCKORBIT_BUFFERSIZE];
509 int len = MakeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
510 if (len > 0) {
511 hlpBufferBias = QByteArray(obuffer, len);
512 }
513 }
514
515 _outBuffer += hlpBufferCo + hlpBufferBias;
516}
517
518//
519////////////////////////////////////////////////////////////////////////////
520void bncRtnetUploadCaster::processSatellite(t_eph* eph, int GPSweek,
521 double GPSweeks, const QString& prn,
522 const ColumnVector& rtnAPC,
523 double rtnClk,
524 const ColumnVector& rtnVel,
525 const ColumnVector& rtnCoM,
526 struct ClockOrbit::SatData* sd,
527 QString& outLine) {
528
529 // Broadcast Position and Velocity
530 // -------------------------------
531 ColumnVector xB(4);
532 ColumnVector vB(3);
533 eph->position(GPSweek, GPSweeks, xB.data(), vB.data());
534
535 // Precise Position
536 // ----------------
537 ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
538
539 double dc = 0.0;
540 if (_crdTrafo != "IGS08") {
541 crdTrafo(GPSweek, xP, dc);
542 }
543
544 // Difference in xyz
545 // -----------------
546 ColumnVector dx = xB.Rows(1,3) - xP;
547 ColumnVector dv = vB - rtnVel;
548
549 // Difference in RSW
550 // -----------------
551 ColumnVector rsw(3);
552 XYZ_to_RSW(xB.Rows(1,3), vB, dx, rsw);
553
554 ColumnVector dotRsw(3);
555 XYZ_to_RSW(xB.Rows(1,3), vB, dv, dotRsw);
556
557 // Clock Correction
558 // ----------------
559 double dClk = rtnClk - (xB(4) - dc) * t_CST::c;
560
561 if (sd) {
562 sd->ID = prn.mid(1).toInt();
563 sd->IOD = eph->IOD();
564 sd->Clock.DeltaA0 = dClk;
565 sd->Orbit.DeltaRadial = rsw(1);
566 sd->Orbit.DeltaAlongTrack = rsw(2);
567 sd->Orbit.DeltaCrossTrack = rsw(3);
568 sd->Orbit.DotDeltaRadial = dotRsw(1);
569 sd->Orbit.DotDeltaAlongTrack = dotRsw(2);
570 sd->Orbit.DotDeltaCrossTrack = dotRsw(3);
571 }
572
573 outLine.sprintf("%d %.1f %s %3d %10.3f %8.3f %8.3f %8.3f\n",
574 GPSweek, GPSweeks, eph->prn().toAscii().data(),
575 eph->IOD(), dClk, rsw(1), rsw(2), rsw(3));
576
577 double relativity = -2.0 * DotProduct(xP, rtnVel) / t_CST::c;
578 double sp3Clk = (rtnClk - relativity) / t_CST::c; // in seconds
579
580 if (_rnx) {
581 _rnx->write(GPSweek, GPSweeks, prn, sp3Clk);
582 }
583 if (_sp3) {
584 _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, sp3Clk);
585 }
586}
587
588// Transform Coordinates
589////////////////////////////////////////////////////////////////////////////
590void bncRtnetUploadCaster::crdTrafo(int GPSWeek, ColumnVector& xyz,
591 double& dc) {
592
593 // Current epoch minus 2000.0 in years
594 // ------------------------------------
595 double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
596
597 ColumnVector dx(3);
598
599 dx(1) = _dx + dt * _dxr;
600 dx(2) = _dy + dt * _dyr;
601 dx(3) = _dz + dt * _dzr;
602
603 static const double arcSec = 180.0 * 3600.0 / M_PI;
604
605 double ox = (_ox + dt * _oxr) / arcSec;
606 double oy = (_oy + dt * _oyr) / arcSec;
607 double oz = (_oz + dt * _ozr) / arcSec;
608
609 double sc = 1.0 + _sc * 1e-9 + dt * _scr * 1e-9;
610
611 // Specify approximate center of area
612 // ----------------------------------
613 ColumnVector meanSta(3);
614
615 if (_crdTrafo == "ETRF2000") {
616 meanSta(1) = 3661090.0;
617 meanSta(2) = 845230.0;
618 meanSta(3) = 5136850.0;
619 }
620 else if (_crdTrafo == "NAD83") {
621 meanSta(1) = -1092950.0;
622 meanSta(2) = -4383600.0;
623 meanSta(3) = 4487420.0;
624 }
625 else if (_crdTrafo == "GDA94") {
626 meanSta(1) = -4052050.0;
627 meanSta(2) = 4212840.0;
628 meanSta(3) = -2545110.0;
629 }
630 else if (_crdTrafo == "SIRGAS2000") {
631 meanSta(1) = 3740860.0;
632 meanSta(2) = -4964290.0;
633 meanSta(3) = -1425420.0;
634 }
635 else if (_crdTrafo == "SIRGAS95") {
636 meanSta(1) = 3135390.0;
637 meanSta(2) = -5017670.0;
638 meanSta(3) = -2374440.0;
639 }
640 else if (_crdTrafo == "Custom") {
641 meanSta(1) = 0.0; // TODO
642 meanSta(2) = 0.0; // TODO
643 meanSta(3) = 0.0; // TODO
644 }
645
646 // Clock correction proportional to topocentric distance to satellites
647 // -------------------------------------------------------------------
648 double rho = (xyz - meanSta).norm_Frobenius();
649 dc = rho * (sc - 1.0) / sc / t_CST::c;
650
651 Matrix rMat(3,3);
652 rMat(1,1) = 1.0;
653 rMat(1,2) = -oz;
654 rMat(1,3) = oy;
655 rMat(2,1) = oz;
656 rMat(2,2) = 1.0;
657 rMat(2,3) = -ox;
658 rMat(3,1) = -oy;
659 rMat(3,2) = ox;
660 rMat(3,3) = 1.0;
661
662 xyz = sc * rMat * xyz + dx;
663}
664
Note: See TracBrowser for help on using the repository browser.