Changeset 527 for trunk/src/read_civxdata.m
- Timestamp:
- Aug 20, 2012, 11:12:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/read_civxdata.m
r498 r527 53 53 DataTest=nc2struct(filename,'ListGlobalAttribute','Conventions','CivStage'); 54 54 if isfield(DataTest,'Txt') 55 errormsg=['nc2struct :' DataTest.Txt];55 errormsg=['nc2struct / ' DataTest.Txt]; 56 56 return 57 57 elseif isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format 58 58 [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType,DataTest.CivStage); 59 if ~isempty(errormsg),errormsg=['read_civdata :' errormsg];end59 if ~isempty(errormsg),errormsg=['read_civdata / ' errormsg];end 60 60 return 61 61 end … … 77 77 [Field,vardetect,ichoice]=nc2struct(filename,var);%read the variables in the netcdf file 78 78 if isfield(Field,'Txt') 79 errormsg=['nc2struct :' Field.Txt];79 errormsg=['nc2struct / ' Field.Txt]; 80 80 return 81 81 end … … 97 97 if isfield(Field,'DjUi') 98 98 Field.ListVarName{end-3}='DjUi'; 99 Field.VarDimName{end-3}=[Field.VarDimName{end-3} {'nb_coord'} {'nb -coord'}];99 Field.VarDimName{end-3}=[Field.VarDimName{end-3} {'nb_coord'} {'nb_coord'}]; 100 100 Field.ListVarName(end-2:end)=[]; 101 101 Field.VarDimName(end-2:end)=[]; … … 186 186 %INPUT: 187 187 % FieldNames =cell of field names to get, which can contain the strings: 188 % ' ima_cor': image correlation, vec_c or vec2_C189 % ' vort','div','strain': requires velocity derivatives DUDX...188 % 'C': image correlation, vec_c or vec2_C 189 % 'curl','div','strain': requires velocity derivatives DUDX... 190 190 % 'error': error estimate (vec_E or vec2_E) 191 191 % … … 199 199 if ~exist('vel_type','var'),vel_type=[];end; 200 200 if iscell(vel_type),vel_type=vel_type{1}; end;%transform cell to string if needed 201 if ~exist('FieldNames','var'),FieldNames={' ima_cor'};end;%default scalar201 if ~exist('FieldNames','var'),FieldNames={'C'};end;%default scalar 202 202 if ischar(FieldNames), FieldNames={FieldNames}; end; 203 203 … … 205 205 testder=0; 206 206 for ilist=1:length(FieldNames) 207 if ~isempty(FieldNames{ilist}) 208 switch FieldNames{ilist} 209 case {'vort','div','strain'} 210 testder=1; 211 end 212 end 207 testder=~isempty(regexp(FieldNames{ilist},'(^curl|^div|strain)', 'once'));%test need for derivatives 208 if testder, break;end 213 209 end 214 210 if isempty(vel_type) || isequal(vel_type,'*') %undefined velocity type (civ1,civ2...) … … 261 257 if ~isempty(FieldNames{ilist}) 262 258 switch FieldNames{ilist} 263 case ' ima_cor' %image correlation corresponding to a vel vector259 case 'C' %image correlation corresponding to a vel vector 264 260 C1='vec_C'; 265 261 C2='vec2_C'; … … 267 263 C1='vec_E'; 268 264 C2='vec2_E'; 269 case {'vort','div','strain'}270 testder=1;265 otherwise 266 testder=~isempty(regexp(FieldNames{ilist},'(^curl|^div|strain)', 'once'));%test need for derivatives 271 267 end 272 268 end
Note: See TracChangeset
for help on using the changeset viewer.