- Timestamp:
- Apr 23, 2014, 4:57:58 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r747 r748 159 159 set(handles.vector_x,'String',Field.Display.ListVarName)% fill the menu of x vector components 160 160 set(handles.vector_y,'String',Field.Display.ListVarName)% fill the menu of y vector components 161 set(handles.vector_z,'String', Field.Display.ListVarName)% fill the menu of y vector components161 set(handles.vector_z,'String',[{''} Field.Display.ListVarName])% fill the menu of y vector components 162 162 set(handles.vec_color,'String',[{''} Field.Display.ListVarName])% fill the menu of y vector components 163 163 set(handles.scalar,'Value',1)% fill the menu of y vector components … … 165 165 set(handles.ordinate,'Value',1)% fill the menu of y vector components 166 166 set(handles.ordinate,'String',Field.Display.ListVarName)% fill the menu of y coordinate for 1D plots 167 if isfield(Field,'Conventions')&& strcmp(Field.Conventions,'uvmat/civdata') 167 checkseries=0; 168 if isfield(ParamIn,'SeriesInput') && ParamIn.SeriesInput 169 set(handles.FieldOption,'value',1) 170 set(handles.FieldOption,'String',{'scalar'})% case of call by series, only scalar 171 checkseries=1; 172 set(handles.scalar,'Max',2) 173 elseif isfield(Field,'Conventions')&& strcmp(Field.Conventions,'uvmat/civdata') 168 174 set(handles.FieldOption,'String',{'1D plot';'scalar';'vectors';'civdata...'})% provides the possibility to come back to civdata 175 set(handles.scalar,'Max',1) 169 176 else 170 177 set(handles.FieldOption,'String',{'1D plot';'scalar';'vectors'}) 171 end 172 if Field.MaxDim>=2 % case of 2D (or 3D) fields 178 set(handles.scalar,'Max',1) 179 end 180 if Field.MaxDim>=2 && ~checkseries% case of 2D (or 3D) fields 173 181 check_vec_input=0; 174 182 if isfield(ParamIn,'vector_x')&& isfield(ParamIn,'vector_y') … … 204 212 set(handles.dimensions,'String',Tabchar) 205 213 end 206 set(handles.variables,'Value',1)207 set(handles.variables,'String',[{'*'} Field.ListVarName])208 variables_Callback(handles.variables,[], handles)% list the global attributes209 214 210 215 %% fill menus for coordinates and time … … 246 251 end 247 252 Check3D_Callback(hObject, eventdata, handles) 253 set(handles.variables,'Value',1) 254 set(handles.variables,'String',[{'*'} Field.ListVarName]) 255 variables_Callback(handles.variables,[], handles)% list the global attributes 248 256 drawnow 249 257 uiwait(handles.get_field); … … 311 319 else 312 320 list_var=get(handles.variables,'String'); 321 if index>numel(list_var) 322 return 323 end 313 324 var_select=list_var{index}; 314 325 set(handles.attributes_txt,'String', ['attributes of ' var_select]) … … 329 340 end 330 341 end 331 332 342 end 333 343 if ~isempty(Tabcell) -
trunk/src/nc2struct.m
r747 r748 183 183 end 184 184 ListVarName=ListVarName(:,logical(check_keep)); 185 sizvar=size(ListVarName); 186 var_index=zeros(1,sizvar(2));%default 187 if sizvar(1)>1 %multiple choice of variable ranked by order of priority 188 for iline=1:sizvar(1) 185 if size(ListVarName,1)>1 %multiple choice of variable ranked by order of priority 186 for iline=1:size(ListVarName,1) 189 187 search_index=find(strcmp(ListVarName{iline,1},ListVarNameNetcdf),1);%look for the first variable name in the list of netcdf variables 190 188 if ~isempty(search_index) … … 206 204 ListVarName=[ListVarName {TimeVarName}]; 207 205 end 206 var_index=zeros(1,size(ListVarName,2));%default list of variable indices 208 207 for ivar=1:size(ListVarName,2) 209 208 search_index=find(strcmp(ListVarName{iline,ivar},ListVarNameNetcdf),1);%look for the variable name in the list of netcdf file -
trunk/src/plot_field.m
r735 r748 45 45 % PlotParam: structure containing the parameters for plotting, as read on the uvmat or view_field GUI (by function 'read_GUI.m'). 46 46 % Contains three substructures: 47 % . Coordinates: coordinate parameters:47 % .Axes: coordinate parameters: 48 48 % .CheckFixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits 49 % . Coordinates.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales.50 % . Coordinates.AspectRatio: imposed aspect ratio y/x of axis unit plots49 % .Axes.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales. 50 % .Axes.AspectRatio: imposed aspect ratio y/x of axis unit plots 51 51 % --scalars-- 52 52 % .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default … … 103 103 PlotType='text'; %default 104 104 if ~isfield(PlotParam,'Coordinates') 105 PlotParam. Coordinates=[];105 PlotParam.Axes=[]; 106 106 if isfield(Data,'CoordUnit') 107 PlotParam. Coordinates.CheckFixAspectRatio=1;108 PlotParam. Coordinates.AspectRatio=1; %set axes equal by default if CoordUnit is defined107 PlotParam.Axes.CheckFixAspectRatio=1; 108 PlotParam.Axes.AspectRatio=1; %set axes equal by default if CoordUnit is defined 109 109 end 110 110 end … … 160 160 161 161 %% set axes properties 162 if isfield(PlotParamOut. Coordinates,'CheckFixLimits') && isequal(PlotParamOut.Coordinates.CheckFixLimits,1) %adjust the graph limits162 if isfield(PlotParamOut.Axes,'CheckFixLimits') && isequal(PlotParamOut.Axes.CheckFixLimits,1) %adjust the graph limits 163 163 set(haxes,'XLimMode', 'manual') 164 164 set(haxes,'YLimMode', 'manual') … … 193 193 CheckHold= PlotParam.CheckHold; 194 194 end 195 PlotParamOut. Coordinates=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Coordinates,CheckHold);%195 PlotParamOut.Axes=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Axes,CheckHold);% 196 196 if testzoomaxes 197 [zoomaxes,PlotParamOut. Coordinates]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Coordinates,CheckHold);197 [zoomaxes,PlotParamOut.Axes]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Axes,CheckHold); 198 198 AxeData.ZoomAxes=zoomaxes; 199 199 end … … 897 897 end 898 898 899 if isfield(PlotParam. Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)899 if isfield(PlotParam.Axes,'CheckFixAspectRatio') && isequal(PlotParam.Axes.CheckFixAspectRatio,1) 900 900 set(haxes,'DataAspectRatioMode','manual') 901 if isfield(PlotParam. Coordinates,'AspectRatio')902 set(haxes,'DataAspectRatio',[PlotParam. Coordinates.AspectRatio 1 1])901 if isfield(PlotParam.Axes,'AspectRatio') 902 set(haxes,'DataAspectRatio',[PlotParam.Axes.AspectRatio 1 1]) 903 903 else 904 904 set(haxes,'DataAspectRatio',[1 1 1]) … … 1167 1167 MinY=[]; 1168 1168 MaxY=[]; 1169 fix_lim=isfield(PlotParam. Coordinates,'CheckFixLimits') && PlotParam.Coordinates.CheckFixLimits;1169 fix_lim=isfield(PlotParam.Axes,'CheckFixLimits') && PlotParam.Axes.CheckFixLimits; 1170 1170 if fix_lim 1171 if isfield(PlotParam. Coordinates,'MinX')&&isfield(PlotParam.Coordinates,'MaxX')&&isfield(PlotParam.Coordinates,'MinY')&&isfield(PlotParam.Coordinates,'MaxY')1172 MinX=PlotParam. Coordinates.MinX;1173 MaxX=PlotParam. Coordinates.MaxX;1174 MinY=PlotParam. Coordinates.MinY;1175 MaxY=PlotParam. Coordinates.MaxY;1171 if isfield(PlotParam.Axes,'MinX')&&isfield(PlotParam.Axes,'MaxX')&&isfield(PlotParam.Axes,'MinY')&&isfield(PlotParam.Axes,'MaxY') 1172 MinX=PlotParam.Axes.MinX; 1173 MaxX=PlotParam.Axes.MaxX; 1174 MinY=PlotParam.Axes.MinY; 1175 MaxY=PlotParam.Axes.MaxY; 1176 1176 end %else PlotParamOut.MinX =PlotParam.MinX... 1177 1177 else … … 1194 1194 end 1195 1195 end 1196 PlotParamOut. Coordinates.MinX=MinX;1197 PlotParamOut. Coordinates.MaxX=MaxX;1198 PlotParamOut. Coordinates.MinY=MinY;1199 PlotParamOut. Coordinates.MaxY=MaxY;1196 PlotParamOut.Axes.MinX=MinX; 1197 PlotParamOut.Axes.MaxX=MaxX; 1198 PlotParamOut.Axes.MinY=MinY; 1199 PlotParamOut.Axes.MaxY=MaxY; 1200 1200 if MaxX>MinX 1201 1201 set(haxes,'XLim',[MinX MaxX]);% set x limits of frame in axes coordinates … … 1207 1207 set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']); 1208 1208 set(get(haxes,'YLabel'),'String',[YName ' (' y_units ')']); 1209 PlotParamOut. Coordinates.x_units=x_units;1210 PlotParamOut. Coordinates.y_units=y_units;1211 end 1212 if isfield(PlotParam,'Coordinates') && isfield(PlotParam. Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)1209 PlotParamOut.Axes.x_units=x_units; 1210 PlotParamOut.Axes.y_units=y_units; 1211 end 1212 if isfield(PlotParam,'Coordinates') && isfield(PlotParam.Axes,'CheckFixAspectRatio') && isequal(PlotParam.Axes.CheckFixAspectRatio,1) 1213 1213 set(haxes,'DataAspectRatioMode','manual') 1214 if isfield(PlotParam. Coordinates,'AspectRatio')1215 set(haxes,'DataAspectRatio',[PlotParam. Coordinates.AspectRatio 1 1])1214 if isfield(PlotParam.Axes,'AspectRatio') 1215 set(haxes,'DataAspectRatio',[PlotParam.Axes.AspectRatio 1 1]) 1216 1216 end 1217 1217 else -
trunk/src/proj_field.m
r747 r748 1360 1360 VarDimName=[VarDimName {DimCell}]; 1361 1361 VarAttribute{length(ListVarName)}=FieldData.VarAttribute{ivar}; %reproduce the variable attributes 1362 eval(['ProjData.' VarName '=permute(FieldData.' VarName ',ind_new);'])% permute x and z indices for 90 degree rotation1363 eval(['ProjData.' VarName '=squeeze(ProjData.' VarName '(iz,:,:));'])% select the z index iz1362 ProjData.(VarName)=permute(FieldData.(VarName),ind_new);% permute x and z indices for 90 degree rotation 1363 ProjData.(VarName)=squeeze(ProjData.(VarName)(iz,:,:));% select the z index iz 1364 1364 end 1365 1365 ProjData.(AYName)=[Ybound(1) Ybound(2)]; %record the new (projected ) y coordinates … … 1390 1390 end 1391 1391 end 1392 ProjData.(AYName)=Coord{NbDim-1}(1)+DY*(YIndexRange-1); %record the new (projected ) y coordinates 1393 ProjData.(AXName)=Coord{NbDim}(1)+DX*(XIndexRange-1); %record the new (projected ) x coordinates 1392 if testXMax 1393 ProjData.(AXName)=Coord{NbDim}(1)+DX*(XIndexRange-1); %record the new (projected ) x coordinates 1394 else 1395 ProjData.(AXName)=FieldData.(AXName); 1396 end 1397 if testYMax 1398 ProjData.(AYName)=Coord{NbDim-1}(1)+DY*(YIndexRange-1); %record the new (projected ) x coordinates 1399 else 1400 ProjData.(AYName)=FieldData.(AYName); 1401 end 1394 1402 end 1395 1403 end -
trunk/src/read_field.m
r747 r748 26 26 27 27 function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num) 28 %% default output and check input 28 29 Field=[]; 29 30 if ~exist('num','var') … … 59 60 %% distingush different input file types 60 61 switch FileType 61 case 'civdata' 62 case 'civdata'% new format for civ results 62 63 [Field,ParamOut.VelType,errormsg]=read_civdata(FileName,InputField,ParamIn.VelType); 63 64 if ~isempty(errormsg),errormsg=['read_civdata / ' errormsg];return,end 64 65 ParamOut.CivStage=Field.CivStage; 65 case 'civx' 66 case 'civx'% old (obsolete) format for civ results 66 67 ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default 67 68 [Field,ParamOut.VelType,errormsg]=read_civxdata(FileName,InputField,ParamIn.VelType); 68 69 if ~isempty(errormsg),errormsg=['read_civxdata / ' errormsg];return,end 69 70 ParamOut.CivStage=Field.CivStage; 70 case 'netcdf' 71 case 'netcdf'% general netcdf file (not recognized as civ) 71 72 ListVar={}; 72 73 Role={}; … … 77 78 checkV=0; 78 79 for ilist=1:numel(InputField) 80 % look for input variables to read 79 81 r=regexp(InputField{ilist},'(?<Operator>(^vec|^norm))\((?<UName>.+),(?<VName>.+)\)$','names'); 80 82 if isempty(r)% no operator used … … 119 121 end 120 122 end 123 if ~isfield(ParamIn,'Coord_z') 124 ParamIn.Coord_z=[]; 125 end 126 NbCoord=~isempty(ParamIn.Coord_x)+~isempty(ParamIn.Coord_y)+~isempty(ParamIn.Coord_z); 121 127 if isfield(ParamIn,'TimeDimName')% case of reading of a single time index in a multidimensional array 122 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeDimName',ParamIn.TimeDimName,num,[ParamIn.Coord_x (ParamIn.Coord_y)ListVar]);128 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeDimName',ParamIn.TimeDimName,num,[ParamIn.Coord_x ParamIn.Coord_y ParamIn.Coord_z ListVar]); 123 129 elseif isfield(ParamIn,'TimeVarName')% case of reading of a single time in a multidimensional array 124 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeVarName',ParamIn.TimeVarName,num,[ParamIn.Coord_x (ParamIn.Coord_y) ListVar]); 125 else 126 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,[ParamIn.Coord_x (ParamIn.Coord_y) (ParamIn.Coord_z) ListVar]); 130 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,'TimeVarName',ParamIn.TimeVarName,num,[ParamIn.Coord_x ParamIn.Coord_y ParamIn.Coord_z ListVar]); 131 NbCoord=NbCoord+1;% adds time coordinate 132 else 133 [Field,var_detect,ichoice,errormsg]=nc2struct(FileName,[ParamIn.Coord_x ParamIn.Coord_y ParamIn.Coord_z ListVar]); 127 134 end 128 135 if ~isempty(errormsg) 129 136 return 130 137 end 131 for ilist=3:numel(Field.VarDimName) 132 if isequal(Field.VarDimName{1},Field.VarDimName{ilist}) 138 %scan all the variables beyond the two first ones, ParamIn.Coord_x and ParamIn.Coord_y. 139 for ilist=NbCoord+1:numel(Field.VarDimName) 140 if isequal(Field.VarDimName{1},Field.VarDimName{ilist}) % if a variable has the same dimension as the coordinate, it denotes a field with unstructured coordinates 133 141 Field.VarAttribute{1}.Role='coord_x';%unstructured coordinates 134 142 Field.VarAttribute{2}.Role='coord_y'; 143 if NbCoord>=3 144 Field.VarAttribute{3}.Role='coord_z'; 145 end 135 146 break 136 147 end … … 140 151 VName=''; 141 152 for ilist=1:numel(ListVar) 142 Field.VarAttribute{ilist+ 2}.Role=Role{ilist};143 Field.VarAttribute{ilist+ 2}.ProjModeRequest=ProjModeRequest{ilist};153 Field.VarAttribute{ilist+NbCoord}.Role=Role{ilist}; 154 Field.VarAttribute{ilist+NbCoord}.ProjModeRequest=ProjModeRequest{ilist}; 144 155 if isfield(ParamIn,'FieldName') 145 Field.VarAttribute{ilist+ 2}.FieldName=ListInputField{ilist};156 Field.VarAttribute{ilist+NbCoord}.FieldName=ListInputField{ilist}; 146 157 end 147 158 r=regexp(ListInputField{ilist},'(?<Operator>(^vec|^norm))\((?<UName>.+),(?<VName>.+)\)$','names'); -
trunk/src/series.m
r735 r748 2241 2241 Param=read_GUI(handles.series); 2242 2242 Param.InputTable=Param.InputTable(1,:); 2243 filecell=get_file_series(Param); 2244 2245 if exist(filecell{1,1},'file') 2246 GetFieldData=get_field(filecell{1,1}); 2243 % check the existence of the first file in the series 2244 first_j=[]; 2245 if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end 2246 last_j=[]; 2247 if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end 2248 PairString=''; 2249 if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end 2250 [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString); 2251 FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},... 2252 Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2); 2253 % filecell=get_file_series(Param); 2254 % 2255 if exist(FirstFileName,'file') 2256 ParamIn.SeriesInput=1; 2257 GetFieldData=get_field(FirstFileName,ParamIn); 2247 2258 FieldList={}; 2248 2259 switch GetFieldData.FieldOption … … 2261 2272 end 2262 2273 case 'scalar' 2263 AName=GetFieldData.PanelScalar.scalar;2274 FieldList=GetFieldData.PanelScalar.scalar; 2264 2275 YName={GetFieldData.Coordinates.Coord_y}; 2265 FieldList={AName}; 2276 if ischar(FieldList) 2277 FieldList={FieldList}; 2278 end 2266 2279 case '1D plot' 2267 2280 YName=GetFieldData.PanelOrdinate.ordinate; -
trunk/src/uvmat.m
r747 r748 83 83 % velocity vectors. The scalar values in the first case is represented by 84 84 % UvData.Field.A, and by UvData.Field.C in the second case. The corresponding set of X 85 % and Y coordinates are represented by UvData.Field.AX and UvData.Field.AY, and .X and85 % and Y axes are represented by UvData.Field.AX and UvData.Field.AY, and .X and 86 86 % .Y for C (the same as velocity vectors). If A is a nxxny matrix (scalar 87 87 % on a regtular grid), then .AX andf.AY contains only two elements, represneting the 88 % coordinates of the four image corners. The scalar name is represented by88 % axes of the four image corners. The scalar name is represented by 89 89 % the strings .AName and/or .CName. 90 90 % If the scalar exists in an input open (image or scalar stored under its … … 95 95 % Properties attached to plotting figures (standard Matlab properties): 96 96 % 'CurrentAxes'= gca or get(gcf,'CurrentAxes'); 97 % 'CurrentPoint'=get(gcf,'CurrentPoint'): figure coordinates of the point over which the mouse is positioned97 % 'CurrentPoint'=get(gcf,'CurrentPoint'): figure axes of the point over which the mouse is positioned 98 98 % 'CurrentCharacter'=get(gcf,'CurrentCharacter'): last character typed over the figure where the mouse is positioned 99 99 % 'WindowButtonMotionFcn': function permanently called by mouse motion over the figure … … 103 103 104 104 % Properties attached to plotting axes: 105 % 'CurrentPoint'=get(gca,'CurrentPoint'); (standard Matlab) same as for the figure, but position in plot coordinates.105 % 'CurrentPoint'=get(gca,'CurrentPoint'); (standard Matlab) same as for the figure, but position in plot axes. 106 106 % AxeData:=get(gca,'UserData'); 107 107 % AxeData.Drawing = create: create a new object … … 120 120 % ObjectData.Type=...: style of projection object: 121 121 % .ProjMode 122 % .Coord : defines the position of the object122 % .Coordinates: defines the position of the object 123 123 % .XMin,YMin.... 124 124 % .XMax,YMax.... … … 191 191 set(hObject,'Position',[LeftX LowY Width Height]) 192 192 UvData.OpenParam.PosColorbar=[0.80 0.02 0.018 0.445]; 193 % UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib194 193 AxeData.LimEditBox=1; %initialise AxeData 195 194 set(handles.PlotAxes,'UserData',AxeData) … … 396 395 % set(handles.CheckHold,'Position',pos_CheckHold) 397 396 398 %% reset position of Coordinates 397 %% reset position of Coordinates panel 399 398 set(handles.Coordinates,'Units','pixels') 400 399 pos_2=get(handles.Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates' … … 404 403 set(handles.Coordinates,'Position',pos_2) 405 404 405 %% reset position of Axes panel 406 set(handles.Axes,'Units','pixels') 407 pos_3=get(handles.Axes,'Position');% [lower x lower y width height] for frame 'Coordinates' 408 pos_3(3)=ColumnWidth; 409 pos_3(1)=size_fig(3)-pos_3(3); % set 'Coordinates' to the right of the fig 410 pos_3(2)=pos_2(2)-pos_3(4); % set 'Coordinates' to the lower edge of text display, allowing a margin for CheckHold 411 set(handles.Axes,'Position',pos_3) 412 406 413 %% reset position of Scalar 407 414 set(handles.Scalar,'Units','pixels') 408 pos_ 3=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar'409 pos_ 3(3)=ColumnWidth;410 pos_ 3(1)=size_fig(3)-pos_3(3); % set 'Scalar' to the right of the fig415 pos_4=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar' 416 pos_4(3)=ColumnWidth; 417 pos_4(1)=size_fig(3)-pos_4(3); % set 'Scalar' to the right of the fig 411 418 if strcmp(get(handles.Scalar,'Visible'),'on') 412 pos_ 3(2)=pos_2(2)-pos_3(4); % set 'Scalar' to the lower edge of frame 'Coordinates' if visible413 else 414 pos_ 3(2)=pos_2(2);% set 'Scalar' to the lower edge of frame 'text display' if unvisible415 end 416 set(handles.Scalar,'Position',pos_ 3)419 pos_4(2)=pos_3(2)-pos_4(4); % set 'Scalar' to the lower edge of frame 'Coordinates' if visible 420 else 421 pos_4(2)=pos_3(2);% set 'Scalar' to the lower edge of frame 'text display' if unvisible 422 end 423 set(handles.Scalar,'Position',pos_4) 417 424 418 425 %% reset position of Vectors 419 426 set(handles.Vectors,'Units','pixels') 420 pos_ 4=get(handles.Vectors,'Position');421 pos_ 4(3)=ColumnWidth;422 pos_ 4(1)=size_fig(3)-pos_4(3);427 pos_5=get(handles.Vectors,'Position'); 428 pos_5(3)=ColumnWidth; 429 pos_5(1)=size_fig(3)-pos_5(3); 423 430 if strcmp(get(handles.Vectors,'visible'),'on') 424 pos_ 4(2)=pos_3(2)-pos_4(4);425 else 426 pos_ 4(2)=pos_3(2);427 end 428 set(handles.Vectors,'Position',pos_ 4)431 pos_5(2)=pos_4(2)-pos_5(4); 432 else 433 pos_5(2)=pos_4(2); 434 end 435 set(handles.Vectors,'Position',pos_5) 429 436 430 437 %% reset position and scale of axis … … 2626 2633 break 2627 2634 end 2628 if UvData.Field.NbDim==3 % TO GENERALISE2635 if UvData.Field.NbDim==3 2629 2636 UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects 2637 if ~isfield(UvData.ProjObject{iobj},'RangeZ') 2630 2638 UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane 2631 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 2632 UvData.ProjObject{iobj}.Angle=[0 0 0]; 2639 end 2640 if ~(isfield(UvData.ProjObject{iobj},'Coord') && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin) 2641 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 2642 end 2633 2643 end 2634 2644 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.ProjObject{iobj});% project field on the object … … 2639 2649 PlotParam{imap}.Scalar.CheckBW=[]; %B/W option depends on the input field (image or scalar) 2640 2650 if isfield(ObjectData,'CoordUnit') 2641 PlotParam{imap}. Coordinates.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y)2642 PlotParam{imap}. Coordinates.AspectRatio=1; %set aspect ratio to 12651 PlotParam{imap}.Axes.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y) 2652 PlotParam{imap}.Axes.AspectRatio=1; %set aspect ratio to 1 2643 2653 end 2644 2654 end … … 2706 2716 Ustring=''; 2707 2717 Vstring=''; 2708 % suppress coordinates from the histogram menu2718 % suppress axes from the histogram menu 2709 2719 for ivar=1:numel(menu_histo)%l loop on field variables: 2710 2720 if isfield(UvData.Field,'VarAttribute') && numel(UvData.Field.VarAttribute)>=ivar && isfield(UvData.Field.VarAttribute{ivar},'Role') … … 2748 2758 2749 2759 if UvData.Field.NbDim==3 2760 set(handles.CheckEditObject,'Value',1) 2750 2761 CheckEditObject_Callback(handles.uvmat, [], handles) 2751 2762 end … … 2809 2820 else 2810 2821 nxy=size(FieldHisto); 2811 Amin=double(min(min(min( FieldHisto))));%min of field value2812 Amax=double(max(max(max( FieldHisto))));%max of field value2822 Amin=double(min(min(min(min(FieldHisto)))));%min of field value 2823 Amax=double(max(max(max(max(FieldHisto)))));%max of field value 2813 2824 if isequal(Amin,Amax) 2814 2825 cla(handles.HistoAxes) … … 3110 3121 switch field 3111 3122 case 'get_field...' 3112 %% fill the coordinates and variables from selections in get_field3123 %% fill the axes and variables from selections in get_field 3113 3124 ParamIn=[]; 3114 3125 % in case of civ data, we use the civ choice as default input for the GUI get_field … … 3274 3285 switch field_1 3275 3286 case 'get_field...' 3276 %% fill the coordinates and variables from selections in get_field3287 %% fill the axes and variables from selections in get_field 3277 3288 ParamIn=[]; 3278 3289 % in case of civ data, we use the civ choice as default input for the GUI get_field … … 3867 3878 %------------------------------------------------- 3868 3879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3869 % Plot coordinates3880 % Plot axes 3870 3881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3871 3882 %------------------------------------------------------------------------ … … 4303 4314 haxes=findobj(hview_field,'tag','axes3'); 4304 4315 pos=get(hview_field,'Position'); 4305 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam. Coordinates)% case of no plot display (pure text table)4316 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Axes)% case of no plot display (pure text table) 4306 4317 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4307 4318 pos_table=get(h_TableDisplay,'Position'); … … 4480 4491 haxes=findobj(hview_field,'tag','axes3'); 4481 4492 pos=get(hview_field,'Position'); 4482 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam. Coordinates)% case of no plot display (pure text table)4493 if strcmp(get(haxes,'Visible'),'off')%sempty(PlotParam.Axes)% case of no plot display (pure text table) 4483 4494 h_TableDisplay=findobj(hview_field,'tag','TableDisplay'); 4484 4495 pos_table=get(h_TableDisplay,'Position'); … … 5232 5243 XmlData.PolarCentre=[x0 y0]; 5233 5244 5234 %% display the current image in polar coordinates with origin at the illumination source5245 %% display the current image in polar axes with origin at the illumination source 5235 5246 currentdir=pwd; 5236 5247 uvmatpath=fileparts(which('uvmat')); … … 5558 5569 %'write_plot_param': update the plotting parameters on the uvmat or view_field interface after a plotting operation 5559 5570 function write_plot_param(handles,PlotParam) 5560 %% coordinates5561 if isempty(PlotParam. Coordinates)5562 set(handles. Coordinates,'Visible','off')5571 %% axes 5572 if isempty(PlotParam.Axes) 5573 set(handles.Axes,'Visible','off') 5563 5574 set(handles.PlotAxes,'Visible','off') 5564 5575 set(handles.text_display,'Visible','off') 5565 5576 set(handles.TableDisplay,'Visible','on') 5566 5577 else 5567 set(handles. Coordinates,'Visible','on')5578 set(handles.Axes,'Visible','on') 5568 5579 set(handles.PlotAxes,'Visible','on') 5569 5580 set(handles.text_display,'Visible','on') … … 5571 5582 set(handles.TableDisplay,'Visible','off') 5572 5583 end 5573 Coordinates=PlotParam. Coordinates;5584 Coordinates=PlotParam.Axes; 5574 5585 if isfield(Coordinates,'CheckFixAspectRatio') 5575 5586 if Coordinates.CheckFixAspectRatio … … 5666 5677 5667 5678 5668 5669 function Coord_z_Callback(hObject, eventdata, handles)5670 % hObject handle to Coord_z(see GCBO)5679 % --- Executes on selection change in SwitchCoordIndex. 5680 function SwitchCoordIndex_Callback(hObject, eventdata, handles) 5681 % hObject handle to SwitchCoordIndex (see GCBO) 5671 5682 % eventdata reserved - to be defined in a future version of MATLAB 5672 5683 % handles structure with handles and user data (see GUIDATA) 5673 5684 5674 % Hints: get(hObject,'String') returns contents of Coord_z as text 5675 % str2double(get(hObject,'String')) returns contents of Coord_z as a double 5676 5677 5678 % --- Executes during object creation, after setting all properties. 5679 function Coord_z_CreateFcn(hObject, eventdata, handles) 5680 % hObject handle to Coord_z (see GCBO) 5681 % eventdata reserved - to be defined in a future version of MATLAB 5682 % handles empty - handles not created until after all CreateFcns called 5683 5684 % Hint: edit controls usually have a white background on Windows. 5685 % See ISPC and COMPUTER. 5686 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 5687 set(hObject,'BackgroundColor','white'); 5688 end 5685 % Hints: contents = cellstr(get(hObject,'String')) returns SwitchCoordIndex contents as cell array 5686 % contents{get(hObject,'Value')} returns selected item from SwitchCoordIndex -
trunk/src/view_field.m
r726 r748 79 79 if exist('Field','var') 80 80 [PlotType,PlotParamOut]= plot_field(Field,handles.PlotAxes);%,PlotParam,KeepLim,PosColorbar) 81 set(handles. Coordinates,'Visible','on')81 set(handles.Axes,'Visible','on') 82 82 if isfield(PlotParamOut,'Vectors') 83 83 set(handles.Vectors,'Visible','on') … … 138 138 set(handles.CheckHold,'Position',pos_CheckHold) 139 139 140 %% reset position of Coordinates141 pos_2=get(handles. Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates'140 %% reset position of Axes 141 pos_2=get(handles.Axes,'Position');% [lower x lower y width height] for frame 'Coordinates' 142 142 pos_2(1)=size_fig(3)-pos_2(3); % set 'Coordinates' to the right of the fig 143 143 pos_2(2)=pos_CheckHold(2)-pos_2(4); % set 'Coordinates' to the lower edge of text display, allowing a margin for CheckHold 144 set(handles. Coordinates,'Position',pos_2)144 set(handles.Axes,'Position',pos_2) 145 145 146 146 %% reset position of Scalar
Note: See TracChangeset
for help on using the changeset viewer.