Changeset 411 for trunk/src/find_field_indices.m
- Timestamp:
- May 7, 2012, 3:32:21 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_indices.m
r404 r411 52 52 function [CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(Data) 53 53 CellVarIndex={}; 54 54 55 NbDim=[]; 55 56 VarType=[]; … … 105 106 'ancillary','image','color','discrete','scalar','coord_tps'}; 106 107 NbDim=zeros(size(CellVarIndex));%default 108 if isfield(Data,'VarAttribute'); 109 VarAttribute=Data.VarAttribute; 110 else 111 VarAttribute={}; 112 end 107 113 for icell=1:length(CellVarIndex) 108 114 for ilist=1:numel(ListRole) … … 111 117 VarIndex=CellVarIndex{icell};%set of variable indices with the same dim 112 118 DimCell=Data.VarDimName{VarIndex(1)};% list of dimensions for each variable in the cell #icell 113 if isfield(Data,'VarAttribute');114 VarAttribute=Data.VarAttribute;115 else116 VarAttribute={};117 end118 119 test_2D=0; 119 120 for ivar=VarIndex … … 181 182 VarType{icell}.coord=coord; 182 183 if NbDim(icell)==0 && test_2D %look at attributes Coord_1, coord_2 (obsolete convention) 183 NbDim(icell)=2; 184 NbDim(icell)=2; 184 185 end 185 186 %look for tps data
Note: See TracChangeset
for help on using the changeset viewer.