Changeset 6213 in ntrip


Ignore:
Timestamp:
Oct 5, 2014, 5:15:25 PM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/ephemeris.cpp

    r6141 r6213  
    4444  xc.ReSize(4);
    4545  vv.ReSize(3);
    46   position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data());
     46  if (position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data()) != success) {
     47    return failure;
     48  }
    4749  if (useCorr) {
    4850    if (_orbCorr && _clkCorr) {
     
    128130// Compute GPS Satellite Position (virtual)
    129131////////////////////////////////////////////////////////////////////////////
    130 void t_ephGPS::position(int GPSweek, double GPSweeks,
    131                         double* xc,
    132                         double* vv) const {
    133 
     132t_irc t_ephGPS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
    134133
    135134  static const double omegaEarth = 7292115.1467e-11;
     
    141140  double a0 = _sqrt_A * _sqrt_A;
    142141  if (a0 == 0) {
    143     return;
     142    return failure;
    144143  }
    145144
     
    207206  // -----------------------
    208207  xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
     208
     209  return success;
    209210}
    210211
     
    248249// Compute Glonass Satellite Position (virtual)
    249250////////////////////////////////////////////////////////////////////////////
    250 void t_ephGlo::position(int GPSweek, double GPSweeks,
    251                         double* xc, double* vv) const {
     251t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
    252252
    253253  static const double nominalStep = 10.0;
     
    257257
    258258  double dtPos = bncTime(GPSweek, GPSweeks) - _tt;
     259
     260  if (fabs(dtPos) > 24*3600.0) {
     261    return failure;
     262  }
    259263
    260264  int nSteps  = int(fabs(dtPos) / nominalStep) + 1;
     
    284288  double dtClk = bncTime(GPSweek, GPSweeks) - _TOC;
    285289  xc[3] = -_tau + _gamma * dtClk;
     290
     291  return success;
    286292}
    287293
     
    442448// Compute Galileo Satellite Position (virtual)
    443449////////////////////////////////////////////////////////////////////////////
    444 void t_ephGal::position(int GPSweek, double GPSweeks,
    445                         double* xc,
    446                         double* vv) const {
     450t_irc t_ephGal::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
    447451
    448452  static const double omegaEarth = 7292115.1467e-11;
     
    454458  double a0 = _sqrt_A * _sqrt_A;
    455459  if (a0 == 0) {
    456     return;
     460    return failure;
    457461  }
    458462
     
    521525  //  xc(4) -= 4.442807633e-10 * _e * sqrt(a0) *sin(E);
    522526  xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
     527
     528  return success;
    523529}
    524530
  • trunk/BNC/src/ephemeris.h

    r6141 r6213  
    4141
    4242 protected: 
    43   virtual void position(int GPSweek, double GPSweeks, double* xc, double* vv) const = 0;
     43  virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const = 0;
    4444  t_prn      _prn;
    4545  bncTime    _TOC;
     
    6565
    6666 private:
    67   virtual void position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
     67  virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
    6868
    6969  double  _clock_bias;      // [s]   
     
    119119
    120120 private:
    121   virtual void position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
     121  virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
    122122  static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv, double* acc);
    123123
     
    159159
    160160 private:
    161   virtual void position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
     161  virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
    162162
    163163  double  _clock_bias;       //  [s]   
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r6137 r6213  
    538538            ColumnVector xc(4);
    539539            ColumnVector vv(3);
    540             eph->getCrd(bncTime(oneObs->_GPSWeek, oneObs->_GPSWeeks), xc, vv, false);
    541          
    542             double rho, eleSat, azSat;
    543             topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
    544          
    545             aziDeg = azSat * 180.0/M_PI;
    546             zenDeg = 90.0 - eleSat * 180.0/M_PI;
    547             zenFlag = true;
     540            if (eph->getCrd(bncTime(oneObs->_GPSWeek, oneObs->_GPSWeeks), xc, vv, false) == success) {
     541              double rho, eleSat, azSat;
     542              topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
     543              aziDeg = azSat * 180.0/M_PI;
     544              zenDeg = 90.0 - eleSat * 180.0/M_PI;
     545              zenFlag = true;
     546            }
    548547          }
    549548        }
     
    742741    }
    743742    if (eph) {
    744       ++nSatUsed;
    745743      ColumnVector xSat(4);
    746744      ColumnVector vv(3);
    747       eph->getCrd(_currEpo->tt, xSat, vv, false);
    748       ColumnVector dx = xSat.Rows(1,3) - xyzSta;
    749       double rho = dx.norm_Frobenius();
    750       AA(nSatUsed,1) = dx(1) / rho;
    751       AA(nSatUsed,2) = dx(2) / rho;
    752       AA(nSatUsed,3) = dx(3) / rho;
    753       AA(nSatUsed,4) = 1.0;
     745      if (eph->getCrd(_currEpo->tt, xSat, vv, false) == success) {
     746        ++nSatUsed;
     747        ColumnVector dx = xSat.Rows(1,3) - xyzSta;
     748        double rho = dx.norm_Frobenius();
     749        AA(nSatUsed,1) = dx(1) / rho;
     750        AA(nSatUsed,2) = dx(2) / rho;
     751        AA(nSatUsed,3) = dx(3) / rho;
     752        AA(nSatUsed,4) = 1.0;
     753      }
    754754    }
    755755  }
Note: See TracChangeset for help on using the changeset viewer.