Changeset 1028 for trunk/src/find_field_bounds.m
 Timestamp:
 Jan 8, 2018, 9:52:53 PM (6 years ago)
 File:

 1 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(end1)}; 70 CoordMax(ind,NbDim)=max(max(Field.(XName))); 71 CoordMin(ind,NbDim)=min(min(Field.(XName))); 72 CoordMax(ind,NbDim1)=max(max(Field.(YName))); 73 CoordMin(ind,NbDim1)=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,NbDim2)=max(max(Field.(ZName))); 78 CoordMin(ind,NbDim2)=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{end1})=1:siz(end1); 79 CoordMax(ind,numel(siz)1)=siz(end1); 80 FieldOut.ListVarName=[FieldOut.ListVarName DimList(end1)]; 81 FieldOut.VarDimName=[FieldOut.VarDimName DimList(end1)]; 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(end1)}; 94 CoordMax(ind,NbDim)=max(max(Field.(XName))); 95 CoordMin(ind,NbDim)=min(min(Field.(XName))); 96 CoordMax(ind,NbDim1)=max(max(Field.(YName))); 97 CoordMin(ind,NbDim1)=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,NbDim2)=max(max(Field.(ZName))); 102 CoordMin(ind,NbDim2)=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,:))./(NbPoints1)); … … 98 123 FieldOut.ProjModeRequest='interp_lin'; 99 124 end 100 end 125 end 101 126 end 102 127 Mesh=min(Mesh);
Note: See TracChangeset
for help on using the changeset viewer.