亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? to-rinex.c

?? GPS詳盡的代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
#include "rinex.h"
#include "sv.h"
#define ASHTECH  1
#define TRIMBLE  2
#define NAVSYMM  3
#define MOTOROLA 4
#define NOVATEL  5
#define EG_ASCII  0
#define EG_BINARY 1
/* globe varition */
RinexObsHeaderType rinex_obs_header;
char err_str[64];           /* string containing error message */
int WeekNo;
int MeasType[9];
/* each 10 words (3 bytes per word) corresponding to words 1-10
   of subframes 1-3 of the satellite nav message.              */
u1 sub1[10][3];
u1 sub2[10][3];
u1 sub3[10][3];
int EphPrn;
u1 hex_ephemeris[24][3] ;
    /* [word][byte] : 24 words (3 bytes per word) corresponding to words 3-10
       of subframes 1-3 of the satellite nav message. */

double tphase[3][8];
double F1[3][8],F2[3][8];
int Count1 = 0, Count2 =0;

/* programm describe */
int Ashtech2Rinex(char *SourceFile,char *ObsFile);
int Ashtech21Rinex(char *SourceFile,char *NavFile);
int ReadAshEpoch(FILE *f,int numobs,RinexEpochType *RinexEpoch);
int ReadAshEph(FILE *f,SVText *eph);
void  Navsymm21Rinex(char  *EPPFile,char *RinexNavFile);
int ReadNavsymmEph( FILE *f1,SVText *snv );
int Navsymm2Rinex(char *SourceFile,char *RinexFile);
int ReadNavstarEpoch(FILE *fname,  RinexEpochType  *RinexEpoch);
int Trimble2Rinex(char *SourceFile,char *RinexObsFile,char *RinexNavFile);
int ReadType11(FILE *fs);
int ReadType17(FILE *fs, RinexEpochType *Epoch);
int ReadType3(int len,FILE *fs,SVText far *eph,FILE *fn);
int ReadType21(int len,FILE *fs, SVText *eph,FILE *fn);
int Novatel2Rinex(char *SourceFile,char *RinexFile,char *RinexNavFile);
void ReadNovatelPos(char *s,  float *X,float *Y,float *Z);
void ReadNovatelEpoch(char *s,RinexEpochType *RinexEpoch);
int ReadNovatelEph(char *s,SVText *snv);
void Convert_Ephemeris(SVText *eph);
i2 Hex(i1 ASCIIvalue);
int Motorola2Rinex(char *SourceFile,char *ObsFile,char *NavFile);
void ReadMotoEpoch(unsigned char *buf,RinexEpochType *RinexEpoch);
void ReadMotoEph(u1 eg_type, char *buf,SVText *eph);

void main()
{
  int Type;
  char *ObsInFile,*EphInFile, str[200];
  char *RinexObsFile,*RinexNavFile;
  FILE *f1,*f2;

  clrscr();
  printf("    ******     Transfer to Rinex File ******\n");
  printf(" Source File Type: 1-Ashtech   2-Trimble 4000  3-Navsymm  \n");
  printf("                   4-Motorola  5-Novatel \n");

  do
  {
    printf("Please Input GPS Type:");
    scanf("%i",&Type);
    if((Type>5)||(Type<1))
      { printf(" Invalid Type Input,Input Again!\n");return;}
    else break;
   }while(1);

  InitRinexObsHeader();
  RinexObsFile="rinex.98o";
  RinexNavFile="rinex.98n";
  WeekNo=0;
/*
  Type=MOTOROLA;
  ObsInFile="c:\\data\\moto.dif";
*/
  switch(Type)
  {
    case ASHTECH:
    case NAVSYMM:
	    printf("Please Input Soure Obs File Name:");
	    scanf("%20s",ObsInFile);
	    printf("Please Input Rinex Nav File Name:");
	    scanf("%20s",EphInFile);

	    if(Type==ASHTECH) {
		 Ashtech21Rinex(EphInFile,RinexNavFile);
		 Ashtech2Rinex(ObsInFile,"temp.obs"); }
	    else if(Type==NAVSYMM) {
		 Navsymm21Rinex(EphInFile,RinexNavFile);
		 Navsymm2Rinex(ObsInFile,"temp.obs");}
	    break;
    case TRIMBLE:
    case MOTOROLA:
    case NOVATEL:
	    printf("Please Input Soure Data File Name:");
	    scanf("%20s",ObsInFile);
	    if(Type==TRIMBLE) {
	       Trimble2Rinex(ObsInFile,"temp.obs",RinexNavFile);}
	    else if(Type==NOVATEL) {
	       Novatel2Rinex(ObsInFile,"temp.obs",RinexNavFile);}
	    else if(Type==MOTOROLA) {
	       Motorola2Rinex(ObsInFile,"temp.obs",RinexNavFile);}
	    break;
    default:break;
   }

   /* format obs file */
   if ((f1 = fopen(RinexObsFile, "wt+"))== NULL) {
      fprintf(stderr, "Cannot open output file.\n"); return;}
   if ((f2 = fopen("temp.obs", "rt"))== NULL) {
      fprintf(stderr, "Cannot open temp file.\n"); return ;}
   MeasType[0]=1;MeasType[1]=2;
   WriteRinexObsHeaderFile(f1, &rinex_obs_header);
   while(!feof(f2)) { fgets(str,2000,f2);fputs(str,f1); }
   fclose(f1); fclose(f2);
}

