Changeset 247
- Timestamp:
- Apr 29, 2011, 6:44:35 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field.m
r246 r247 105 105 EM = tps_eval(epoints,ctrs); 106 106 case{'vort','div'} 107 EMDXY= tps_eval_dxy(epoints,ctrs);%2D matrix of distances between extrapolation points epoints and spline centres (=site points) ctrs107 [EMDX,EMDY] = tps_eval_dxy(epoints,ctrs);%2D matrix of distances between extrapolation points epoints and spline centres (=site points) ctrs 108 108 109 109 end … … 132 132 % DataIn.V_tps(nbvec_sub+2,isub)=0;% X coefficient suppressed for x wise derivatives 133 133 % DataIn.U_tps(nbvec_sub+3,isub)=0;% Y coefficient suppressed for x wise derivatives 134 DataOut.vort(ind_sel)=DataOut.vort(ind_sel)+EMD XY(:,:,2) *DataIn.U_tps(1:nbvec_sub+3,isub)-EMDXY(:,:,1)*DataIn.V_tps(1:nbvec_sub+3,isub);134 DataOut.vort(ind_sel)=DataOut.vort(ind_sel)+EMDY *DataIn.U_tps(1:nbvec_sub+3,isub)-EMDX *DataIn.V_tps(1:nbvec_sub+3,isub); 135 135 case 'div' 136 136 ListFields={'div'}; … … 142 142 % DataIn.V_tps(nbvec_sub+2,isub)=0;% X coefficient suppressed for x wise derivatives 143 143 % DataIn.U_tps(nbvec_sub+3,isub)=0;% Y coefficient suppressed for x wise derivatives 144 DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX Y(:,:,1)*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDXY(:,:,2)*DataIn.V_tps(1:nbvec_sub+3,isub);144 DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX*DataIn.U_tps(1:nbvec_sub+3,isub)+EMDY *DataIn.V_tps(1:nbvec_sub+3,isub); 145 145 end 146 146 end -
trunk/src/plot_field.m
r238 r247 106 106 % introduce PlotParam.Hold: 'on' or 'off' (for curves) 107 107 %default output 108 108 109 if ~exist('PlotParam','var'),PlotParam=[];end; 109 110 if ~exist('PosColorbar','var'),PosColorbar=[];end; -
trunk/src/read_civxdata.m
r236 r247 50 50 errormsg=''; 51 51 DataTest=nc2struct(filename,'ListGlobalAttribute','Conventions'); 52 if isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format 52 if isfield(DataTest,'Txt') 53 errormsg=DataTest.Txt; 54 elseif isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format 53 55 [Field,VelTypeOut]=read_civdata(filename,FieldNames,VelType); 54 56 return -
trunk/src/tps_eval_dxy.m
r246 r247 11 11 % N centres, with s=space dimension, DMXY(:,:,k) gives the derivatives 12 12 % along dimension k (=x, y,z) after multiplication by the N+1+s tps sources. 13 function DMXY= tps_eval_dxy(dsites,ctrs)13 function [DMX,DMY] = tps_eval_dxy(dsites,ctrs) 14 14 %% matrix declarations 15 15 [M,s] = size(dsites); [N,s] = size(ctrs); 16 Dsites=zeros(M,N ,s);16 Dsites=zeros(M,N); 17 17 DM = zeros(M,N); 18 DMXY = zeros(M,N+1+s,s);18 % DMXY = zeros(M,N+1+s); 19 19 20 20 %% Accumulate sum of squares of coordinate differences … … 24 24 % Ctrs, consisting of M identical rows (each containing 25 25 % the d-th coordinate of the N centers) 26 for d=1:s27 [Dsites(:,:,d),Ctrs] = ndgrid(dsites(:,d),ctrs(:,d));%d coordinates of interpolation points (Dsites) and initial points (Ctrs)28 DM = DM + (Dsites(:,:,d)-Ctrs).^2;% add d component squared29 end30 26 31 %% calculate mtrix of tps derivatives 32 DM(DM~=0) = log(DM)+1; %=2 log(r)+1 derivative of the tps r^2 log(r) 33 for d=1:s 34 DMXY(:,1:N,d)=Dsites(:,:,d).*DM; 35 DMXY(:,N+1+d,d)=1;% effect of mean gradient 36 end 27 [Dsites,Ctrs] = ndgrid(dsites(:,1),ctrs(:,1));%d coordinates of interpolation points (Dsites) and initial points (Ctrs) 28 DX=Dsites-Ctrs; 29 [Dsites,Ctrs] = ndgrid(dsites(:,2),ctrs(:,2));%d coordinates of interpolation points (Dsites) and initial points (Ctrs) 30 DY=Dsites-Ctrs; 31 DM = DX.*DX + DY.*DY;% add d component squared 32 33 %% calculate matrix of tps derivatives 34 DM(DM~=0) = log(DM(DM~=0))+1; %=2 log(r)+1 derivative of the tps r^2 log(r) 35 36 DMX=[DX.*DM zeros(M,1) ones(M,1) zeros(M,1)];% effect of mean gradient 37 DMY=[DY.*DM zeros(M,1) ones(M,1) zeros(M,1)];% effect of mean gradient 38 -
trunk/src/uvmat.m
r246 r247 2147 2147 ParamIn.GUIName='get_field'; 2148 2148 [Field{1},ParamOut,errormsg] = read_field(ObjectName,FileType,ParamIn,num_i1); 2149 Field{1} 2149 2150 if ~isempty(errormsg) 2150 2151 errormsg=['error in reading ' filename ': ' errormsg]; … … 2462 2463 end 2463 2464 else 2464 errormsg='input field coordinates not defined';2465 return2465 % errormsg='input field coordinates not defined'; 2466 % return 2466 2467 end 2467 2468 if NbDim==3 … … 2593 2594 2594 2595 %% Plot the projections on the selected projection objects 2595 2596 'PLOT' 2596 2597 % main projection object (uvmat display) 2597 2598 list_object=get(handles.list_object_1,'String');
Note: See TracChangeset
for help on using the changeset viewer.