Changeset 89 for trunk/src/find_field_indices.m
- Timestamp:
- May 20, 2010, 1:48:25 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_indices.m
r85 r89 1 1 %'find_file_indices': test field structure for input in proj_field and plot_field 2 % group the variables into 'fields' with common dimensions3 %---------------------------------------------------------------------- 2 % group the variables into 'fields' with common dimensions 3 %------------------------------------------------------------------------ 4 4 % function [DimVarIndex,CellVarIndex,NbDim,VarType]=find_field_indices(Data) 5 5 % 6 % OUTPUT:6 % OUTPUT: 7 7 % CellVaxIndex: cell whose elements are arrays of indices in the list data.ListVarName 8 8 % CellvarIndex{i} represents a set of variables with the same dimensions … … 18 18 % .discrete: like scalar, but set of data points without continuity, represented as dots in a usual plot, instead of continuous lines otherwise 19 19 % .scalar: scalar field (default) 20 % 20 % .coord: vector of indices of coordinate variables corresponding to matrix dimensions 21 21 % 22 % INPUT:22 % INPUT: 23 23 % Data: structure representing fields, output of check_field_structure 24 24 % .ListDimName: cell listing the names of the array dimensions … … 153 153 return 154 154 end 155 NbDim(icell)=0;% nbre of space dimensions 156 if numel(VarIndex)>1 155 %NbDim(icell)=0;% nbre of space dimensions 156 NbDim(icell)=numel(DimCell); 157 test_coord=0; 158 if numel(VarIndex)>1 157 159 if ~isempty(ivar_coord_z) 158 160 NbDim(icell)=3; 161 test_coord=1; 159 162 elseif ~isempty(ivar_coord_y) 160 163 NbDim(icell)=2; 164 test_coord=1; 161 165 elseif ~isempty(ivar_coord_x) 162 166 NbDim(icell)=1; 167 test_coord=1; 163 168 end 164 169 end 165 170 % look at coordinates variables 166 171 coord=zeros(1,numel(DimCell));%default 167 if NbDim(icell)==0 && ~isempty(VarDimName)% no unstructured coordinate found 172 % if NbDim(icell)==0 && ~isempty(VarDimName)% no unstructured coordinate found 173 if ~test_coord && ~isempty(VarDimName) 168 174 for idim=1:numel(DimCell) %loop on the dimensions of the variables in cell #icell 169 175 for ivardim=1:numel(VarDimName)
Note: See TracChangeset
for help on using the changeset viewer.