⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 erg1code.m

📁 这是国外关于卫星导航方面一书的源代码
💻 M
字号:
% -----------------------------------------------------------------------------
% GPSLab:      ERG1CODE.M
%
% Save results after running of SPPLAB.M:
% mean values, observation statistics    [lst1code.txt]
%
% -----------------------------------------------------------------------------
% (c) iapg 1998-2001 zeb

if ~exist('spp_is_calc')
   %warndlg(['Ergebnisdatei nicht erstellbar, solange kein SPP berechnet wurde: '...
   %      'Bitte f黨ren Sie zuerst "SPP"  -> "berechnen" aus.'] ,...
   %      'GPS Lab: Anwendungsfehler beim Aufruf von ERG1CODE.M');
   return;
end 

fid=fopen('lst1code.txt','wt+');
a1='#########################################################################';
a2='       Results of the Pseudorange Processing (SPP, coordinate-DGPS)';
a3='                        GPSLab (c) iapg 2001 zeb';
a4='################################ END ####################################';
a5=['            This file was created ',datestr(datenum(now),0)];
a6='-------------------------------------------------------------------------';
a7='------------------------------------';
a10='lstkdgps.txt (DGPS from coordinates): GPS-Wsec, DX, DY, DZ, Bsllength, Dh';
a13='Units                                   [sec]   [m] [m] [m]    [m]     [m]';
a11='lstspp1.txt (Ref): GPS-Wsec, X, Y, Z, Dt, sig(X), sig(Y), sig(Z), sig(Dt)';
a12='lstspp2.txt (Rov): GPS-Wsec, X, Y, Z, Dt, sig(X), sig(Y), sig(Z), sig(Dt)';
a14='Units                [sec]  [m][m][m] [m]   [m]     [m]     [m]     [m]';

fprintf(fid,'%s\n%s\n%s\n%s\n%s\n%s\n\n',a1,a2,a3,a1,a5,a6);
xxs1=m_x1+xs1;
yys1=m_y1+ys1;
zzs1=m_z1+zs1;
xxs2=m_x2+xs2;
yys2=m_y2+ys2;
zzs2=m_z2+zs2;

if m_x1>1000 | m_y1>1000 | m_z1>1000
          warndlg(['While saving the results of the SPPLAB.M-run the fact was stated,',...
             ' that the approximate coordinates of the reference station deviate more than 1 km from' ...
             ' the mean of the navigation solution. In the case of a static observation' ...
             ' these coordinates should be corrected in the header file (S1HEAD).'], ...   
       'GPSLab: Unsufficient approximate coordinates -  1998 zeb');
end

if m_x2>1000 | m_y2>1000 | m_z2>1000
          warndlg(['While saving the results of the SPPLAB.M-run the fact was stated,',...
             ' that the approximate coordinates of the rover station deviate more than 1 km from' ...
             ' the mean of the navigation solution. In the case of a static observation' ...
             ' these coordinates should be corrected in the header file (S2HEAD).'], ...   
       'GPSLab: Unsufficient approximate coordinates -  1998 zeb');
end

sxxs1=median(sxs1);
syys1=median(sys1);
szzs1=median(szs1);

sxxs2=median(sxs2);
syys2=median(sys2);
szzs2=median(szs2);

% dtt1=median(dts1);
% dtt2=median(dts2);

%+++++++++++++++++++++++++++++++++++++++++++++++++

[bbs1,lls1,hhs1]=xyz2blh(xxs1,yys1,zzs1);
[sbbs1,slls1,shhs1,dums,dumA,dumz]=dxyz2neu(sxxs1,syys1,szzs1,bbs1,lls1);
sbbs1=abs(sbbs1);
slls1=abs(slls1);
shhs1=abs(shhs1);

[bbs2,lls2,hhs2]=xyz2blh(xxs2,yys2,zzs2);
[sbbs2,slls2,shhs2,dums,dumA,dumz]=dxyz2neu(sxxs2,syys2,szzs2,bbs2,lls2);
sbbs2=abs(sbbs2);
slls2=abs(slls2);
shhs2=abs(shhs2);

%+++++++++++++++++++++++++++++++++++++++++++++++++

gds1min=min(gdops1);
gds1max=max(gdops1);
gds1mit=mean(gdops1);
gds2min=min(gdops2);
gds2max=max(gdops2);
gds2mit=mean(gdops2);

[haufig1,n1]=hist(satnrs,1:32);
n1=n1(logical(haufig1>0));
haufig1=haufig1(logical(haufig1>0));

[haufig2,n2]=hist(satnr2,1:32);
n2=n2(logical(haufig2>0));
haufig2=haufig2(logical(haufig2>0));


a8='Reference station                   X [m]        Y [m]        Z [m]';
a9='Rover station                       X [m]        Y [m]        Z [m]';
ag8='Reference station (WGS84 ellipsoid) Lat [癩      Lon [癩      H [m]';
ag9='Rover station     (WGS84 ellipsoid) Lat [癩      Lon [癩      H [m]';

