Changeset 1009 for trunk/src/get_field.m
- Timestamp:
- Jul 22, 2017, 7:20:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r977 r1009 15 15 % INPUT: 16 16 % FileName: name (including path) of the netcdf file to open 17 % ParmIn: structure containing parameters for preselecting menus: 18 % .Title: set the title of the GUI get_field 19 % .SwitchVarIndexTime='file index','variable' or 'matrix index': select the default option for 'time' 20 % .TimeAttrName: preselect the name of a global attribute for time 21 % .SeriesInput=1 if get_field is called by the GUI series,=0 otherwise (plot options provided in the latter case) 22 % .Coord_x,.Coord_y,.Coord_z, names of the variables used as the three coordinates 23 % .scalar : set the default choise of the scale variable 24 % .vector_x, .vector_y : set the default choise for the variables used for the x and y vector components 17 25 18 26 %======================================================================= … … 85 93 end 86 94 if ~exist('ParamIn','var') 87 ParamIn =[];95 ParamIn.Coord_z=''; 88 96 end 89 97 … … 151 159 time_index=find(~cellfun('isempty',regexp(Field.Display.ListGlobalAttribute,'Time')),1);% look for global attribute containing name 'Time' 152 160 end 153 if ~isempty(time_index) 161 if isempty(time_index) 162 set(handles.SwitchVarIndexTime,'Value',1); 163 else 154 164 set(handles.SwitchVarIndexTime,'Value',2); 155 165 set(handles.TimeName,'UserData',time_index) 156 else157 set(handles.SwitchVarIndexTime,'Value',1);158 166 end 159 167 set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime) … … 230 238 CoordIndex=CellInfo{imax}.CoordIndex; 231 239 if numel(CoordIndex)==2 240 if isfield(ParamIn,'Coord_x')&& isfield(ParamIn,'Coord_y') 241 YName=ParamIn.Coord_y; 242 XName=ParamIn.Coord_x; 243 else 232 244 YName=Field.ListVarName{CoordIndex(1)}; 233 245 XName=Field.ListVarName{CoordIndex(2)}; 246 end 234 247 ListCoord=get(handles.Coord_x,'String'); 235 248 XIndex=find(strcmp(XName,ListCoord)); … … 259 272 260 273 %% set z coordinate menu if relevant 261 if Field.MaxDim>=3 && prod(Field.DimValue)<10^8 ; % 3D field (with memory content smaller than 400 Mo)274 if Field.MaxDim>=3 && prod(Field.DimValue)<10^8 && ~isempty(ParamIn.Coord_z); % 3D field (with memory content smaller than 400 Mo) 262 275 set(handles.Check3D,'Value',1) 263 276 else
Note: See TracChangeset
for help on using the changeset viewer.