uw_sb_unwrap_space_time.m

来自「StaMps最新测试版」· M 代码 · 共 95 行

M
95
字号
function []=uw_sb_unwrap_time(day,ifgday_ix,unwrap_method,time_win)%UW_SB_UNWRAP_SPACE_TIME smooth and unwrap phase diffs between neighboring data points in time%%   Andy Hooper, June 2007%%   ======================================================================%   07/2008 AH: Allow isolated images, not included in any interferogram%   ======================================================================ticdisp('Unwrapping in time-space...')uw=load('uw_grid');ui=load('uw_interp');n_ifg=uw.n_ifg;n_image=size(day,1);master_ix=find(day==0);day_pos_ix=find(day>0);[Y,I]=min(day(day_pos_ix));dph_noise=zeros(ui.n_edge,uw.n_ifg,'single');dph_space=((uw.ph(ui.edges(:,3),:).*conj(uw.ph(ui.edges(:,2),:))));ph_noise=angle(uw.ph.*conj(uw.ph_lowpass));clear uwdph_noise_sf=((ph_noise(ui.edges(:,3),:)-(ph_noise(ui.edges(:,2),:))));dph_space=dph_space./abs(dph_space);if strcmpi(unwrap_method,'2D')    save('uw_space_time','dph_space');elseif strcmpi(unwrap_method,'3D_NO_DEF')    dph_noise=angle(dph_space);    dph_space_uw=angle(dph_space);    save('uw_space_time','dph_space','dph_space_uw','dph_noise');else    G=zeros(n_ifg,n_image);    for i=1:n_ifg        G(i,ifgday_ix(i,1))=-1;        G(i,ifgday_ix(i,2))=1;    end    nzc_ix=sum(abs(G))~=0; % non-zero column index    day=day(nzc_ix);    G=G(:,nzc_ix);    n=size(G,2);            dph_space_series=[zeros(1,ui.n_edge);double(G(:,2:end))\double(angle(dph_space))'];    dph_smooth_series=zeros(size(G,2),ui.n_edge,'single');    for i1=1:n        time_diff_sq=(day(i1)-day).^2;        weight_factor=exp(-time_diff_sq/2/time_win^2);        weight_factor=weight_factor/sum(weight_factor);        dph_smooth_series(i1,:)=sum(dph_space_series.*repmat(weight_factor,1,ui.n_edge));    end    dph_smooth_ifg=(G*dph_smooth_series)';    dph_noise=angle(dph_space.*exp(-j*dph_smooth_ifg));    if strcmpi(unwrap_method,'3D_SMALL_DEF')|...       strcmpi(unwrap_method,'3D_QUICK')      not_small_ix=find(std(dph_noise,0,2)>1.3)';      fprintf('Ignoring %d edges. Elapsed time = %d s\n',length(not_small_ix),round(toc))      dph_noise(not_small_ix,:)=nan;    else      m_minmax=repmat([-pi,pi],5,1).*repmat([0.5;0.25;1;0.25;1],1,2);      anneal_opts=[1;15;0;0;0;0;0];      covm=cov((dph_noise_sf)); % estimate of covariance      W=chol(inv(covm)); % weighting matrix       not_small_ix=find(std(dph_noise,0,2)>1)';      fprintf('Performing more complex smoothing on %d edges. Elapsed time = %d s\n',length(not_small_ix),round(toc))      n_proc=0;      for i=not_small_ix        dph=angle(dph_space(i,:))';        dph_smooth_series(:,i)=uw_sb_smooth_unwrap(m_minmax,anneal_opts,G,W,dph,x);        n_proc=n_proc+1;        if round(n_proc/1000)==n_proc/1000            save('uw_unwrap_time','G','dph_space','dph_smooth_series');            fprintf('%d edges of %d reprocessed. Elapsed time = %d s\n',n_proc,length(not_small_ix),round(toc))        end      end      dph_smooth_ifg=(G*dph_smooth_series)';      dph_noise=angle(dph_space.*exp(-j*dph_smooth_ifg));    end    dph_space_uw=dph_smooth_ifg+dph_noise;    save('uw_space_time','dph_space','dph_space_uw','dph_noise','G','dph_smooth_series');end

⌨️ 快捷键说明

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