function t=TimetoJD(Y,M,D,h,f,s) if(Y>=80) Y=Y+1900; else Y=Y+2000; end if M<=2 Y=Y-1; M=M+12; end JD=fix(365.25*Y)+fix(30.6001*(M+1))+D+h/24+f/1440+s/24/3600+1720981.5; t=JD-2444244.5; function [head,obs]=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-L1,1-L2,2-C1,3-P1,4-P2,5-D1,6-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; [fname,fpath]=uigetfile('*.*','选择一个 O 文件'); O_filename=strcat(fpath,fname); 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(s,2); if L<81 s(L+1:81)=' '; end instrS=s(61:81); %测站点近似坐标 if strncmp(instrS,'APPROX POSITION XYZ',19) HeadODat.ApproXYZ=zeros(1,3); HeadODat.ApproXYZ(1,1)=str2num(s(1:14)); HeadODat.ApproXYZ(1,2)=str2num(s(15:28)); HeadODat.ApproXYZ(1,3)=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: ...