extern double geodist(const double *rs, const double *rr, double *e)
功能说明:
输入卫星和接收机在ECEF坐标系下的坐标,计算站星单位矢量(校正了地球自转)
假设测站坐标为 ( X R , Y R , Z R ) \left(X_{R}, Y_{R}, Z_{R}\right) (XR,YR,ZR),卫星坐标为 ( X S , Y S , Z S ) \left(X_{S}, Y_{S}, Z_{S}\right) (XS,YS,ZS), ω \omega ω为地球自转角速度, c c c为真空中光速,则由地球自转引起的距离改正为:
Δ D ω = ω c [ Y s ( X R − X s ) − X s ( Y R − Y s ) ] \Delta D_{\omega }=\frac{\omega}{c}\left[Y_{s}\left(X_{R}-X_{s}\right)-X_{s}\left(Y_{R}-Y_{s}\right)\right] ΔDω=cω[Ys(XR−Xs)−Xs(YR−Ys)]
参数说明:
函数参数3个
double *rs I satellilte position (ecef at transmission) (m)
double *rr I receiver position (ecef at reception) (m)
double *e O line-of-sight vector (ecef)
return : geometric distance (m) (0>:error/no satellite position)
调用关系:
上级函数 ppp_res(ppp.c)
extern double satazel(const double *pos, const double *e, double *azel)
站星矢量模<=0(即没有探测到卫星)或卫星高度角太小时,排除该颗卫星,exc[i]=1
参数说明:
函数参数3个
double *pos I geodetic position {lat,lon,h} (rad,m)
double *e I receiver-to-satellilte unit vevtor (ecef)
double *azel IO azimuth/elevation {az,el} (rad) (NULL: no output)
(0.0<=azel[0]<2*pi,-pi/2<=azel[1]<=pi/2)
return : elevation angle (rad)
调用关系:
上级函数 ppp_res(ppp.c)
static int model_trop(gtime_t time, const double *pos, const double *azel,
const prcopt_t *opt, const double *x, double *dtdx,
const nav_t *nav, double *dtrp, double *var)
功能说明:
根据不同的对流层模型计算对流层延迟
参数说明:
函数参数9个
gtime_t time I
const double *pos I receiver position {lat,lon,h} (rad,m)
const double *azel I [azimuth,elevation]
const prcopt_t *opt I config参数
const double *x I 状态向量
double *dtdx O
const nav_t *nav I
double *dtrp O 对流层延迟
double *var O
处理过程:
1.TROPOPT_SAAS,调用tropmodel(rtkcmn.c)
2.TROPOPT_SBAS,调用sbstropcorr
3.TROPOPT_EST或TROPOPT_ESTG或TROPOPT_ZTD,调用trop_model_prec
extern double tropmodel(gtime_t time, const double *pos, const double *azel,
double humi)
功能说明:
saastamoninen 模型估计对流层延迟
参数说明:
函数参数4个
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)
处理过程:
1.根据接收机位置和时间计算压强pres和温度temp
2.计算水汽压力 e = 6.108 × exp [ 17.15 T − 4684.0 T − 38.45 ] × h rel e=6.108 \times \exp \left[\frac{17.15 T-4684.0}{T-38.45}\right] \times h_{\text {rel}} e=6.108×exp[T−38.4517.15T−4684.0]×hrel
3.计算天顶角 z = π / 2 − e l z=\pi / 2-e l z=π/2−el
4.估计对流层静力学延迟trph和湿延迟trpw
T h = 0.0022768 p 1.0 − 0.00266 cos ( 2 ϕ ) − 0.00028 h × 1 0 − 3 × 1 cos z T w = 0.0022768 ( 1255 T + 0.05 ) e × 1 cos z T r = T h + T w \begin{array}{c} T_{h}=\frac{0.0022768 p}{1.0-0.00266 \cos (2 \phi)-0.00028 h \times 10^{-3}} \times \frac{1}{\cos z} \\ T_{w}=0.0022768\left(\frac{1255}{T}+0.05\right) e \times \frac{1}{\cos z} \\ T_{r}=T_{h}+T_{w} \end{array} Th=1.0−0.00266cos(2ϕ)−0.00028h×10−30.0022768p×cosz1Tw=0.0022768(T1255+0.05)e×cosz1Tr=Th+Tw
extern double sbstropcorr(gtime_t time, const double *pos, const double *azel,
double *var)
功能说明:
SBAS模型也叫EGNOS模型,它最大的好处时计算对流层天顶延迟时不需要实测的气象数据,只需要接收机高度和5个气象参数(气压、温度、水蒸气、温度下降率、水蒸气温度下降率)就能估计延迟。
参数说明:
gtime_t time I time
double *pos I receiver position {lat,lon,height} (rad/m)
double *azel I satellite azimuth/elevation (rad)
double *var O variance of troposphric error (m^2)
return : slant tropospheric delay (m)
处理过程:
1.根据接收机所处纬度估计气象参数met[]
2.估计对流层天顶干延迟 d d r y = z d r y ( 1 − β H T ) g R d β d_{dry}=z_{dry}\left(1-\frac{\beta H}{T}\right)^{\frac{g}{R_{d} \beta}} ddry=zdry(1−TβH)Rdβg, Z dry = 1 0 − 6 k 1 R d P g m Z_{\text {dry }}=\frac{10^{-6} k_{1} R_{d} P}{g_{m}} Zdry =gm10−6k1RdP
3.估计对流层天顶湿延迟 d w e t = z w e t ( 1 − β H T ) ( λ + 1 ) T R d β − 1 d_{wet}=z_{wet}\left(1-\frac{\beta H}{T}\right)^{\frac{(\lambda +1)T}{R_{d} \beta}-1} dwet=zwet(1−TβH)Rdβ(λ+1)T−1, Z w e t = 1 0 − 6 k 2 R 4 g m ( λ + 1 ) − β R d × e T Zwet =\frac{10^{-6} k_{2} R_{4}}{g_{m}(\lambda+1)-\beta R_{d}} \times \frac{e}{T} Zwet=gm(λ+1)−βRd10−6k2R4×Te
其中 H H H是海平面接收机高度; T T T是海平面的温度值(K); β \beta β是温度下降率(K/m);Rd=287.054J/(kg.K); λ \lambda λ水蒸气湿度下降率; P P P海平面气压(mbar); e e e是水蒸气压(mbar)
4.计算投影函数m
这里cosz=sinel
5.计算var
static double trop_model_prec(gtime_t time, const double *pos,
const double *azel, const double *x, double *dtdx,
double *var)
功能说明:
用精密对流层模型计算对流层延迟
参数说明:
函数参数6个
gtime_t time I time
double *pos I receiver position {lat,lon,height} (rad/m)
double *azel I satellite azimuth/elevation (rad)
double *x I
double *dtdx O 对流层三个参数{湿延迟投影函数m_w,北电离层梯度系数,东电离层梯度系数},用于后续确定H阵
double *var O variance of troposphric error (m^2)
return : tropospheric delay (m)
处理过程:
1.用saastamoinen模型估计对流层天顶延迟zhd
tropmodel(rtkcmn.c)
2.调用NMF模型计算干投影函数m_h
3.计算湿投影函数 m = m + m ∗ cot E l ∗ G N ∗ cos A z + m ∗ cot E l ∗ G E ∗ sin A z m=m+m * \cot E l * G_{N} * \cos A z+m * \cot E l * G_{E} * \sin A z m=m+m∗cotEl∗GN∗cosAz+m∗cotEl∗GE∗sinAz
4.计算var
5.返回对流层延迟
static int model_iono(gtime_t time, const double *pos, const double *azel,
const prcopt_t *opt, int sat, const double *x,
const nav_t *nav, double *dion, double *var)
功能说明:
计算电离层延迟
参数说明:
gtime_t time I time
double *pos I receiver position {lat,lon,height} (rad/m)
double *azel I satellite azimuth/elevation (rad)
prcopt_t *opt I processing options
int sat I satellite number
double *x I
nav_t *nav I
double *dion O
double *var O
处理过程:
1.IONOOPT_SBAS时调用sbsioncorr(sbas.c)
2.IONOOPT_TEC时调用iontec(ionex.c),细节参考spp代码解析
3.IONOOPT_BRDC时调用ionmodel(rtkcmn.c)细节参考spp代码解析
4.IONOOPT_EST时直接估计
5.IONOOPT_IFLC时跳过先不估计
6.IONOOPT_STEC时调用pppcorr_stec(ppp_corr.c)
static void corr_meas(const obsd_t *obs, const nav_t *nav, const double *azel,
const prcopt_t *opt, const double *dantr,
const double *dants, double phw, double *L, double *P,
double *Lc, double *Pc)
功能说明:
对伪距P和载波相位L观测值进行修正,包括卫星天线相位/接收机天线相位/相位缠绕/dcb;根据系统选择不同的组合观测频点,把无电离层组合观测值放入Lc/Pc中
参数说明:
函数参数11个
obsd_t *obs I observation data
nav_t *nav I navigation data
double *azel I [azimuth,elevation]
prcopt_t *opt I processing options
double *dantr I 接收机天线相位修正
double *dants I 卫星天线相位修正
double phw I 相位缠绕修正
double *L O 修正后的相位观测值
double *P O 修正后的伪距观测值
double *Lc O 修正后的无电离层组合相位观测值
double *Pc O 修正后的无电离层组合伪距观测值
调用关系:
上级函数 corr_meas(ppp.c)ppp_res(ppp.c) udbias_ppp(ppp.c)下级函数 satsys(rtkcmn.c) testsnr(rtkcmn.c)
处理过程:
1.根据输入的卫星天线相位修正数/接收机天线相位修正数/相位缠绕修正数对L和P观测值进行修正;
2.当星历为EPHOPT_SSRAPC或EPHOPT_SSRCOM时进行SSR码修正;否则进行dcb修正;修正值存储在L[],P[]中;
3.无电离层组合模型:伽利略/SBAS/北斗系统选用L1/L5组合观测;其它选用L1/L2组合观测;组合观测值存储在Lc[],Pc[]中。