GPS测量与数据处理实验报告_第1页
GPS测量与数据处理实验报告_第2页
GPS测量与数据处理实验报告_第3页
GPS测量与数据处理实验报告_第4页
GPS测量与数据处理实验报告_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、GPS测量与数据处理(N文件)实验(上机)报告班级·学号 姓名实验 日期6月10号 任课教师 实验名称实践型一、实验目的及要求 1. 通过编程N文件,深入理解matlab编程方式与运行原理。 2.通过老师给定的N文件,看懂并在理解的基础上,加入自己的内容。 3.学习高级语言软件MATLAB. 二、实验平台 1.微机一台2.matlab软件一套三、实验内容请写出实验内容的操作步骤(本表不够填写可加页):(请写出实验内容各环节的详细操作步骤(可附屏幕截图)和常用功能的实现代码清单) 三、实验内容 1.打开MATLAB程序及面如下图所示 2.打开已有的REND N RINEX 文件,并点击

2、运行,运行成果如下(具体程序段见附录)。 3.通过本组编辑后的程序及运行结果如下(具体程序段见附录)。 已知程序 function EphDat = Read_N_Renix(filename)%Read the N-file with the renix format%Input:% filename: the name of file including the file path%Output: % EphDat: a structure, storing the ephemeris% .SatPRN; /the Sat code% .toc; /gpsweeksec% .a0; /di

3、fferent of the sat clock(second)% .a1; /sat clock drift (s/s)% .a2; /the rate of the Sat clock drift(s/s2)% .IODE; /星历数据有效期IODE=Toe -Tl;% .Crs; /轨道半径正弦调和改正项振幅(m)% .DetaN; /平均运动修正量% .M0; /Toe时的平近点角% .Cuc; /纬度幅角余弦调和改正项振幅% .e; /卫星轨道扁心率% .Cus; /纬度幅角正弦调和改正项振幅% .sqrtA; /卫星轨道长半径方根% .Toe; /星历参考时间% .Cic; /轨道

4、倾角余弦调和改正项振幅% .OMG0; /升交点赤经% .Cis; /轨道倾角正弦调和改正项振幅% .I0; /轨道倾角% .Crc; /轨道半径余弦调和改正项振幅(m)% .omg; /近地点角距% .OMG0dot; /升交点赤经变化率% .I0dot; /轨道倾角变化率% .ISL2; /L2 数据标志% .GpsWn; /GPS week number% .ISL2P; /L2 P 数据标志% .SatAccu; /The accuracy of the satellite(m)% .SatHth; /The health of the Satellite (MSB)% .Tgd; /

