- Timestamp:
- Jan 8, 2018, 9:52:53 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_bounds.m
r1027 r1028 47 47 end 48 48 FieldOut.NbDim=NbDim; 49 if NbDim<=1; return; end% stop here for 1D fields49 %if NbDim<=1; return; end% stop here for 1D fields 50 50 51 51 %% get bounds and mesh (needed to propose default options for projection objects) … … 66 66 CellInfo{imax(ind)}.CoordIndex(4:end)=[]; 67 67 end 68 XName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end)}; 69 YName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end-1)}; 70 CoordMax(ind,NbDim)=max(max(Field.(XName))); 71 CoordMin(ind,NbDim)=min(min(Field.(XName))); 72 CoordMax(ind,NbDim-1)=max(max(Field.(YName))); 73 CoordMin(ind,NbDim-1)=min(min(Field.(YName))); 74 % test_x=1;%test for unstructured coordinates 75 if NbDim==3 76 ZName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(1)}; 77 CoordMax(ind,NbDim-2)=max(max(Field.(ZName))); 78 CoordMin(ind,NbDim-2)=min(min(Field.(ZName))); 68 if isempty(CellInfo{imax(ind)}.CoordIndex) 69 FieldName=CellInfo{imax(ind)}.FieldName; 70 DimList=Field.VarDimName{imax(ind)}; 71 siz=size(DimList); 72 73 FieldOut.(DimList{end})=1:siz(end); 74 FieldOut.ListVarName=[FieldOut.ListVarName DimList(end)]; 75 FieldOut.VarDimName=[FieldOut.VarDimName DimList(end)]; 76 CoordMax(ind,numel(siz))=siz(end); 77 if numel(siz)>=2 78 FieldOut.(DimList{end-1})=1:siz(end-1); 79 CoordMax(ind,numel(siz)-1)=siz(end-1); 80 FieldOut.ListVarName=[FieldOut.ListVarName DimList(end-1)]; 81 FieldOut.VarDimName=[FieldOut.VarDimName DimList(end-1)]; 82 end 83 if numel(siz)>=3 84 FieldOut.(DimList{1})=1:siz(1); 85 CoordMax(ind,1)=siz(1); 86 FieldOut.ListVarName=[FieldOut.ListVarName DimList(1)]; 87 FieldOut.VarDimName=[FieldOut.VarDimName DimList(1)]; 88 end 89 CoordMin(ind,1:numel(siz))=1; 90 CellInfo{imax(ind)}.CoordSize=CoordMax(ind,:); 91 else 92 XName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end)}; 93 YName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end-1)}; 94 CoordMax(ind,NbDim)=max(max(Field.(XName))); 95 CoordMin(ind,NbDim)=min(min(Field.(XName))); 96 CoordMax(ind,NbDim-1)=max(max(Field.(YName))); 97 CoordMin(ind,NbDim-1)=min(min(Field.(YName))); 98 % test_x=1;%test for unstructured coordinates 99 if NbDim==3 100 ZName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(1)}; 101 CoordMax(ind,NbDim-2)=max(max(Field.(ZName))); 102 CoordMin(ind,NbDim-2)=min(min(Field.(ZName))); 103 end 79 104 end 80 105 end … … 87 112 NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points in each direction 88 113 if Check4D 89 NbPoints=NbPoints(1:3);114 NbPoints=NbPoints(1:3); 90 115 end 91 116 Mesh(ind)=min((CoordMax(ind,:)-CoordMin(ind,:))./(NbPoints-1)); … … 98 123 FieldOut.ProjModeRequest='interp_lin'; 99 124 end 100 end 125 end 101 126 end 102 127 Mesh=min(Mesh); -
trunk/src/get_field.m
r1027 r1028 149 149 ListSwitchVarIndexTime=[ListSwitchVarIndexTime; {'attribute'}];% the time can be chosen as a global attribute 150 150 end 151 152 Check_index=0; 151 153 if Field.MaxDim>=2 152 154 ListSwitchVarIndexTime=[ListSwitchVarIndexTime;{'variable'};{'matrix index'}];% the time can be chosen as a dim index 155 else 156 for ilist=1:numel(Field.Display.VarDimName) 157 NbComponent=numel(Field.Display.VarDimName{ilist}); 158 if NbComponent>=2% multicomponent matrices without coordinate variables (thus not considered in the fct find_field_cell) 159 ListSwitchVarIndexTime=[ListSwitchVarIndexTime;{'matrix index'}];% the time can be chosen as a dim index 160 Check_index=1; 161 break 162 end 163 end 153 164 end 154 165 … … 220 231 if check_vec_input 221 232 set(handles.FieldOption,'Value',3)% set vector selection option 222 else 223 233 else 224 234 set(handles.FieldOption,'Value',2)% set scalar selection option 225 235 end
Note: See TracChangeset
for help on using the changeset viewer.