Changeset 3055 in ntrip for trunk/BNC/bncantex.cpp


Ignore:
Timestamp:
Feb 25, 2011, 4:55:53 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncantex.cpp

    r3052 r3055  
    4343
    4444#include "bncantex.h"
     45#include "bnctides.h"
    4546
    4647using namespace std;
     
    209210// Satellite Antenna Offset
    210211////////////////////////////////////////////////////////////////////////////
    211 t_irc bncAntex::offset(const QString& prn, ColumnVector& neu) {
     212t_irc bncAntex::satCoMcorrection(const QString& prn, double Mjd,
     213                                 const ColumnVector& xSat, ColumnVector& dx) {
     214
    212215  QMap<QString, t_antMap*>::const_iterator it = _maps.find(prn);
    213216  if (it != _maps.end()) {
    214217    t_antMap* map = it.value();
    215     neu[0] = map->frqMapL1->neu[0];
    216     neu[1] = map->frqMapL1->neu[1];
    217     neu[2] = map->frqMapL1->neu[2];
     218    double* neu = map->frqMapL1->neu;
     219
     220    // Unit Vectors sz, sy, sx
     221    // -----------------------
     222    ColumnVector sz = -xSat;
     223    sz /= sqrt(DotProduct(sz,sz));
     224
     225    ColumnVector xSun = Sun(Mjd);
     226    xSun /= sqrt(DotProduct(xSun,xSun));
     227 
     228    ColumnVector sy = crossproduct(sz, xSun);
     229    sy /= sqrt(DotProduct(sy,sy));
     230 
     231    ColumnVector sx = crossproduct(sy, sz);
     232
     233    dx[0] = sx[0] * neu[0] + sy[0] * neu[1] + sz[0] * neu[2];
     234    dx[1] = sx[1] * neu[0] + sy[1] * neu[1] + sz[1] * neu[2];
     235    dx[2] = sx[2] * neu[0] + sy[2] * neu[1] + sz[2] * neu[2];
     236
    218237    return success;
    219238  }
Note: See TracChangeset for help on using the changeset viewer.