int Ashtech2Rinex(char *SourceFile,char *ObsFile)
{
  FILE *f1,*f2;
  int i,flag,FirstEpoch,numobs;
  RinexEpochType RinexEpoch;

  struct FileHeaderStruct
  {
    char version[10];
    unsigned char iver;
    char rtype[10];
    char chnver[10];
    char navver[10];
    int  cap;   /* 1=L1 only  2=L1 L2  4=range only */
    long reserved;
    unsigned char numobs;
    char spare[42];
  } Header;

  if ((f1=fopen(ObsFile,"wa+"))==NULL)
    {  sprintf(err_str,"can not open file \n");return 1; }
  if((f2=fopen(SourceFile,"rb"))==NULL)
    {  sprintf(err_str,"cannot open file \n"); return 1; }
   if(fread(&Header,sizeof(struct FileHeaderStruct),1,f2)!=1)
     {  sprintf(err_str,"file read error"); return 1;  }
   numobs=Header.numobs;

   flag=0;  FirstEpoch=1;
   do
   {
     ResetRinexEpoch(&RinexEpoch);
     flag = ReadAshEpoch(f2,numobs,&RinexEpoch);
     if(FirstEpoch==1)
     {
       rinex_obs_header.StartYear=rinex_obs_header.EndYear;
       rinex_obs_header.StartMonth=rinex_obs_header.EndMonth;
       rinex_obs_header.StartDay=rinex_obs_header.EndDay;
       rinex_obs_header.StartHour=rinex_obs_header.EndHour;
       rinex_obs_header.StartMinute=rinex_obs_header.EndMinute;
       rinex_obs_header.StartSecond=rinex_obs_header.EndSecond;
       FirstEpoch=0;
     }
     WriteRinexObsEpochFile(f1,&RinexEpoch);
   }while(flag==0);
  fclose(f1);  fclose(f2); // free(RinexEpoch);
  return 0;
}

int Ashtech21Rinex(char *SourceFile,char *NavFile)
{
  FILE   *f, *f2;
  SVText *RinexEpp;
  int First;

  if((f=fopen(SourceFile,"rb"))==NULL)
    { sprintf(err_str,"cannot open file \n");  return 1;  }
  if ((f2=fopen(NavFile,"wa"))==NULL)
    { sprintf(err_str,"can not open file \n"); return 1;  }
  if((RinexEpp=(SVText *)malloc(sizeof(SVText)))==NULL)
    { sprintf(err_str,"not enough mem \n");     return 1; }

  WriteRinexNavHeaderFile(f2);
  while(!feof(f))  {
    ResetRinexEpp(RinexEpp);
    ReadAshEph(f,RinexEpp);
    WriteRinexNavFile( f2, RinexEpp);}
  fclose(f);  fclose(f2);  free(RinexEpp);
  return 0;
}

