Changeset 581 for trunk/src/calc_field_tps.m
 Timestamp:
 Mar 12, 2013, 12:52:13 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/calc_field_tps.m
r575 r581 2 2 %'calc_field_tps': defines fields (velocity, vort, div...) from civ data and calculate them with tps interpolation 3 3 % 4 % [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord_tps,NbSites,SubRange,FieldVar, Operation,Coord_interp)4 % [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord_tps,NbSites,SubRange,FieldVar,FieldName,Coord_interp) 5 5 % 6 6 % OUTPUT: … … 12 12 % SubRange 13 13 % FieldVar 14 % Operation: cell array representing the list of operations (eg div, rot..)14 % FieldName: cell array representing the list of operations (eg div, rot..) 15 15 % Coord_interp: coordiantes of sites on which the fields need to be calculated 16 16 17 function [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord_tps,NbSites,SubRange,FieldVar, Operation,Coord_interp)17 function [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord_tps,NbSites,SubRange,FieldVar,FieldName,Coord_interp) 18 18 19 19 %list of defined scalars to display in menus (in addition to 'ima_cor'). … … 44 44 check_grid=0; 45 45 check_der=0; 46 for ilist=1:length( Operation)47 OperationType=regexprep(Operation{ilist},'(.+','');48 switch OperationType46 for ilist=1:length(FieldName) 47 FieldNameType=regexprep(FieldName{ilist},'(.+',''); 48 switch FieldNameType 49 49 case 'vec' 50 50 check_grid=1; … … 55 55 case {'U','V','norm'} 56 56 check_grid=1; 57 DataOut.( OperationType)=zeros(nb_sites,1);57 DataOut.(FieldNameType)=zeros(nb_sites,1); 58 58 VarAttribute{1}.Role='scalar'; 59 59 case {'curl','div','strain'} 60 60 check_der=1; 61 DataOut.( OperationType)=zeros(nb_sites,1);61 DataOut.(FieldNameType)=zeros(nb_sites,1); 62 62 VarAttribute{1}.Role='scalar'; 63 63 end … … 79 79 end 80 80 ListVar={}; 81 for ilist=1:length( Operation)81 for ilist=1:length(FieldName) 82 82 var_count=numel(ListVar); 83 switch Operation{ilist}83 switch FieldName{ilist} 84 84 case 'vec(U,V)' 85 85 ListVar=[ListVar {'U', 'V'}];
Note: See TracChangeset
for help on using the changeset viewer.