Ignore:
Timestamp:
Mar 12, 2013, 12:52:13 PM (8 years ago)
Author:
sommeria
Message:

clean the transform field functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/calc_field_tps.m

    r575 r581  
    22%'calc_field_tps': defines fields (velocity, vort, div...) from civ data and calculate them with tps interpolation
    33%---------------------------------------------------------------------
    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)
    55%
    66% OUTPUT:
     
    1212% SubRange
    1313% 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..)
    1515% Coord_interp: coordiantes of sites on which the fields need to be calculated
    1616
    17 function [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord_tps,NbSites,SubRange,FieldVar,Operation,Coord_interp)
     17function [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord_tps,NbSites,SubRange,FieldVar,FieldName,Coord_interp)
    1818
    1919%list of defined scalars to display in menus (in addition to 'ima_cor').
     
    4444check_grid=0;
    4545check_der=0;
    46 for ilist=1:length(Operation)
    47     OperationType=regexprep(Operation{ilist},'(.+','');
    48     switch OperationType
     46for ilist=1:length(FieldName)
     47    FieldNameType=regexprep(FieldName{ilist},'(.+','');
     48    switch FieldNameType
    4949        case 'vec'
    5050            check_grid=1;
     
    5555        case {'U','V','norm'}
    5656            check_grid=1;
    57             DataOut.(OperationType)=zeros(nb_sites,1);
     57            DataOut.(FieldNameType)=zeros(nb_sites,1);
    5858            VarAttribute{1}.Role='scalar';
    5959        case {'curl','div','strain'}
    6060            check_der=1;
    61             DataOut.(OperationType)=zeros(nb_sites,1);
     61            DataOut.(FieldNameType)=zeros(nb_sites,1);
    6262            VarAttribute{1}.Role='scalar';
    6363    end
     
    7979    end
    8080    ListVar={};
    81     for ilist=1:length(Operation)
     81    for ilist=1:length(FieldName)
    8282        var_count=numel(ListVar);
    83         switch Operation{ilist}
     83        switch FieldName{ilist}
    8484            case 'vec(U,V)'
    8585                ListVar=[ListVar {'U', 'V'}];
Note: See TracChangeset for help on using the changeset viewer.