int ReadAshEpoch(FILE *f,int numobs,RinexEpochType *RinexEpoch)
{
   long t;
   int i,j;
   double C = 299792458.0;
   double GPStime;

  struct PosStruct
  {
    char sitename[4];
    double rcv_time,navx,navy,navz,navt,navdot;
    float navxdot,navydot,navzdot;
    int PDOP;
    unsigned char num_sats;
  }PosData;

  struct SatStruct                    /* measurement (data) record  */
  {
    unsigned char svprn;
    unsigned char elev;                  /* unit degree */
    unsigned char azim;                  /*  unit 10 degree */
    unsigned char chnind;
  }SatData;

  struct RawDataStruct
  {
    double raw_range;
    float  smth_r;
    int    smth_n;
    unsigned char polarity;
    unsigned char warning;
    unsigned char goodbad;
    unsigned char ireg;
    unsigned char qa_phase;
    long  doppler;
    double   carphase;
  }RawData[3] ;

   if(fread(&PosData,sizeof(struct PosStruct),1,f)!=1){
       sprintf(err_str,"file read error");  return 1; }
   GPStime=PosData.rcv_time-PosData.navt/C;
   rinex_obs_header.AppX=PosData.navx;
   rinex_obs_header.AppY=PosData.navy;
   rinex_obs_header.AppZ=PosData.navz;

   for(i=0;i<PosData.num_sats;i++)  {
      if(fread(&SatData,sizeof(struct SatStruct),1,f)!=1) {
	 sprintf(err_str,"file read error");  return 1; }
      for(j=0;j<numobs;j++) {
	 if(fread(&RawData[j],sizeof(struct RawDataStruct),1,f)!=1) {
	   sprintf(err_str,"file read error"); return 1; } }
      RinexEpoch->satnum++;
      RinexEpoch->PRN[i]=SatData.svprn;
      RinexEpoch->ca_range[i]=RawData[0].raw_range *C - PosData.navt;
      RinexEpoch->phase_l1[i]=RawData[0].carphase  ;
      RinexEpoch->P1_range[i]=RawData[1].raw_range *C - PosData.navt;
      RinexEpoch->phase_l2[i]=RawData[1].carphase  ;
      RinexEpoch->doppler_l1[i]=RawData[0].doppler/10000.0;}
   GetYMDHMS(WeekNo,GPStime,&RinexEpoch->year,&RinexEpoch->month,
	     &RinexEpoch->day,&RinexEpoch->hour,&RinexEpoch->minute,&RinexEpoch->second);
   rinex_obs_header.EndYear=RinexEpoch->year;
   rinex_obs_header.EndMonth=RinexEpoch->month;
   rinex_obs_header.EndDay=RinexEpoch->day;
   rinex_obs_header.EndHour=RinexEpoch->hour;
   rinex_obs_header.EndMinute=RinexEpoch->minute;
   rinex_obs_header.EndSecond=RinexEpoch->second;
   RinexEpoch->year-=1900;  RinexEpoch->flag = 0;
   return 0;
}

int ReadAshEph(FILE *f,SVText *eph)
{
   struct EppStruct
   {
     unsigned char prn;
     unsigned int  week;
     long    tow;
     float tgd;
     long aodc,toc;
     float af2,af1,af0;
     long aode;
     float deltan;
     double m0,e, roota;
     long toe;
     float cic,crc,cis,crs,cuc,cus;
     double omega0,omega,i0;
     float omegadot,idot;
     int accuracy,health,fit;
  }EppData;

   if(fread(&EppData,sizeof(struct EppStruct),1,f)!=1) {
       sprintf(err_str,"file read error");  return 1; }
   eph->prn=EppData.prn;      WeekNo=eph->wn=EppData.week;
   eph->tow=EppData.tow;      eph->tgd=EppData.tgd;
   eph->aodc=EppData.aodc;    eph->toc=EppData.toc;
   eph->af2=EppData.af2;      eph->af1=EppData.af1;
   eph->af0=EppData.af0;
   eph->aode=EppData.aode;    eph->deltan=EppData.deltan * PI;
   eph->m0=EppData.m0* PI;    eph->e=EppData.e;
   eph->roota=EppData.roota;  eph->toe=EppData.toe;
   eph->cic=EppData.cic;      eph->crc=EppData.crc;
   eph->cis=EppData.cis;      eph->crs=EppData.crs;
   eph->cuc=EppData.cuc;      eph->cus=EppData.cus;
   eph->omega0=EppData.omega0* PI;  eph->omega=EppData.omega* PI;
   eph->i0=EppData.i0* PI;          eph->omegadot=EppData.omegadot* PI;
   eph->idot=EppData.idot* PI;      eph->accuracy=EppData.accuracy;
   eph->health=EppData.health;  eph->fit=EppData.fit;
   return 0;
}

