rinex中的 decode_eph函数
URA计算是否合理?
/* decode ephemeris ———————————————————-*/
static int decode_eph(double ver, int sat, gtime_t toc, const double *data,
eph_t *eph)
{
eph_t eph0={0};
int sys;
trace(4,”decode_eph: ver=%.2f sat=%2d\n”,ver,sat);
sys=satsys(sat,NULL);
if (!(sys&(SYS_GPS|SYS_GAL|SYS_QZS|SYS_CMP|SYS_IRN))) {
trace(3,”ephemeris error: invalid satellite sat=%2d\n”,sat);
return 0;
}
*eph=eph0;
eph->sat=sat;
eph->toc=toc;
eph->f0=data[0];
eph->f1=data[1];
eph->f2=data[2];
eph->A=SQR(data[10]); eph->e=data[ 8]; eph->i0 =data[15]; eph->OMG0=data[13];
eph->omg =data[17]; eph->M0 =data[ 6]; eph->deln=data[ 5]; eph->OMGd=data[18];
eph->idot=data[19]; eph->crc=data[16]; eph->crs =data[ 4]; eph->cuc =data[ 7];
eph->cus =data[ 9]; eph->cic=data[12]; eph->cis =data[14];
if (sys==SYS_GPS||sys==SYS_QZS) {
eph->iode=(int)data[ 3]; /* IODE */
eph->iodc=(int)data[26]; /* IODC */
eph->toes= data[11]; /* toe (s) in gps week */
eph->week=(int)data[21]; /* gps week */
eph->toe=adjweek(gpst2time(eph->week,data[11]),toc);
eph->ttr=adjweek(gpst2time(eph->week,data[27]),toc);
eph->code=(int)data[20]; /* GPS: codes on L2 ch */
eph->svh =(int)data[24]; /* sv health */
//uraindex是否有画蛇添足之嫌,导航文件中本就是索引,此处又调用uraindex将其转换为索引
//但又有文献表示广播星历中的URA值单位为m而非索引???,若单位为m则合理
//bug???
经对比N文件的URA值,存在超过100的数,故而导航文件的URA单位为m,而非索引,该处理合理
eph->sva=uraindex(data[23]); /* ura (m->index) 卫星测距精度URA*/
/*static int uraindex(double value)
{
int i;
for (i=0;i<15;i++) if (ura_eph[i]>=value) break;
return i;
}*/
eph->flag=(int)data[22]; /* GPS: L2 P data flag */
eph->tgd[0]= data[25]; /* TGD */
if (sys==SYS_GPS) {
eph->fit=data[28]; /* fit interval (h) */
}
else {
eph->fit=data[28]==0.0?1.0:2.0; /* fit interval (0:1h,1:>2h) */
}
}
else if (sys==SYS_GAL) { /* GAL ver.3 */
eph->iode=(int)data[ 3]; /* IODnav */
eph->toes= data[11]; /* toe (s) in galileo week */
eph->week=(int)data[21]; /* gal week = gps week */
eph->toe=adjweek(gpst2time(eph->week,data[11]),toc);
eph->ttr=adjweek(gpst2time(eph->week,data[27]),toc);
eph->code=(int)data[20]; /* data sources */
/* bit 0 set: I/NAV E1-B */
/* bit 1 set: F/NAV E5a-I */
/* bit 2 set: F/NAV E5b-I */
/* bit 8 set: af0-af2 toc are for E5a.E1 */
/* bit 9 set: af0-af2 toc are for E5b.E1 */
eph->svh =(int)data[24]; /* sv health */
/* bit 0: E1B DVS */
/* bit 1-2: E1B HS */
/* bit 3: E5a DVS */
/* bit 4-5: E5a HS */
/* bit 6: E5b DVS */
/* bit 7-8: E5b HS */
eph->sva =uraindex(data[23]); /* ura (m->index) */
eph->tgd[0]= data[25]; /* BGD E5a/E1 */
eph->tgd[1]= data[26]; /* BGD E5b/E1 */
}
else if (sys==SYS_CMP) { /* BeiDou v.3.02 */
eph->toc=bdt2gpst(eph->toc); /* bdt -> gpst */
eph->iode=(int)data[ 3]; /* AODE */
eph->iodc=(int)data[28]; /* AODC */
eph->toes= data[11]; /* toe (s) in bdt week */
eph->week=(int)data[21]; /* bdt week */
eph->toe=bdt2gpst(bdt2time(eph->week,data[11])); /* bdt -> gpst */
eph->ttr=bdt2gpst(bdt2time(eph->week,data[27])); /* bdt -> gpst */
eph->toe=adjweek(eph->toe,toc);
eph->ttr=adjweek(eph->ttr,toc);
eph->svh =(int)data[24]; /* satH1 */
eph->sva=uraindex(data[23]); /* ura (m->index) */
eph->tgd[0]= data[25]; /* TGD1 B1/B3 */
eph->tgd[1]= data[26]; /* TGD2 B2/B3 */
}
else if (sys==SYS_IRN) { /* IRNSS v.3.03 */
eph->iode=(int)data[ 3]; /* IODEC */
eph->toes= data[11]; /* toe (s) in irnss week */
eph->week=(int)data[21]; /* irnss week */
eph->toe=adjweek(gpst2time(eph->week,data[11]),toc);
eph->ttr=adjweek(gpst2time(eph->week,data[27]),toc);
eph->svh =(int)data[24]; /* sv health */
eph->sva=uraindex(data[23]); /* ura (m->index) */
eph->tgd[0]= data[25]; /* TGD */
}
if (eph->iode<0||1023<eph->iode) {
trace(2,”rinex nav invalid: sat=%2d iode=%d\n”,sat,eph->iode);
}
if (eph->iodc<0||1023<eph->iodc) {
trace(2,”rinex nav invalid: sat=%2d iodc=%d\n”,sat,eph->iodc);
}
return 1;
}
今天的文章rinex中的 decode_eph函数 URA计算是否合理?分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/64577.html