Changeset 185
- Timestamp:
- Jan 27, 2011, 9:50:39 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/imadoc2struct.m
r156 r185 103 103 else 104 104 for kblock=1:NbDtk+1 105 Time_val =Time_val+(kblock-1)*Dtk;106 s.Time=[s.Time;Time_val ];105 Time_val_k=Time_val+(kblock-1)*Dtk; 106 s.Time=[s.Time;Time_val_k]; 107 107 end 108 108 end -
trunk/src/plot_field.m
r179 r185 201 201 end 202 202 end 203 204 203 if isempty(errormsg) 205 204 set(haxes,'UserData',Data) … … 521 520 eval(['vec_U=Data.' Data.ListVarName{ivar_U} ';']) 522 521 eval(['vec_V=Data.' Data.ListVarName{ivar_V} ';']) 523 if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates or structured ones (then ivar_X and ivar_Y empty) 524 eval(['vec_X=Data.' Data.ListVarName{ivar_X} ';']) 525 eval(['vec_Y=Data.' Data.ListVarName{ivar_Y} ';']) 522 if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates or structured ones (then ivar_X and ivar_Y empty) 523 XName=Data.ListVarName{ivar_X}; 524 YName=Data.ListVarName{ivar_Y}; 525 eval(['vec_X=Data.' XName ';']) 526 eval(['vec_Y=Data.' YName ';']) 526 527 elseif numel(VarType.coord)==2 && ~isequal(VarType.coord,[0 0]);%coordinates defines by dimension variables 527 528 eval(['y=Data.' Data.ListVarName{VarType.coord(1)} ';']) … … 572 573 if isfield(Data,'VarAttribute') 573 574 if numel(Data.VarAttribute)>=ivar_X && isfield(Data.VarAttribute{ivar_X},'units') 574 x_units=[' (' Data.VarAttribute{ivar_X}.units ')'];575 x_units=[' (' Data.VarAttribute{ivar_X}.units ')']; 575 576 end 576 577 if numel(Data.VarAttribute)>=ivar_Y && isfield(Data.VarAttribute{ivar_Y},'units') 577 y_units=[' (' Data.VarAttribute{ivar_Y}.units ')'];578 y_units=[' (' Data.VarAttribute{ivar_Y}.units ')']; 578 579 end 579 580 end … … 587 588 if isfield(Data,'VarAttribute') 588 589 if numel(Data.VarAttribute)>=VarType.coord(2) && isfield(Data.VarAttribute{VarType.coord(2)},'units') 589 x_units= ['(' Data.VarAttribute{VarType.coord(2)}.units ')'];590 x_units=Data.VarAttribute{VarType.coord(2)}.units; 590 591 end 591 592 if numel(Data.VarAttribute)>=VarType.coord(1) && isfield(Data.VarAttribute{VarType.coord(1)},'units') 592 y_units= ['(' Data.VarAttribute{VarType.coord(1)}.units ')'];593 y_units=Data.VarAttribute{VarType.coord(1)}.units; 593 594 end 594 595 end … … 639 640 return 640 641 end 641 %x_label=[Data.ListVarName{ivar_X} '(' x_units ')']; 642 end 642 end 643 %define coordinates as CoordUnits, if not defined as attribute for each variable 644 if isfield(Data,'CoordUnit') 645 if isempty(x_units) 646 x_units=Data.CoordUnit; 647 end 648 if isempty(y_units) 649 y_units=Data.CoordUnit; 650 end 651 end 652 643 653 end 644 654 … … 795 805 end 796 806 % create new image if there no image handle is found 797 if isempty(hima) 798 % axes(haxes)% set haxes the current axes for image creation 799 % set(hfig,'CurrentAxes',haxes) % set haxes the current axes for image creation 807 if isempty(hima) 800 808 tag=get(haxes,'Tag'); 801 809 if MinA<MaxA … … 823 831 AxeData=[]; 824 832 end 825 % AxeData.A=A;826 % AxeData.AX=[AX(1) AX(end)];827 % AxeData.AY=[AY(1) AY(end)];828 833 test_ima=1; 829 834 … … 925 930 vec_C=ones(1,numel(vec_X)); 926 931 end 927 % AxeData.X=vec_X';928 % AxeData.Y=vec_Y';929 % AxeData.U=vec_U';930 % AxeData.V=vec_V';931 % AxeData.C=vec_C';932 % if isempty(ivar_F)933 % AxeData.F=[];934 % else935 % AxeData.F=vec_F';936 % end937 % if isempty(ivar_FF)938 % AxeData.FF=[];939 % else940 % AxeData.FF=vec_FF';941 % end942 932 943 933 %decimate by a factor 2 in vector mesh(4 in nbre of vectors) … … 999 989 delete(hvec); 1000 990 end 1001 % AxeData.X=[];1002 % AxeData.Y=[];1003 % AxeData.U=[];1004 % AxeData.V=[];1005 % AxeData.C=[];1006 % AxeData.W=[];1007 % AxeData.F=[];1008 % AxeData.FF=[];1009 % AxeData.Mesh=[];1010 991 PlotParamOut=rmfield(PlotParamOut,'Vectors'); 1011 992 end 1012 % if isfield(Data,'Z') 1013 % AxeData.Z=Data.Z;% A REVOIR 1014 % end 1015 listfields={'AY','AX','A','X','Y','U','V','C','W','F','FF'}; 1016 listdim={'AY','AX',{'AY','AX'},'nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors'}; 1017 Role={'coord_y','coord_x','scalar','coord_x','coord_y','vector_x','vector_y','scalar','vector_z','warnflag','errorflag'}; 993 994 %listfields={'AY','AX','A','X','Y','U','V','C','W','F','FF'}; 995 %listdim={'AY','AX',{'AY','AX'},'nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors'}; 996 %Role={'coord_y','coord_x','scalar','coord_x','coord_y','vector_x','vector_y','scalar','vector_z','warnflag','errorflag'}; 1018 997 %ind_select=[]; 1019 998 nbvar=0; 1020 % AxeData.ListVarName={}; 1021 % AxeData.VarDimName={}; 1022 % AxeData.VarAttribute={}; 1023 % for ilist=1:numel(listfields) 1024 % eval(['testvar=isfield(AxeData,listfields{ilist}) && ~isempty(AxeData.' listfields{ilist} ');']) 1025 % if testvar 1026 % nbvar=nbvar+1; 1027 % AxeData.ListVarName{nbvar}=listfields{ilist}; 1028 % AxeData.VarDimName{nbvar}=listdim{ilist}; 1029 % AxeData.VarAttribute{nbvar}.Role=Role{ilist}; 1030 % end 1031 % end 999 1032 1000 %store the coordinate extrema occupied by the field 1033 1001 test_lim=0; … … 1064 1032 end 1065 1033 set(haxes,'YDir','normal') 1066 set(get(haxes,'XLabel'),'String',[XName x_units]); 1067 set(get(haxes,'YLabel'),'String',[YName y_units]); 1034 set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']); 1035 set(get(haxes,'YLabel'),'String',[YName ' (' y_units ')']); 1036 PlotParamOut.x_units=x_units; 1037 PlotParamOut.y_units=y_units; 1068 1038 1069 1039 %------------------------------------------------------------------- … … 1132 1102 matyar=reshape(matyar,1,4*n(2)); 1133 1103 %draw the line or modify the existing ones 1134 hx = [x1;x2;x3];1135 hy = [y1;y2;y3];1104 % hx = [x1;x2;x3]; 1105 % hy = [y1;y2;y3]; 1136 1106 tri=reshape(1:3*length(uc),3,[])'; 1137 d = tri(:,[1 2 3 1])';1107 %d = tri(:,[1 2 3 1])'; 1138 1108 1139 1109 isn=isnan(colorlist(icolor,:));%test if color NaN
Note: See TracChangeset
for help on using the changeset viewer.