www.pudn.com > chebshev.zip > refrinex.m, change:2013-04-12,size:2282b


function [GCmin,GPS_Time,S_PRN,data_SP3X,data_SP3Y,data_SP3Z,SP3clk]=refrinex 
% Function to reformat SP3 data. 
%输出[GPS周,GPS秒,卫星号,SP3X,SP3Y,SP3Z,钟差clk] 
clc; 
NAJ=999999.999999;   %若数据(坐标及钟差)不可用,用NAJ替代 
% [HeadODat,ObsODat,FileName]=ReadObsData; 
[Head_data,SP3_data]=Read_SP3; 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%计算GPS周积秒 
GPSweek=[]; 
GPSsec=[]; 
GCmin=[];%格里高日历化作分钟 
EpochNum=Head_data.EpochNum;  %历元数 
for k=1:EpochNum 
    GPSweek1=fix((SP3_data(k).TimeOEp)/7); 
    GPSsec1=mod(SP3_data(k).TimeOEp,7)*86400; 
    GPSweek=[GPSweek1;GPSweek]; 
    GPSsec=[GPSsec1;GPSsec]; 
    GCmin=[GCmin;SP3_data(k).mm];%将所有的时间化作分钟,方便后面插值计算 
end 
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%重新定义SP3中X,Y,Z坐标 
%格式如下 
%Each data matrix has the following format(每个数据矩阵格式如下) 
%           PRN_1         PRN_2         ...  PRN_j 
%     t0    SP3X_01      SP3X_02        ...  SP3X_0j 
%     t1    SP3X_11      SP3X_12        ...  SP3X_1j 
%     t2    SP3X_21      SP3X_22        ...  SP3X_2j 
%     ...    ...         ...          ...   ... 
%     tk    SP3X_k1      SP3X_k2        ...  SP3X_kj 
num_sats=Head_data.SatNum;%卫星总数 
data_SP3X=ones(EpochNum,num_sats)*NAJ; 
data_SP3Y=ones(EpochNum,num_sats)*NAJ; 
data_SP3Z=ones(EpochNum,num_sats)*NAJ; 
SP3clk=ones(EpochNum,num_sats)*NAJ; 
for n=1:EpochNum 
    code=SP3_data(n).PRN; 
    SP3X= SP3_data(n).x;   %单个历元下所有的XYZ,clk值 
    SP3Y= SP3_data(n).y; 
    SP3Z= SP3_data(n).z; 
    SPclk= SP3_data(n).Clock_corr; 
    [C,ia,ib]=intersect(code,Head_data.SP3_PRN); 
       for j=1:length(ib) 
                data_SP3X(n,ib(j))=SP3X(ia(j)); 
                data_SP3Y(n,ib(j))=SP3Y(ia(j)); 
                data_SP3Z(n,ib(j))=SP3Z(ia(j)); 
                SP3clk(n,ib(j))=SPclk(ia(j)); 
       end 
end 
GPS_Time=[GPSweek GPSsec]; 
S_PRN=Head_data.SP3_PRN; 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%拟合阶数的确定degree 
% for i=1:EpochNum 
% %     if find(data_SP3X(i)==NAJ) 
% %          
% %     end 
% %     SP3_data(t).mm 
% %  
%      
% end 
 
 
save ('data_doucment','GCmin','GPS_Time','S_PRN' ,'data_SP3X','data_SP3Y','data_SP3Z','SP3clk');