fprintf(fid,'%s\n%s\n%s%12.3f %12.3f %12.3f\n',a8,a6,'approximate coordinates        :',xs1,ys1,zs1);
fprintf(fid,'%s%12.3f %12.3f %12.3f\n','estimated coordinates    (mean):',xxs1,yys1,zzs1);
fprintf(fid,'%s%12.3f %12.3f %12.3f\n\n','standard deviations      (mean):',sxxs1,syys1,szzs1);
fprintf(fid,'%s\n%s\n%s%12.3f %12.3f %12.3f\n',a9,a6,'approximate coordinates        :',xs2,ys2,zs2);
fprintf(fid,'%s%12.3f %12.3f %12.3f\n','estimated coordinates    (mean):',xxs2,yys2,zzs2);
fprintf(fid,'%s%12.3f %12.3f %12.3f\n\n\n','standard deviations      (mean):',sxxs2,syys2,szzs2);

%++++++++++++++++++++++++++++++++++
fprintf(fid,'%s\n%s\n%s%12.8f %12.8f %12.3f\n',ag8,a6,'approximate coordinates        ',app1_b,app1_l,app1_h);
fprintf(fid,'%s%12.8f %12.8f %12.3f\n','estimated coordinates   (mean):',bbs1,lls1,hhs1);
fprintf(fid,'%s%12.3f %12.3f %12.3f\n\n','standard deviations     (mean):',sbbs1,slls1,shhs1);
fprintf(fid,'%s\n%s\n%s%12.8f %12.8f %12.3f\n',ag9,a6,'approximate coordinates        ',app2_b,app2_l,app2_h);
fprintf(fid,'%s%12.8f %12.8f %12.3f\n','estimated coordinates   (mean):',bbs2,lls2,hhs2);
fprintf(fid,'%s%12.3f %12.3f %12.3f\n\n\n','standard deviations     (mean):',sbbs2,slls2,shhs2);
%++++++++++++++++++++++++++++++++++


% fprintf(fid,'%s %10.3f\n','Uhrfehler des Referenz-Empf鋘gers   (Mittel) [m]:',dtt1);
% fprintf(fid,'%s %10.3f\n\n','Uhrfehler des Rover-Empf鋘gers      (Mittel) [m]:',dtt2);

fprintf(fid,'%s %10.3f\n','height difference from approximate coordin.  [m]:',dapp_h);
fprintf(fid,'%s %10.3f\n\n','height difference from estimated coordin.    [m]:',m_delta_h);
fprintf(fid,'%s %10.3f\n','baseline length from approximate coordinates [m]:',app_bsl);
fprintf(fid,'%s %10.3f\n\n','baseline length from estimated coordinates   [m]:',m_bsl);

fprintf(fid,'%s %6.3f %s %6.3f %s %6.3f\n','GDOP reference       - mean:',gds1mit,'   min:',gds1min,'   max:',gds1max);
fprintf(fid,'%s %6.3f %s %6.3f %s %6.3f\n\n','GDOP rover           - mean:',gds2mit,'   min:',gds2min,'   max:',gds2max);

fprintf(fid,'\n%s\n%s\n%s\n%s\n','observations on reference station  :',a7,'PRN      #',a7);
fprintf(fid,'%3i  %5i\n',[n1;haufig1]);

t1st=s1epo(1,1);
tlast=s1epo(length(s1epo),1);
tspan=tlast-t1st;
tsec=mod(tspan,60);
tmin=(tspan-tsec)/60;
fprintf(fid,'\n%s %6i\n','first  epoch    [GPS week seconds]:  ',t1st);
fprintf(fid,'%s %6i\n','last epoch      [GPS week seconds]:  ',tlast);
fprintf(fid,'%s %6i %s %3i %s\n','time span (processable obs. time) :  ',tmin,' minutes  ',tsec,' seconds ');

fprintf(fid,'\n%s\n%s\n%s\n%s\n','observations on rover station    :',a7,'PRN      #',a7);
fprintf(fid,'%3i  %5i\n',[n2;haufig2]);

t1st=s2epo(1,1);
tlast=s2epo(length(s2epo),1);
tspan=tlast-t1st;
tsec=mod(tspan,60);
tmin=(tspan-tsec)/60;
fprintf(fid,'\n%s %6i\n','first  epoch    [GPS week seconds]:  ',t1st);
fprintf(fid,'%s %6i\n','last epoch      [GPS week seconds]:  ',tlast);
fprintf(fid,'%s %6i %s %3i %s\n','time span (processable obs. time) :  ',tmin,' minutes  ',tsec,' seconds ');



fprintf(fid,'\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n',a1,a10,a13,a6,a11,a12,a14,a6,a4);

fclose(fid);

% --------------------------------------------------------------------------------
% (c) iapg 1998-2001 zeb

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -