Changeset 533 for trunk/src/calc_field_interp.m
 Timestamp:
 Aug 31, 2012, 11:44:55 AM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/calc_field_interp.m
r521 r533 60 60 for ilist=1:numel(Operation) 61 61 if ~check_skipped(ilist) 62 nbvar=numel(ListVarName); 63 switch Operator{ilist} 64 case 'vec' 65 if exist('XI','var') 66 VarVal{nbvar+1}=F.(UName{ilist})(XI,YI); 67 VarVal{nbvar+2}=F.(VName{ilist})(XI,YI); 68 else 69 VarVal{nbvar+1}=Data.(UName{ilist}); 70 VarVal{nbvar+2}=Data.(VName{ilist}); 71 end 72 ListVarName{nbvar+1}=UName{ilist}; 73 ListVarName{nbvar+2}=VName{ilist}; 74 VarAttribute{nbvar+1}.Role='vector_x'; 75 VarAttribute{nbvar+2}.Role='vector_y'; 76 case 'norm' 77 if exist('XI','var') 78 U2=F.(UName{ilist})(XI,YI).*F.(UName{ilist})(XI,YI); 79 V2=F.(VName{ilist})(XI,YI).*F.(VName{ilist})(XI,YI); 80 else 81 U2=Data.(UName{ilist}).*Data.(UName{ilist}); 82 V2=Data.(VName{ilist}).*Data.(VName{ilist}); 83 end 84 VarVal{nbvar+1}=sqrt(U2+V2); 85 ListVarName{nbvar+1}='norm'; 86 VarAttribute{nbvar+1}.Role='scalar'; 87 otherwise 88 if ~isempty(Operation{ilist}) 62 nbvar=numel(ListVarName); 63 switch Operator{ilist} 64 case 'vec' 89 65 if exist('XI','var') 90 VarVal{nbvar+1}=F.(Operation{ilist})(XI,YI); 66 VarVal{nbvar+1}=F.(UName{ilist})(XI,YI); 67 VarVal{nbvar+2}=F.(VName{ilist})(XI,YI); 91 68 else 92 VarVal{nbvar+1}= Data.(Operation{ilist}); 69 VarVal{nbvar+1}=Data.(UName{ilist}); 70 VarVal{nbvar+2}=Data.(VName{ilist}); 93 71 end 94 ListVarName{nbvar+1}=Operation{ilist}; 72 ListVarName{nbvar+1}=UName{ilist}; 73 ListVarName{nbvar+2}=VName{ilist}; 74 VarAttribute{nbvar+1}.Role='vector_x'; 75 VarAttribute{nbvar+2}.Role='vector_y'; 76 case 'norm' 77 if exist('XI','var') 78 U2=F.(UName{ilist})(XI,YI).*F.(UName{ilist})(XI,YI); 79 V2=F.(VName{ilist})(XI,YI).*F.(VName{ilist})(XI,YI); 80 else 81 U2=Data.(UName{ilist}).*Data.(UName{ilist}); 82 V2=Data.(VName{ilist}).*Data.(VName{ilist}); 83 end 84 VarVal{nbvar+1}=sqrt(U2+V2); 85 ListVarName{nbvar+1}='norm'; 95 86 VarAttribute{nbvar+1}.Role='scalar'; 96 end 97 end 87 otherwise 88 if ~isempty(Operation{ilist}) 89 if exist('XI','var') 90 VarVal{nbvar+1}=F.(Operation{ilist})(XI,YI); 91 else 92 VarVal{nbvar+1}= Data.(Operation{ilist}); 93 end 94 ListVarName{nbvar+1}=Operation{ilist}; 95 VarAttribute{nbvar+1}.Role='scalar'; 96 end 97 end 98 98 end 99 99 end 100 100 % put an error flag to indicate NaN data 101 101 if exist('XI','var') 102 nbvar=numel(ListVarName);103 ListVarName{nbvar+1}='FF';104 VarVal{nbvar+1}=isnan(VarVal{nbvar});105 VarAttribute{nbvar+1}.Role='errorflag';102 nbvar=numel(ListVarName); 103 ListVarName{nbvar+1}='FF'; 104 VarVal{nbvar+1}=isnan(VarVal{nbvar}); 105 VarAttribute{nbvar+1}.Role='errorflag'; 106 106 end 107 107
Note: See TracChangeset
for help on using the changeset viewer.