This repository has been archived on 2026-10-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
KNZ_GeoTrackLab/select_epo.h
T
2024-09-20 13:34:44 +08:00

31 lines
511 B
C

#ifndef _SELECT_EPO_H_
#define _SELECT_EPO_H_
#include<stdio.h>
#include<math.h>
#include"read.h"
//挑选合适的星历
extern int select_epoch(double SecofWeek, int sPRN, pnav_body nav_b, int gps_satnum)
{
int best_epoch = 0;
double min=10000;//假设最小值是1万秒
double Min;
int i;
for (i = 0; i < gps_satnum; i++)
{
if (sPRN == nav_b[i].sPRN)
{
Min = fabs(SecofWeek - nav_b[i].TOE);
if (Min <= min)
{
best_epoch = i;
min = Min;
}
}
}
return best_epoch;
}
#endif