diff --git a/src/rtkcmn.c b/src/rtkcmn.c index 5ff96f154..556377fd6 100644 --- a/src/rtkcmn.c +++ b/src/rtkcmn.c @@ -3677,35 +3677,40 @@ extern int seliflc(int optnf,int sys) /* use L1/L5 for Galileo if L5 is enabled */ return((optnf==2||sys!=SYS_GAL)?1:2); } -/* troposphere model ----------------------------------------------------------- -* compute tropospheric delay by standard atmosphere and saastamoinen model -* args : gtime_t time I time + +/* Troposphere model ----------------------------------------------------------- +* Compute tropospheric delay by standard atmosphere and saastamoinen model +* Args : gtime_t time I time * double *pos I receiver position {lat,lon,h} (rad,m) * double *azel I azimuth/elevation angle {az,el} (rad) * double humi I relative humidity -* return : tropospheric delay (m) -*-----------------------------------------------------------------------------*/ -extern double tropmodel(gtime_t time, const double *pos, const double *azel, - double humi) -{ - const double temp0=15.0; /* temperature at sea level */ - double hgt,pres,temp,e,z,trph,trpw; +* Return : tropospheric delay (m) +*----------------------------------------------------------------------------*/ +extern double tropmodel(gtime_t time, const double *pos, const double *azel, double humi) { + const double temp0 = 15.0; // Temperature at sea level - if (pos[2]<-100.0||1E4tropopt <= TROPOPT_SAAS) { + trpd = tropmodel(obs[0].time, pos, azel + i * 2, REL_HUMI); + } else if (opt->tropopt == TROPOPT_SBAS) { + double var1; + trpd = sbstropcorr(obs[0].time, pos, azel + i * 2, &var1); + } else if (opt->tropopt >= TROPOPT_EST) { + // Hydrostatic only + trpd = tropmodel(obs[0].time, pos, azel + i * 2, 0.0); + } + r += trpd; + trace(4, "sat=%d r=%.6f c*dts=%.6f trpd=%.6f\n", obs[i].sat, r, CLIGHT * dts[i * 2], trpd); /* calc receiver antenna phase center correction */ antmodel(opt->pcvr+base,opt->antdel[base],azel+i*2,opt->posopt[1], dant); /* calc undifferenced phase/code residual for satellite */ - trace(4,"sat=%d r=%.6f c*dts=%.6f zhd=%.6f map=%.6f\n",obs[i].sat,r,CLIGHT*dts[i*2],zhd,mapfh); zdres_sat(base,r,obs+i,nav,azel+i*2,dant,opt,y+i*nf*2,freq+i*nf); } trace(4,"rr_=%.3f %.3f %.3f\n",rr_[0],rr_[1],rr_[2]);