5、单频接收机延迟改正数% .IODC; /时钟数据有效期%Begin programfilename,pathname=uigetfile('*.*N','读取GPS广播星历文件');fp=fopen(strcat(pathname,filename),'rt');if(fp=-1) error('error to open the '+ filename);end%read the file headerwhile (1) strTemp=fgets(fp); if(strTemp=-1) error('error in

6、the header file of '+ filename); end if(length(strTemp)<73) strTemp(length(strTemp)+1:73)='X' end if(strTemp(61:73)='END OF HEADER') break; endend%read the N file data%read the first epochstrTemp=fgets(fp);EphDat(1).SatPRN=str2num(strTemp(1:2);Year=str2num(strTemp(4:5);Mon=str

7、2num(strTemp(7:8);Day=str2num(strTemp(10:11);THour=str2num(strTemp(13:14);TMin=str2num(strTemp(16:17);TSec=str2num(strTemp(19:22);if (Year>80) %GPS从20C80年代上商用 Year=Year+1900;else Year=Year+2000;end EphDat(1).toc=ConvertGpsTime(Year,Mon,Day,THour,TMin,TSec); %转换成GPS周秒EphDat(1).a0=str2num(strTemp(2

8、3:41); %D,E需要转化。EphDat(1).a1=str2num(strTemp(42:60);EphDat(1).a2=str2num(strTemp(61:79);strTemp=fgets(fp); %read the second lineEphDat(1).IODE=str2num(strTemp(1:22);EphDat(1).Crs=str2num(strTemp(23:41);EphDat(1).DetaN=str2num(strTemp(42:60);EphDat(1).M0=str2num(strTemp(61:79);strTemp=fgets(fp); %rea

9、d the third line EphDat(1).Cuc=str2num(strTemp(1:22);EphDat(1).e=str2num(strTemp(23:41);EphDat(1).Cus=str2num(strTemp(42:60);EphDat(1).sqrtA=str2num(strTemp(61:79);strTemp=fgets(fp); %read the fourth lineEphDat(1).Toe=str2num(strTemp(1:22);EphDat(1).Cic=str2num(strTemp(23:41);EphDat(1).OMG0=str2num(

10、strTemp(42:60);EphDat(1).Cis=str2num(strTemp(61:79);strTemp=fgets(fp); %read the fifth line EphDat(1).I0=str2num(strTemp(1:22);EphDat(1).Crc=str2num(strTemp(23:41);EphDat(1).omg=str2num(strTemp(42:60);EphDat(1).OMG0dot=str2num(strTemp(61:79);strTemp=fgets(fp); %read the sixth line EphDat(1).I0dot=st

11、r2num(strTemp(1:22);EphDat(1).ISL2=str2num(strTemp(23:41);EphDat(1).GpsWn=str2num(strTemp(42:60);EphDat(1).ISL2P=str2num(strTemp(61:79);strTemp=fgets(fp); %the seventh lineEphDat(1).SatAccu=str2num(strTemp(1:22);EphDat(1).SatHth=str2num(strTemp(23:41);EphDat(1).Tgd=str2num(strTemp(42:60);EphDat(1).I

12、ODC=str2num(strTemp(61:79); strTemp=fgets(fp); %the eigth line%read the other epochswhile(1) strTemp=fgets(fp); if(strTemp=-1) break; end TempEph.SatPRN=str2num(strTemp(1:2); Year=str2num(strTemp(4:5);Mon=str2num(strTemp(7:8); Day=str2num(strTemp(10:11);THour=str2num(strTemp(13:14); TMin=str2num(str

13、Temp(16:17);TSec=str2num(strTemp(19:22); if (Year>80) %GPS从20C80年代上商用 Year=Year+1900; else Year=Year+2000; end TempEph.toc=ConvertGpsTime(Year,Mon,Day,THour,TMin,TSec); %判断是否有新的星历出现,如果没有则增加 Increase=true; for i=1:length(EphDat) if(EphDat(i).SatPRN=TempEph.SatPRN) if(abs(TempEph.toc-EphDat(i).toc)

14、<3600) Increase=false; break; end end end if(Increase) for i=1:7 %读入剩余的7行 fgets(fp); end continue; % the next eph end TempEph.a0=str2num(strTemp(23:41); TempEph.a1=str2num(strTemp(42:60); TempEph.a2=str2num(strTemp(61:79); strTemp=fgets(fp); %read the second line TempEph.IODE=str2num(strTemp(1:22

15、); TempEph.Crs=str2num(strTemp(23:41); TempEph.DetaN=str2num(strTemp(42:60); TempEph.M0=str2num(strTemp(61:79); strTemp=fgets(fp); %read the third line TempEph.Cuc=str2num(strTemp(1:22); TempEph.e=str2num(strTemp(23:41); TempEph.Cus=str2num(strTemp(42:60); TempEph.sqrtA=str2num(strTemp(61:79); strTe

16、mp=fgets(fp); %read the fourth line TempEph.Toe=str2num(strTemp(1:22); TempEph.Cic=str2num(strTemp(23:41); TempEph.OMG0=str2num(strTemp(42:60); TempEph.Cis=str2num(strTemp(61:79); strTemp=fgets(fp); %read the fifth line TempEph.I0=str2num(strTemp(1:22); TempEph.Crc=str2num(strTemp(23:41); TempEph.om

17、g=str2num(strTemp(42:60); TempEph.OMG0dot=str2num(strTemp(61:79); strTemp=fgets(fp); %read the sixth line TempEph.I0dot=str2num(strTemp(1:22); TempEph.ISL2=str2num(strTemp(23:41); TempEph.GpsWn=str2num(strTemp(42:60); TempEph.ISL2P=str2num(strTemp(61:79); strTemp=fgets(fp); %the seventh line TempEph

18、.SatAccu=str2num(strTemp(1:22); TempEph.SatHth=str2num(strTemp(23:41); TempEph.Tgd=str2num(strTemp(42:60); TempEph.IODC=str2num(strTemp(61:79); strTemp=fgets(fp); %the eigth line num_eph=length(EphDat)+1; EphDat(num_eph)=TempEph;endfclose(fp);return; 所编程序function EphDat = Read_N_Renix%Read the N-fil

19、e with the renix format%Input:% filename: the name of file including the file path%Output: % EphDat: a structure, storing the ephemeris% .SatPRN; /the Sat code% .toc; /gpsweeksec% .a0; /different of the sat clock(second)% .a1; /sat clock drift (s/s)% .a2; /the rate of the Sat clock drift(s/s2)% .IOD

20、E; /星历数据有效期IODE=Toe -Tl;% .Crs; /轨道半径正弦调和改正项振幅(m)% .DetaN; /平均运动修正量% .M0; /Toe时的平近点角% .Cuc; /纬度幅角余弦调和改正项振幅% .e; /卫星轨道扁心率% .Cus; /纬度幅角正弦调和改正项振幅% .sqrtA; /卫星轨道长半径方根% .Toe; /星历参考时间% .Cic; /轨道倾角余弦调和改正项振幅% .OMG0; /升交点赤经% .Cis; /轨道倾角正弦调和改正项振幅% .I0; /轨道倾角% .Crc; /轨道半径余弦调和改正项振幅(m)% .omg; /近地点角距% .OMG0dot; /

21、升交点赤经变化率% .I0dot; /轨道倾角变化率% .ISL2; /L2 数据标志% .GpsWn; /GPS week number% .ISL2P; /L2 P 数据标志% .SatAccu; /The accuracy of the satellite(m)% .SatHth; /The health of the Satellite (MSB)% .Tgd; /单频接收机延迟改正数% .IODC; /时钟数据有效期%Begin programglobal EphDatEphDat=struct;filename,pathname=uigetfile('*.*N',&

22、#39;读取GPS广播星历文件');fid1=fopen(strcat(pathname,filename),'rt');if(fid1=-1) msgbox('Input File or Path is not correct','warning ','warn'); return;endwhile(1) temp=fgets(fid1); header=findstr(temp,'END OF HEADER '); if(isempty(header) break; endendi=1;while(1)

23、 temp=fgets(fid1); if(temp=-1) break; end EphDat(i).PRN=str2num(temp(1:2); year=str2num(temp(4:5); EphDat(i).toc=Time_MJD(year,str2num(temp(7:8),str2num(temp(10:11),str2num(temp(13:14),str2num(temp(16:17),str2num(temp(19:22); EphDat(i).a0=str2num(temp(23:41); EphDat(i).a1=str2num(temp(42:60); EphDat

24、(i).a2=str2num(temp(61:79); temp=fgets(fid1); EphDat(i).idoe=str2num(temp(4:22); EphDat(i).Crs=str2num(temp(23:41); EphDat(i).dn=str2num(temp(42:60); EphDat(i).M0=str2num(temp(61:79); temp=fgets(fid1); EphDat(i).Cuc=str2num(temp(4:22); EphDat(i).e=str2num(temp(23:41); EphDat(i).Cus=str2num(temp(42:60); EphDat(i).sqa=str2num(temp(61:79); temp=fgets(fid1); EphDat(i).toe=str2num(temp(4:22); EphDat

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论