int Navsymm2Rinex(char *SourceFile,char *RinexFile)
{
  int NumSats;
  int EpochNum,BadEpochNum;
  int flag;
  int IsFirstEpoch;

   struct time_type		  /* time (same as 'tm' type in time.h) */
   {
     short month;                /* 0-11 */
     short day;                  /* 1-31 */
     short year;                 /* year-1900 (eg. 92) */
     short hour;
     short min;
     short sec;
   } ;

   struct navstar_bin_file_type	  /* Header & structure for binary gpb files */
						   /* (202 bytes) */
   {
     short size;                 /* structure size in bytes */
     float version;              /* version number (see above) */
     char receiver;              /* receiver type (see above) */
     char max_channels;          /* maximum number of channels (for safety) */
     struct time_type time;                /* time of file open */
     float interval;             /* data interval in seconds */
     char extra1[64];
				 /* variables used by software */
     char fname[40];             /* file name */
     FILE *f;                    /* file pointer */
     short vbufsize;             /* size of file buffer (internal) */
     void *vbuf;                 /* pointer to vbuf (allocated in open) */
     char extra2[64];
  } Header;

  RinexEpochType  *RinexEpoch;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情一区在线| 精品三级av在线| 成人激情免费电影网址| 国产精品中文字幕欧美| 国产成人精品免费视频网站| 国产美女主播视频一区| 国产精品一区二区在线观看网站| 激情小说亚洲一区| 国产原创一区二区三区| 国产精品乡下勾搭老头1| 成人免费不卡视频| 一本色道综合亚洲| 欧美日韩不卡一区| 精品日产卡一卡二卡麻豆| 精品国产一区二区国模嫣然| 欧美韩国一区二区| 亚洲激情五月婷婷| 日本成人在线网站| 国产成人精品影视| 色综合色综合色综合| 精品视频一区二区不卡| 日韩三级高清在线| 中日韩av电影| 一区2区3区在线看| 青草av.久久免费一区| 国产在线播精品第三| 97精品久久久久中文字幕| 精品视频一区二区不卡| 久久久综合九色合综国产精品| 国产欧美一区二区精品性| 亚洲精品第一国产综合野| 蜜桃av噜噜一区二区三区小说| 国产成人午夜片在线观看高清观看| 色婷婷综合在线| 日韩三级中文字幕| 尤物在线观看一区| 久久99精品国产麻豆婷婷| 99久久精品国产麻豆演员表| 日韩一区二区三区四区五区六区| 久久综合色天天久久综合图片| 亚洲三级免费观看| 精品中文av资源站在线观看| 色视频欧美一区二区三区| 久久亚洲春色中文字幕久久久| 亚洲国产精品麻豆| 成人精品视频一区| 欧美草草影院在线视频| 亚洲精品水蜜桃| 国产麻豆视频一区| 欧美一区二区三区四区久久| 亚洲人精品一区| 国产乱子轮精品视频| 欧美精选一区二区| 成人免费在线视频观看| 国产一二精品视频| 欧美tickle裸体挠脚心vk| 亚洲成a人v欧美综合天堂| av高清久久久| 国产精品久久久久国产精品日日| 精品一区免费av| 91精品综合久久久久久| 亚洲综合精品久久| 一本一本大道香蕉久在线精品 | 亚洲国产精品视频| 99精品久久久久久| 国产精品午夜免费| 国产精品影音先锋| 久久久九九九九| 国产一区在线观看视频| 日韩美女天天操| 日本视频在线一区| 日韩美女视频在线| 麻豆传媒一区二区三区| 欧美va在线播放| 精品写真视频在线观看| 欧美mv日韩mv国产网站| 麻豆成人久久精品二区三区红 | 精品视频一区 二区 三区| 亚洲精品国产第一综合99久久| 91麻豆产精品久久久久久| 136国产福利精品导航| 91亚洲大成网污www| 亚洲精选视频在线| 欧美曰成人黄网| 亚洲成人激情自拍| 精品国产区一区| 成人晚上爱看视频| 尤物视频一区二区| 5858s免费视频成人| 久久9热精品视频| 国产精品日日摸夜夜摸av| 91麻豆视频网站| 丝袜亚洲精品中文字幕一区| 精品国产自在久精品国产| 国产成a人亚洲精品| 亚洲精品v日韩精品| 欧美一二三区在线| jvid福利写真一区二区三区| 亚洲一区二区三区小说| 日韩一区二区三区视频在线观看| 国产精品99久久久久久似苏梦涵| 中文av一区二区| 欧美日韩高清一区| 国产酒店精品激情| 一区二区三区精品在线观看| 欧美精品日韩一本| 国产a视频精品免费观看| 一区二区免费视频| 337p日本欧洲亚洲大胆精品| 成人avav在线| 视频一区二区三区入口| 久久久久久免费| 欧美色图第一页| 国产宾馆实践打屁股91| 日韩av电影一区| 亚洲欧美色图小说| 久久久久久亚洲综合| 欧美色图天堂网| 国产精品一卡二卡| 视频一区中文字幕| 国产精品第四页| 久久蜜臀精品av| 91精品久久久久久久91蜜桃| 亚洲精选在线视频| 日本一区二区高清| 精品国产伦一区二区三区观看体验 | 国产欧美日韩亚州综合| 欧美日韩美女一区二区| 国产精品亚洲第一区在线暖暖韩国| 亚洲妇熟xx妇色黄| 国产精品不卡在线观看| 久久久国产午夜精品| 欧美猛男男办公室激情| 91免费版在线| 顶级嫩模精品视频在线看| 久久精品二区亚洲w码| 香蕉久久夜色精品国产使用方法| 国产精品美女www爽爽爽| 久久久国产一区二区三区四区小说 | 成人动漫一区二区在线| 久久超级碰视频| 麻豆精品新av中文字幕| 日本欧美在线观看| 天天影视涩香欲综合网| 亚洲成av人片一区二区梦乃| 亚洲最新视频在线播放| 亚洲色欲色欲www在线观看| 中文字幕精品综合| 国产欧美一区二区在线观看| 久久久久国产精品麻豆ai换脸| 精品国精品自拍自在线| 2021久久国产精品不只是精品| 日韩午夜av电影| 欧美大胆人体bbbb| 欧美一区二区视频在线观看2020| 欧美一区二区三区四区视频| 欧美嫩在线观看| 欧美一级欧美一级在线播放| 欧美日韩免费一区二区三区 | 色哟哟一区二区在线观看| eeuss鲁一区二区三区| 91原创在线视频| 91视频观看免费| 欧美三级视频在线| 日韩手机在线导航| 亚洲国产精品传媒在线观看| 日韩伦理av电影| 午夜久久久久久| 激情综合网av| www.66久久| 欧美另类z0zxhd电影| 欧美本精品男人aⅴ天堂| 国产欧美一区二区精品婷婷| 国产精品久久午夜| 亚洲一区二区三区四区中文字幕| 天天综合网天天综合色| 国产伦精一区二区三区| 国产成人av一区二区| 91精品办公室少妇高潮对白| 91精品国产高清一区二区三区 | 91看片淫黄大片一级在线观看| 色欧美片视频在线观看| 日韩免费高清视频| 中文字幕av在线一区二区三区| 一区二区三区日韩精品| 久久se这里有精品| 在线观看一区二区视频| 久久网站最新地址| 亚洲夂夂婷婷色拍ww47| 韩国理伦片一区二区三区在线播放| 色呦呦网站一区| 精品卡一卡二卡三卡四在线| 亚洲视频免费看| 美脚の诱脚舐め脚责91| 91久久精品网| 中文字幕国产精品一区二区| 日本午夜精品视频在线观看| 91小视频免费看| 久久综合九色综合97婷婷女人| 亚洲精品网站在线观看|