Changeset 522 for trunk/src/series/merge_proj.m
- Timestamp:
- Aug 18, 2012, 11:18:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/merge_proj.m
r511 r522 193 193 for iview=1:nbview 194 194 % reading input file(s) 195 filecell{iview,index}196 195 [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},Param.InputFields,frame_index{iview}(index)); 197 196 if ~isempty(errormsg) … … 225 224 end 226 225 end 227 if ~isempty(Param.ProjObject)&& strcmp(Param.ProjObject.ProjMode,'filter')&&~isfield(Data{iview},'Coord_tps') 228 Data{iview}=calc_tps(Data{iview}); 229 end 230 231 % field calculation (vort, div...) 232 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 233 if isfield(Data{iview},'Coord_tps') 234 Data{iview}.FieldList=Param.InputFields.FieldName; 235 else 236 Data{iview}=calc_field(Param.InputFields.FieldName,Data{iview});%calculate field (vort..) 237 end 238 end 226 227 %% calculate tps coeff if needed 228 check_proj_tps= ~isempty(Param.ProjObject)&& strcmp(Param.ProjObject.ProjMode,'filter')&&~isfield(Data{iview},'Coord_tps'); 229 Data{iview}=calc_tps(Data{iview},check_proj_tps); 230 231 % % field calculation (vort, div...) 232 % if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 233 % if isfield(Data{iview},'Coord_tps') 234 % Data{iview}.FieldList=Param.InputFields.FieldName; 235 % else 236 % Data{iview}=calc_field(Param.InputFields.FieldName,Data{iview});%calculate field (vort..) 237 % end 238 % end 239 239 240 240 %projection on object (gridded plane) … … 360 360 end 361 361 362 %% group the variables (fields of ' FieldData') in cells of variables with the same dimensions363 [CellVarIndex,NbDim,VarTypeCell]=find_field_ indices(Data{1});362 %% group the variables (fields of 'Data') in cells of variables with the same dimensions 363 [CellVarIndex,NbDim,VarTypeCell]=find_field_cells(Data{1}); 364 364 %LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS 365 365 % CellVarIndex=cells of variable index arrays 366 ivar_new=0; % index of the current variable in the projected field367 366 for icell=1:length(CellVarIndex) 368 367 if NbDim(icell)==1 … … 388 387 VarName=MergeData.ListVarName{ivar}; 389 388 for iview=1:nbview 390 eval(['MergeData.' VarName '=[MergeData.' VarName '; Data{iview}.' VarName '];'])389 MergeData.(VarName)=[MergeData.(VarName); Data{iview}.(VarName)]; 391 390 end 392 391 end … … 402 401 end 403 402 end 404 eval(['MergeData.' VarName '=MergeData.' VarName '+ Data{iview}.' VarName ';'])403 MergeData.(VarName)=MergeData.(VarName) + Data{iview}.(VarName); 405 404 end 406 405 end … … 410 409 for ivar=VarIndex 411 410 VarName=MergeData.ListVarName{ivar}; 412 eval(['MergeData.' VarName '(indgood)=double(MergeData.' VarName '(indgood))./nbaver(indgood);'])411 MergeData.(VarName)(indgood)=double(MergeData.(VarName)(indgood))./nbaver(indgood); 413 412 end 414 413 else 415 414 for ivar=VarIndex 416 415 VarName=MergeData.ListVarName{ivar}; 417 eval(['MergeData.' VarName '=double(MergeData.' VarName ')./nbview;'])416 MergeData.(VarName)=double(MergeData.(VarName))./nbview; 418 417 end 419 418 end
Note: See TracChangeset
for help on using the changeset viewer.