- Timestamp:
- Feb 7, 2012, 8:34:31 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field.m
r382 r383 67 67 %% interpolation with new civ data 68 68 %if isfield(DataIn,'X_SubRange') 69 if strcmp(VelType,'filter1')||strcmp(VelType,'filter2')69 if isfield(DataIn,'SubRange') &&(strcmp(VelType,'filter1')||strcmp(VelType,'filter2')) 70 70 XMax=max(max(DataIn.SubRange(1,:,:))); 71 71 YMax=max(max(DataIn.SubRange(2,:,:))); -
trunk/src/civ_matlab.m
r382 r383 182 182 ind_good=1:numel(Data.Civ1_X); 183 183 end 184 % [SubRange,NbPoints,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF]185 184 [Data.Civ1_SubRange,Data.Civ1_NbSites,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=... 186 filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Threshold,Data.Patch1_Rho);185 filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Rho,Data.Patch1_Threshold); 187 186 Data.Civ1_U_Diff(ind_good)=Data.Civ1_U(ind_good)-Ures; 188 187 Data.Civ1_V_Diff(ind_good)=Data.Civ1_V(ind_good)-Vres; … … 226 225 DVDY=zeros(size(GridX)); 227 226 end 228 [NbSubDomain,xx]=size(Data.Civ1_X_SubRange);227 NbSubDomain=size(Data.Civ1_SubRange,3); 229 228 % get the guess from patch1 230 229 for isub=1:NbSubDomain 231 230 nbvec_sub=Data.Civ1_NbSites(isub); 232 ind_sel=find(GridX>=Data.Civ1_ X_SubRange(isub,1) & GridX<=Data.Civ1_X_SubRange(isub,2) & GridY>=Data.Civ1_Y_SubRange(isub,1) & GridY<=Data.Civ1_Y_SubRange(isub,2));231 ind_sel=find(GridX>=Data.Civ1_SubRange(1,1,isub) & GridX<=Data.Civ1_SubRange(1,2,isub) & GridY>=Data.Civ1_SubRange(2,1,isub) & GridY<=Data.Civ1_SubRange(2,2,isub)); 233 232 epoints = [GridX(ind_sel) GridY(ind_sel)];% coordinates of interpolation sites 234 ctrs= [Data.Civ1_X_tps(1:nbvec_sub,isub) Data.Civ1_Y_tps(1:nbvec_sub,isub)];%(=initial points) ctrs233 ctrs=Data.Civ1_Coord_tps(1:nbvec_sub,:,isub) ;%(=initial points) ctrs 235 234 nbval(ind_sel)=nbval(ind_sel)+1;% records the number of values for eacn interpolation point (in case of subdomain overlap) 236 235 EM = tps_eval(epoints,ctrs); … … 336 335 Data.Patch2_Threshold=Param.Patch2.MaxDiff; 337 336 Data.Patch2_SubDomain=Param.Patch2.SubdomainSize; 338 Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_X_SubRange','Civ2_Y_SubRange','Civ2_X_tps','Civ2_Y_tps','Civ2_U_tps','Civ2_V_tps','Civ2_Indices_tps'}]; 339 Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbSubDomain2','Two'},{'NbSubDomain2','Two'},... 340 {'NbVec2Sub','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'}}]; 337 Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_SubRange','Civ2_NbSites','Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps'}]; 338 Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbCoord','Two','NbSubDomain2'},{'NbSubDomain2'},... 339 {'NbVec2Sub','NbCoord','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'}}]; 340 % Data.ListVarName=[Data.ListVarName {'Civ2_U_Diff','Civ2_V_Diff','Civ2_X_SubRange','Civ2_Y_SubRange','Civ2_X_tps','Civ2_Y_tps','Civ2_U_tps','Civ2_V_tps','Civ2_Indices_tps'}]; 341 % Data.VarDimName=[Data.VarDimName {'NbVec2','NbVec2',{'NbSubDomain2','Two'},{'NbSubDomain2','Two'},... 342 % {'NbVec2Sub','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'Nbtps2','NbSubDomain2'},{'NbVec2Sub','NbSubDomain2'}}]; 341 343 nbvar=length(Data.ListVarName); 342 344 Data.VarAttribute{nbvar-1}.Role='vector_x'; … … 348 350 else 349 351 ind_good=1:numel(Data.Civ2_X); 350 end 352 end 351 353 [Data.Civ2_SubRange,Data.Civ2_NbSites,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures, Vres,tild,FFres]=... 352 filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold);354 filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold); 353 355 Data.Civ2_U_Diff(ind_good)=Data.Civ2_U(ind_good)-Ures; 354 356 Data.Civ2_V_Diff(ind_good)=Data.Civ2_V(ind_good)-Vres; -
trunk/src/uvmat.m
r382 r383 2216 2216 2217 2217 %% update tps in phys coordinates if needed 2218 if (strcmp(VelType,'filter1')||strcmp(VelType,'filter2'))&& isfield(Field{1},'U')&& isfield(Field{1},'V')2218 if (strcmp(VelType,'filter1')||strcmp(VelType,'filter2'))&& strcmp(FileType,'civdata')&&isfield(Field{1},'U')&& isfield(Field{1},'V') 2219 2219 [Field{1}.SubRange,Field{1}.NbSites,Field{1}.Coord_tps,Field{1}.U_tps,Field{1}.V_tps]=filter_tps([Field{1}.X Field{1}.Y],Field{1}.U,Field{1}.V,[],1500,0); 2220 2220 end … … 2225 2225 end 2226 2226 if numel(Field)==2 && ~test_keepdata_1 && isequal(FileType_1(1:3),'civ') && ~isequal(ParamOut_1.FieldName,'get_field...')%&&~isempty(FieldName_1) 2227 %update tps in phys coordinates if needed 2228 if (strcmp(VelType_1,'filter1')||strcmp(VelType_1,'filter2'))&& strcmp(FileType_1,'civdata')&&isfield(Field{2},'U')&& isfield(Field{2},'V') 2229 [Field{2}.SubRange,Field{2}.NbSites,Field{2}.Coord_tps,Field{2}.U_tps,Field{2}.V_tps]=filter_tps([Field{2}.X Field{2}.Y],Field{2}.U,Field{2}.V,[],1500,0); 2230 end 2227 2231 Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2},VelType_1); 2228 2232 end
Note: See TracChangeset
for help on using the changeset viewer.