Changeset 866
- Timestamp:
- Feb 8, 2015, 7:26:02 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field_tps.m
r809 r866 121 121 [EMDX,EMDY] = tps_eval_dxy(Coord_interp(ind_sel,:),Coord_tps(1:nbvec_sub,:,isub));%kernels for calculating the spatial derivatives from tps 'sources' 122 122 end 123 % ListVar={};124 123 for ilist=1:length(FieldName) 125 % var_count=numel(ListVar); 124 %Operator{ilist}='';%default empty operator (vec, norm,...) 125 %r=regexp(FieldName{ilist},'(?<Operator>(^vec|^norm|^curl|^div|^strain))\((?<UName>.+),(?<VName>.+)\)$','names');% TODO, replace U, V 126 126 switch FieldName{ilist} 127 127 case 'vec(U,V)' -
trunk/src/plot_field.m
r864 r866 15 15 % 16 16 % OUPUT: 17 % PlotType: type of plot: 'text','line'(curve plot),'plane':2D view,'volume' 17 % PlotType: type of plot: 'text','line'(curve plot),'plane':2D view,'volume', or errormsg 18 18 % PlotParamOut: structure, representing the updated plotting parameters, in case of automatic scaling 19 19 % haxes: handle of the plotting axis, when a new figure is created. … … 251 251 %% display error message 252 252 if ~isempty(errormsg) 253 PlotType=errormsg; 253 254 msgbox_uvmat('ERROR', errormsg) 254 255 end … … 637 638 if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y') % vector components detected 638 639 if test_vec% a vector field has been already detected 639 errormsg='error in plot_field: attempt to plot two vector fields: to get the difference project on a plane with mode interp';640 errormsg='error in plot_field: attempt to plot two vector fields: to get the difference project on a plane with ProjMode= interp_lin or interp_tps'; 640 641 return 641 642 else -
trunk/src/proj_field.m
r864 r866 120 120 end 121 121 122 % %% take the difference of projected input fields if relevant 123 % [CellInfo,NbDim,errormsg]=find_field_cells(ProjData); 124 % ind_remove=zeros(size(ProjData.ListVarName)); 125 % ivar=[]; 126 % ivar_1=[]; 127 % for icell=1:numel(CellInfo) 128 % if ~isempty(CellInfo{icell}) 129 % % if two scalar are in the same cell 130 % if isfield(CellInfo{icell},'VarIndex_scalar') && numel(CellInfo{icell}.VarIndex_scalar)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_scalar(2)}.CheckSub; 131 % ivar=[ivar CellInfo{icell}.VarIndex_scalar(1)]; 132 % ivar_1=[ivar_1 CellInfo{icell}.VarIndex_scalar(2)]; 133 % end 134 % % if two vector u components are in the same cell 135 % if isfield(CellInfo{icell},'VarIndex_vector_x') && numel(CellInfo{icell}.VarIndex_vector_x)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_vector_x(2)}.CheckSub; 136 % ivar=[ivar CellInfo{icell}.VarIndex_vector_x(1)]; 137 % ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_x(2)]; 138 % end 139 % % if two vector v components are in the same cell 140 % if isfield(CellInfo{icell},'VarIndex_vector_y') && numel(CellInfo{icell}.VarIndex_vector_y)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub; 141 % ivar=[ivar CellInfo{icell}.VarIndex_vector_y(1)]; 142 % ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_y(2)]; 143 % end 144 % end 145 % end 146 % % subtract fields if relevant 147 % for imod=1:numel(ivar) 148 % VarName=ProjData.ListVarName{ivar(imod)}; 149 % VarName_1=ProjData.ListVarName{ivar_1(imod)}; 150 % ProjData.(VarName)=double(ProjData.(VarName))-double(ProjData.(VarName_1)); 151 % ind_remove(ivar_1(imod))=1; 152 % end 153 % ProjData.ListVarName(find(ind_remove))=[]; 154 % ProjData.VarDimName(find(ind_remove))=[]; 155 % ProjData.VarAttribute(find(ind_remove))=[]; 156 122 157 %----------------------------------------------------------------- 123 158 %project on a set of points … … 387 422 XName=FieldData.ListVarName{ivar_X}; 388 423 YName=FieldData.ListVarName{ivar_Y}; 389 coord_x=FieldData.( XName);390 coord_y=FieldData.( YName);424 coord_x=FieldData.(FieldData.ListVarName{ivar_X}); 425 coord_y=FieldData.(FieldData.ListVarName{ivar_Y}); 391 426 % image or 2D matrix 392 427 case 'grid' %case of structured coordinates … … 584 619 costheta=cos(theta(isegment)); 585 620 sintheta=sin(theta(isegment)); 586 % XIsegment=LineCoord(isegment,1)+DX_edge*costheta:DX*costheta:LineCoord(isegment+1,1));587 % YIsegment=(LineCoord(isegment,2)+DX_edge*sintheta:DX*sintheta:LineCoord(isegment+1,2));621 % XIsegment=LineCoord(isegment,1)+DX_edge*costheta:DX*costheta:LineCoord(isegment+1,1)); 622 % YIsegment=(LineCoord(isegment,2)+DX_edge*sintheta:DX*sintheta:LineCoord(isegment+1,2)); 588 623 NbInterval=floor((dlength(isegment)-DX_edge)/DX); 589 624 LastX=DX_edge+DX*NbInterval; … … 618 653 ProjData.ListVarName={}; 619 654 ProjData.VarDimName={}; 655 check_abscissa=0; 620 656 for icell=1:length(CellInfo) 621 657 % list of variable types to be projected … … 631 667 %% identify vector components 632 668 testU=isfield(CellInfo{icell},'VarIndex_vector_x') &&isfield(CellInfo{icell},'VarIndex_vector_y') ;% test for vectors 633 % if testU634 % UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x};635 % VName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y};636 % vector_x=FieldData.(UName);637 % vector_y=FieldData.(VName);638 % end669 % if testU 670 % UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}; 671 % VName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y}; 672 % vector_x=FieldData.(UName); 673 % vector_y=FieldData.(VName); 674 % end 639 675 %identify error flag 640 676 errorflag=0; %default, no error flag … … 654 690 %case of unstructured coordinates 655 691 case 'scattered' 656 XName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}; 657 YName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)}; 658 coord_x=FieldData.(XName); 659 coord_y=FieldData.(YName); 660 ProjData.ListVarName=[ProjData.ListVarName {XName}]; 661 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 662 nbvar=numel(ProjData.ListVarName); 663 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 692 % XName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}; 693 % YName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)}; 694 coord_x=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}); 695 coord_y=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)}); 696 664 697 if isequal(ProjMode,'projection') 665 698 if width==0 … … 667 700 return 668 701 end 702 ProjData.ListVarName=[ProjData.ListVarName {FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}}]; 703 ProjData.VarDimName=[ProjData.VarDimName {FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)}}]; 704 nbvar=numel(ProjData.ListVarName); 705 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 669 706 % select the (non false) input data located in the band of projection 670 707 flagsel=(errorflag==0) & ((coord_y -yinf(1))*(xinf(2)-xinf(1))>(coord_x-xinf(1))*(yinf(2)-yinf(1))) ... … … 678 715 Xproj=(coord_x-ObjectData.Coord(1,1))*costheta + (coord_y-ObjectData.Coord(1,2))*sintheta; %projection on the line 679 716 [Xproj,indsort]=sort(Xproj);% sort points by increasing absissa along the projection line 680 ProjData.( XName)=Xproj;717 ProjData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)})=Xproj; 681 718 for ivar=1:numel(VarIndex) 682 719 ProjData.(VarName{ivar})=FieldData.(VarName{ivar})(flagsel);% restrict vrtibles to the projection band 683 720 ProjData.(VarName{ivar})=ProjData.(VarName{ivar})(indsort);% sort by absissa 684 721 ProjData.ListVarName=[ProjData.ListVarName VarName{ivar}]; 685 ProjData.VarDimName=[ProjData.VarDimName { XName}];722 ProjData.VarDimName=[ProjData.VarDimName {FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}}]; 686 723 ProjData.VarAttribute{nbvar+ivar}=FieldData.VarAttribute{VarIndex(ivar)};%reproduce var attribute 687 724 if isfield(ProjData.VarAttribute{nbvar+ivar},'Role') … … 695 732 end 696 733 elseif isequal(ProjMode,'interp_lin') %filtering %linear interpolation: 734 if ~check_abscissa 735 XName=FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}; 736 ProjData.ListVarName=[ProjData.ListVarName {XName}]; 737 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 738 nbvar=numel(ProjData.ListVarName); 739 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 740 check_abscissa=1; % define abcissa only once 741 end 697 742 if ~isequal(errorflag,0) 698 743 VarName_FF=FieldData.ListVarName{CellInfo{icell}.VarIndex_errorflag}; … … 704 749 FieldData.(VarName)=FieldData.(VarName)(indsel); 705 750 end 706 end 751 end 707 752 [ProjVar,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_x coord_y],FieldData,CellInfo{icell}.FieldName,XI,YI); 708 753 ProjData.X=Xproj; 754 nbvar=numel(ProjData.ListVarName); 709 755 ProjData.ListVarName=[ProjData.ListVarName ListFieldProj]; 710 756 ProjData.VarAttribute=[ProjData.VarAttribute VarAttribute]; … … 713 759 if isfield(VarAttribute{ivar},'Role') 714 760 if strcmp(VarAttribute{ivar}.Role,'vector_x'); 715 ivar_U=ivar ;761 ivar_U=ivar+nbvar; 716 762 elseif strcmp(VarAttribute{ivar}.Role,'vector_y'); 717 ivar_V=ivar ;763 ivar_V=ivar+nbvar; 718 764 end 719 765 end … … 741 787 if isfield(VarAttribute{ivar},'Role') 742 788 if strcmp(VarAttribute{ivar}.Role,'vector_x'); 743 ivar_U=ivar ;789 ivar_U=ivar+nbvar; 744 790 elseif strcmp(VarAttribute{ivar}.Role,'vector_y'); 745 ivar_V=ivar ;791 ivar_V=ivar+nbvar; 746 792 end 747 793 end … … 861 907 end 862 908 end 863 end 909 end 864 910 if ~isempty(ivar_U) && ~isempty(ivar_V) 865 vector_x =ProjData.(ProjData.ListVarName{nbvar+ivar_U}); 866 ProjData.(ProjData.ListVarName{nbvar+ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{nbvar+ivar_V}); 867 ProjData.(ProjData.ListVarName{nbvar+ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{nbvar+ivar_V}); 868 end 869 911 vector_x =ProjData.(ProjData.ListVarName{ivar_U}); 912 ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V}); 913 ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V}); 914 end 870 915 end 871 916 … … 1230 1275 1231 1276 if isfield(CellInfo{icell},'CheckSub') && CellInfo{icell}.CheckSub && ~isempty(vector_x_proj) 1232 ProjData.(ListVarName{vector_x_proj})=ProjData.(ListVarName{vector_x_proj})-VarVal{1}; 1233 ProjData.(ListVarName{vector_y_proj})=ProjData.(ListVarName{vector_y_proj})-VarVal{2}; 1277 ProjData.(FieldData.ListVarName{vector_x_proj})=ProjData.(FieldData.ListVarName{vector_x_proj})-VarVal{1}; 1278 ProjData.(FieldData.ListVarName{vector_y_proj})=ProjData.(FieldData.ListVarName{vector_y_proj})-VarVal{2}; 1279 ListVarName={};% no new variable 1280 VarAttribute={}; 1234 1281 else 1235 1282 VarDimName=cell(size(ListVarName)); … … 1243 1290 end 1244 1291 end 1292 vector_x_proj=CellInfo{icell}.VarIndex_vector_x; %preserve for next cell 1293 vector_y_proj=CellInfo{icell}.VarIndex_vector_y; %preserve for next cell 1245 1294 end 1246 1295 … … 1491 1540 ListVarName=[ListVarName VarName]; 1492 1541 VarAttribute{length(ListVarName)}=FieldData.VarAttribute{ivar}; %reproduce the variable attributes 1493 eval(['ProjData.' VarName '=squeeze(FieldData.' VarName '(iz,:,:));'])% select the z index iz1542 ProjData.(VarName)=squeeze(FieldData.(VarName)(iz,:,:));% select the z index iz 1494 1543 %TODO : do a vertical average for a thick plane 1495 1544 if test_interp(2) || test_interp(3) 1496 eval(['ProjData.' VarName '=interp2(Coord{3},Coord{2},ProjData.' VarName ',Coord_x,Coord_y'');'])1545 ProjData.(VarName)=interp2(Coord{3},Coord{2},ProjData.(VarName),Coord_x,Coord_y); 1497 1546 end 1498 1547 end … … 1535 1584 if ~isempty(ivar_W) 1536 1585 WName=FieldData.ListVarName{ivar_W}; 1537 eval(['ProjData.' VName '=ProjData.' VName '+ ProjData.' WName '*sin(Theta);'])%1538 eval(['ProjData.' WName '=NormVec_X*ProjData.' UName '+ NormVec_Y*ProjData.' VName '+ NormVec_Z* ProjData.' WName ';']);1586 ProjData.(VName)=ProjData.(VName)+ ProjData.(WName)*sin(Theta);% 1587 ProjData.(WName)=NormVec_X*ProjData.(UName)+ NormVec_Y*ProjData.(VName)+ NormVec_Z* ProjData.(WName); 1539 1588 end 1540 1589 end -
trunk/src/sub_field.m
r864 r866 125 125 126 126 %% look for coordinates common to Field in Field_1 127 ind_remove= zeros(size(Field_1.ListVarName));127 ind_remove=false(size(Field_1.ListVarName)); 128 128 % loop on the variables of the second field Field_1 129 129 for ilist=1:numel(Field_1.ListVarName) 130 130 % case of variable with a single dimension 131 if ~isempty( regexp(Field_1.VarAttribute{ilist}.Role,'^coord'))131 if ~isempty(Field_1.VarAttribute{ilist}) && ~isempty(regexp(Field_1.VarAttribute{ilist}.Role,'^coord'))% if variable with Role coord... is found. 132 132 OldDimName=Field_1.VarDimName{ilist}; 133 133 if ischar(OldDimName), OldDimName={OldDimName}; end% transform char string to cell if relevant … … 147 147 end 148 148 end 149 Field_1.ListVarName(find(ind_remove))=[];%removes the redondent coordinate 150 Field_1.VarDimName(find(ind_remove))=[]; 151 Field_1.VarAttribute(find(ind_remove))=[]; 149 if ~isempty(find(ind_remove, 1)) 150 Field_1.ListVarName(ind_remove)=[];%removes the redondent coordinate 151 Field_1.VarDimName(ind_remove)=[]; 152 Field_1.VarAttribute(ind_remove)=[]; 153 end 152 154 153 155 %% append the other variables of the second field, modifying their name if needed 154 ListVarName New=Field_1.ListVarName;155 check_rename=zeros(size(ListVarNameNew));156 check_re move=zeros(size(ListVarNameNew));157 for ilist=1:numel(ListVarNameNew) 158 VarName=Field_1.ListVarName{ilist}; 159 ind_prev=find(strcmp(ListVarName New{ilist},Field.ListVarName),1);% look for duplicated variable name156 ListVarNameSub=Field_1.ListVarName; 157 ListVarNameNew=ListVarNameSub; 158 check_rename=zeros(size(ListVarNameSub)); 159 check_remove=zeros(size(ListVarNameSub)); 160 for ilist=1:numel(ListVarNameSub) 161 ind_prev=find(strcmp(ListVarNameSub{ilist},Field.ListVarName),1);% look for duplicated variable name 160 162 if ~isempty(ind_prev)% variable name exists in Field 161 % check_rename(ilist)=0; 162 check_remove(ilist)=1; 163 if isfield(Field_1.VarAttribute{ilist},'Role')&& ismember(Field_1.VarAttribute{ilist}.Role,{'scalar','vector_x','vector_y'}) 164 ListVarNameNew{ilist}=[ListVarNameNew{ilist} '_1']; 165 check_rename(ilist)=1; 166 end 167 end 168 SubData.ListVarName=[SubData.ListVarName ListVarNameNew{ilist}]; 169 SubData.VarDimName=[SubData.VarDimName Field_1.VarDimName(ilist)]; 170 Field_1.VarAttribute{ilist}.CheckSub=1; 171 SubData.VarAttribute=[SubData.VarAttribute Field_1.VarAttribute{ilist}]; 172 SubData.(ListVarNameNew{ilist})=Field_1.(VarName);% teke the values of the old variable for the newly named one 173 %SubData.VarAttribute=[SubData.VarAttribute Field_1.VarDimName(ilist)]; 174 end 175 176 %% replace variable name in field expression FieldName, e.g. 'norm(U,V)'-> 'norm(U_1,V_1)' 177 for ilist=1:numel(ListVarNameNew) 178 if check_rename(ilist)&& isfield(Field_1.VarAttribute{ilist},'FieldName') 179 for ivar=1:numel(find(check_rename)) 180 Field_1.VarAttribute{ilist}.FieldName=regexprep_r(Field_1.VarAttribute{ilist}.FieldName,... 181 Field_1.ListVarName{ivar},ListVarNameNew{ivar}); 182 end 183 end 184 SubData.VarAttribute=[SubData.VarAttribute Field_1.VarAttribute(ilist)]; 185 SubData.VarAttribute{end}.CheckSub=1;% mark that the field needs to be substracted as an attribute 186 end 163 if isfield(Field_1.VarAttribute{ilist},'Role')&&... 164 ismember(Field_1.VarAttribute{ilist}.Role,{'coord_x','coord_y','scalar','vector_x','vector_y','errorflag'}) 165 ListVarNameNew{ilist}=[ListVarNameSub{ilist} '_1'];%modify the name of the second variable 166 check_rename(ilist)=1; 167 else 168 check_remove(ilist)=1;% variable will be removed 169 end 170 end 171 end 172 ListVarNameSub=ListVarNameSub(~check_remove); %eliminate removed variables from the list of the second field 173 ListVarNameNew=ListVarNameNew(~check_remove); % %list of renaimed varaibles corresponding to ListVarNameSub 174 VarDimNameSub=Field_1.VarDimName(~check_remove); 175 VarAttributeSub=Field_1.VarAttribute(~check_remove); 176 check_rename=check_rename(~check_remove); 177 178 % apply the variable renaming and mark the second field variables with the attribute .CheckSub 179 for ilist=1:numel(ListVarNameSub) 180 SubData.(ListVarNameNew{ilist})=Field_1.(ListVarNameSub{ilist});% copy the variable content to the new name 181 if check_rename(ilist) 182 % replace name in field expression FieldName, e.g. 'norm(U,V)'-> 'norm(U_1,V_1)' 183 if isfield(VarAttributeSub{ilist},'FieldName') 184 for ivar=1:numel(find(check_rename)) 185 VarAttributeSub{ilist}.FieldName=regexprep_r(VarAttributeSub{ilist}.FieldName,... 186 ListVarNameSub{ivar},ListVarNameNew{ivar}); 187 end 188 end 189 end 190 VarAttributeSub{ilist}.CheckSub=1;% mark that the field needs to be substracted as an attribute 191 end 192 193 SubData.ListVarName=[SubData.ListVarName ListVarNameNew]; 194 SubData.VarDimName=[SubData.VarDimName VarDimNameSub]; 195 SubData.VarAttribute=[SubData.VarAttribute VarAttributeSub]; 187 196 188 197 %% substrat fields when possible 189 198 [CellInfo,NbDim,errormsg]=find_field_cells(SubData); 190 ind_remove= zeros(size(SubData.ListVarName));199 ind_remove=false(size(SubData.ListVarName)); 191 200 ivar=[]; 192 201 ivar_1=[]; 193 202 for icell=1:numel(CellInfo) 194 203 if ~isempty(CellInfo{icell}) 204 % if two scalar are in the same cell 195 205 if isfield(CellInfo{icell},'VarIndex_scalar') && numel(CellInfo{icell}.VarIndex_scalar)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_scalar(2)}.CheckSub; 196 206 ivar=[ivar CellInfo{icell}.VarIndex_scalar(1)]; 197 207 ivar_1=[ivar_1 CellInfo{icell}.VarIndex_scalar(2)]; 198 208 end 209 % if two vector u components are in the same cell 199 210 if isfield(CellInfo{icell},'VarIndex_vector_x') && numel(CellInfo{icell}.VarIndex_vector_x)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_x(2)}.CheckSub; 200 211 ivar=[ivar CellInfo{icell}.VarIndex_vector_x(1)]; 201 212 ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_x(2)]; 202 213 end 214 % if two vector v components are in the same cell 203 215 if isfield(CellInfo{icell},'VarIndex_vector_y') && numel(CellInfo{icell}.VarIndex_vector_y)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub; 204 216 ivar=[ivar CellInfo{icell}.VarIndex_vector_y(1)]; 205 217 ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_y(2)]; 206 218 end 207 end 208 end 219 % merge the error flags if needed 220 if isfield(CellInfo{icell},'VarIndex_errorflag') && numel(CellInfo{icell}.VarIndex_errorflag)==2 && SubData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub; 221 ivar_flag=CellInfo{icell}.VarIndex_errorflag(1); 222 ivar_flag_1=CellInfo{icell}.VarIndex_errorflag(2); 223 VarName=SubData.ListVarName{ivar_flag}; 224 VarName_1=SubData.ListVarName{ivar_flag_1}; 225 SubData.(VarName)=SubData.(VarName)~=0 | SubData.(VarName_1)~=0;% combine the error flags of the two fields 226 ind_remove(ivar_flag_1)=1; 227 end 228 end 229 end 230 % subtract fields if relevant 209 231 for imod=1:numel(ivar) 210 232 VarName=SubData.ListVarName{ivar(imod)}; … … 213 235 ind_remove(ivar_1(imod))=1; 214 236 end 215 SubData.ListVarName( find(ind_remove))=[];216 SubData.VarDimName( find(ind_remove))=[];217 SubData.VarAttribute( find(ind_remove))=[];237 SubData.ListVarName(ind_remove)=[]; 238 SubData.VarDimName(ind_remove)=[]; 239 SubData.VarAttribute(ind_remove)=[]; 218 240 219 241 function OutputCell=regexprep_r(InputCell,search_string,new_string) -
trunk/src/transform_field/phys.m
r836 r866 116 116 return %bad calib parameter input 117 117 end 118 if ~(isfield(DataIn_1,'CoordUnit')&& strcmp(DataIn_1.CoordUnit,'pixel'))119 return % transform only fields in pixel coordinates120 end118 if (isfield(DataIn_1,'CoordUnit')&& strcmp(DataIn_1.CoordUnit,'pixel')) 119 % return % transform only fields in pixel coordinates 120 % end 121 121 DataOut_1=phys_1(DataOut_1,Calib{2},ZIndex); 122 end 122 123 if isfield(Calib{1},'SliceCoord') 123 124 if ~(isfield(Calib{2},'SliceCoord') && isequal(Calib{2}.SliceCoord,Calib{1}.SliceCoord)) -
trunk/src/uvmat.m
r864 r866 3283 3283 if ischar(list_fields),list_fields={list_fields};end 3284 3284 FieldName_1= list_fields{get(handles.FieldName_1,'Value')}; % selected field 3285 if ~strcmp(FieldName ,'get_field...')3285 if ~strcmp(FieldName_1,'get_field...') 3286 3286 if get(handles.FixVelType,'Value') 3287 3287 VelTypeList=get(handles.VelType_1,'String'); … … 3289 3289 end 3290 3290 end 3291 if strcmp(FieldName_1,'velocity')&& strcmp(get(handles.ColorCode,'Visible'),'on') 3291 if isempty(FieldName_1) 3292 FieldName_1=FieldName;% if blank reproduce the field name of the first field 3293 end 3294 if ~isempty(regexp(FieldName_1,'^vel'))&& strcmp(get(handles.ColorCode,'Visible'),'on') 3292 3295 list_code=get(handles.ColorCode,'String');% list menu fields 3293 3296 index_code=get(handles.ColorCode,'Value');% selected string index … … 3759 3762 else 3760 3763 [PlotType,PlotParamOut]=plot_field(ObjectData,haxes(imap),PlotParam{imap}); 3764 if ~isempty(regexp(PlotType,'^error')) 3765 if ~isempty(regexp(PlotType,'attempt to plot two vector fields')) 3766 set(handles.CheckEditObject,'Value',1) 3767 CheckEditObject_Callback([], [], handles) 3768 hset_object=findobj(allchild(0),'Tag','set_object');%find the GUI set_object 3769 hhset_object=guidata(hset_object);% 3770 set(hhset_object.ProjMode,'Value',2); 3771 set_object('ProjMode_Callback',hset_object,[],hhset_object); 3772 end 3773 % errormsg=PlotType; 3774 return 3775 end 3761 3776 if imap==1 3762 3777 errormsg=fill_GUI(PlotParamOut,handles.uvmat); … … 4459 4474 REFRESH_Callback(hObject, eventdata, handles) 4460 4475 end 4461 4462 % set_veltype_display(0) % no veltype display4463 % hget_field=findobj(allchild(0),'name','get_field_1');4464 % if ~isempty(hget_field)4465 % delete(hget_field)4466 % end4467 % hget_field=get_field(FileName_1);4468 % set(hget_field,'name','get_field_1')4469 % hhget_field=guidata(hget_field);4470 % set(hhget_field.list_fig,'Value',1)4471 % set(hhget_field.list_fig,'String',{'uvmat'})4472 % if check_new4473 % UvData.FileType{2}=UvData.FileType{1};4474 % set(handles.FileIndex_1,'String',get(handles.FileIndex,'String'))4475 % set(handles.uvmat,'UserData',UvData)4476 % end4477 4476 case 'image' 4478 4477 %% look for image corresponding to civ data
Note: See TracChangeset
for help on using the changeset viewer.