Changeset 893
 Timestamp:
 Apr 30, 2015, 8:28:58 AM (9 years ago)
 Location:
 trunk/src
 Files:

 1 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/find_field_bounds.m
r871 r893 41 41 NbDim=max(NbDimArray);% spatial dimension of the input field 42 42 imax=find(NbDimArray==NbDim);% indices of field cells to consider 43 Check4D=0; 44 if NbDim>3 45 NbDim=3; 46 Check4D=1; 47 end 43 48 FieldOut.NbDim=NbDim; 44 49 if NbDim<=1; return; end% stop here for 1D fields 45 50 46 51 %% get bounds and mesh (needed to propose default options for projection objects) 47 52 % if NbDim>1 … … 57 62 CoordMin(ind,NbDim1)=min(min(Field.(CoordName)(1:end3,2,:),[],1),[],3);% min of y component (2D case) 58 63 else 64 if Check4D 65 CellInfo{imax(ind)}.CoordIndex(4:end)=[]; 66 end 59 67 XName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end)}; 60 68 YName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(end1)}; … … 66 74 if NbDim==3 67 75 ZName=Field.ListVarName{CellInfo{imax(ind)}.CoordIndex(1)}; 68 CoordMax(ind, 1)=max(max(Field.(ZName)));69 CoordMin(ind, 1)=min(min(Field.(ZName)));76 CoordMax(ind,NbDim2)=max(max(Field.(ZName))); 77 CoordMin(ind,NbDim2)=min(min(Field.(ZName))); 70 78 end 71 79 end … … 77 85 case 'grid'%structured coordinate 78 86 NbPoints=CellInfo{imax(ind)}.CoordSize;% nbre of points in each direction 87 if Check4D 88 NbPoints=NbPoints(1:3); 89 end 79 90 Mesh(ind)=min((CoordMax(ind,:)CoordMin(ind,:))./(NbPoints1)); 80 91 end
Note: See TracChangeset
for help on using the changeset viewer.