RTKLIB改-sortobs-只要双频及以上的观测值

extern int sortobs(obs_t *obs)
{
int i, j, n;

trace(3, "sortobs: nobs=%d\n", obs->n);

if (obs->n <= 0) return 0;

qsort(obs->data, obs->n, sizeof(obsd_t), cmpobs);

/* delete duplicated data */
for (i = j = 0; i<obs->n; i++)
{
if (obs->data[i].sat != obs->data[j].sat ||
obs->data[i].rcv != obs->data[j].rcv ||
timediff(obs->data[i].time, obs->data[j].time) != 0.0)
{
obs->data[++j] = obs->data[i];
}
if (obs->data[j].P[1] == 0 || obs->data[j].L[1] == 0)
{
obs->data[j] = obs->data[j-1];
j--;
}
}
obs->n = j + 1;

for (i = n = 0; i<obs->n; i = j, n++)
{
for (j = i + 1; j<obs->n; j++)
{
if (timediff(obs->data[j].time, obs->data[i].time)>DTTOL) break;
}
}
return n;
}

每次遇到观测值数据的第二个为0,把这个数据删除。

posted @ 2016-10-16 09:13  OnEDaYa  阅读(417)  评论(0编辑  收藏  举报