Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seph2clk: correct recursive expansion #538

Open
wants to merge 1 commit into
base: demo5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/ephemeris.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,15 @@ extern void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts,
*-----------------------------------------------------------------------------*/
extern double seph2clk(gtime_t time, const seph_t *seph)
{
double t;
int i;

char tstr[40];
trace(4,"seph2clk: time=%s sat=%2d\n",time2str(time,tstr,3),seph->sat);

t=timediff(time,seph->t0);
double ts = timediff(time, seph->t0), t = ts;

for (i=0;i<2;i++) {
t-=seph->af0+seph->af1*t;
for (int i = 0; i < 2; i++) {
t = ts - (seph->af0 + seph->af1 * t);
}
return seph->af0+seph->af1*t;
return seph->af0 + seph->af1 * t;
}
/* sbas ephemeris to satellite position and clock bias -------------------------
* compute satellite position and clock bias with sbas ephemeris
Expand Down