From b9e991a14df0582892ade68a86e44f2a31718adf Mon Sep 17 00:00:00 2001 From: oaq Date: Wed, 13 Nov 2024 00:13:07 +1100 Subject: [PATCH] tropmodel, rtkpos: use the precise mapping function Have tropmodel use the precise mapping function, rather than 1/cos(z). Update the exponent in the pressure vs temperature function, from 5.2568 to 5.255877 which is found in references on the matter. Update the rtkpos RTK code to also account for the wet component when not estimating it, and to also allow use of the SBAS model when that is selected. --- src/rtkcmn.c | 47 ++++++++++++++++++++++++++--------------------- src/rtkpos.c | 19 ++++++++++++++----- 2 files changed, 40 insertions(+), 26 deletions(-) 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]);