• 大小: 7KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-05
  • 语言: Matlab
  • 标签: matlab  rinex  observ  

资源简介

matlab程序,用于读取rinex文件,GNSS观测数据,提取相关数据

资源截图

代码片段和文件信息

function [headobs]=ReadObsData
%读接收机观测数据文件
%HeadODat :a structure stores header information if o-file
%           .ApproXYZ[3];          //approximate coordinate
%           .interval;          //intervals of two adjacent epochs
%           .SiteName;          //point name
%           .Ant_H;             //antenna height
%           .Ant_E;             //east offset of the antenna center
%           .Ant_N;             //north offset of then antenna center
%           .TimeOB;            //first epoch time in modifuied Julian time
%           .TimeOE;            //last epoch time in modifuied Julian time
%           .SumOType;          //number of types of observables
%           .SumOO[SumOType];  //type of observables 0-L11-L22-C13-P14-P25-D16-D2

%ObsODat :a structure stores observables by one and one epoch
%           .TimeOEpp[2];       //reciever time of epoch
%           .SatSum;            //number of satellites
%           .SatCode[SatSum];   //satellites‘ PRN
%           .Obs_FreL1[SatSum]; 
%           .Obs_FreL2[SatSum];
%           .Obs_RangeC1[SatSum];
%           .Obs_RangeP1[SatSum];
%           .Obs_RangeP2[SatSum];
global HeadODat;
global ObsODat;

        [fnamefpath]=uigetfile(‘*.*‘‘选择一个O文件‘);
        O_filename=strcat(fpathfname);
   
    fid1=fopen(O_filename‘rt‘);
    if (fid1==-1)
        msgbox(‘file invalide‘‘warning‘‘warn‘);
        return;
    end
    %将文件头数据存入结构体HeadODat中
    t=0;
    while(t<100)
        s=fgets(fid1);
        t=t+1;
        L=size(s2);
        if L<81
            s(L+1:81)=‘ ‘;
        end
          
        instrS=s(61:81);
        %测站点近似坐标
        if strncmp(instrS‘APPROX POSITION XYZ‘19)
            HeadODat.ApproXYZ=zeros(13);
            HeadODat.ApproXYZ(11)=str2num(s(1:14));
            HeadODat.ApproXYZ(12)=str2num(s(15:28));
            HeadODat.ApproXYZ(13)=str2num(s(29:42));
        %历元间隔;
        elseif strncmp(instrS‘INTERVAL‘8)
            HeadODat.interval=str2num(s(5:11));
        %测站点号    
        elseif strncmp(instrS‘MARKER NAME‘11)
            HeadODat.SiteName=s(1:4)
        %天线中心改正    
        elseif strncmp(instrS‘ANTENNA: DELTA H/E/N‘20)
            HeadODat.Ant_H=str2num(s(1:14));
            HeadODat.Ant_E=str2num(s(15:28));
            HeadODat.Ant_N=str2num(s(29:42));
        %第一个历元时间    
        elseif strncmp(instrS‘TIME OF FIRST OBS‘17)
            year=str2num(s(1:6));
            month=str2num(s(7:12));
            day=str2num(s(13:18));
            hour=str2num(s(19:24));
            minute=str2num(s(25:30));
            second=str2num(s(31:42));
            HeadODat.TimeOB=TimetoJD(yearmonthdayhourminutesecond);
        %最后一个历元时间    
        elseif strncmp(instrS‘TIME OF LAST OBS‘16)
            year=str2num(s(1:6));
            month=str2num(s(7:12));
            day=str2num(s(13:18));
            hour=str2num(s(19:24));
            minute=str2num(s(25:

评论

共有 条评论