Changeset 227 for trunk/src/plot_field.m


Ignore:
Timestamp:
Mar 31, 2011, 1:42:51 PM (10 years ago)
Author:
sommeria
Message:

add function sub_field_series to apply the sub_field operation to a series of fileds (for instance subtracting a background to an image series)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r221 r227  
    585585                XName=Data.ListVarName{ivar_X};
    586586                YName=Data.ListVarName{ivar_Y};
    587                 eval(['vec_X=Data.' XName ';'])
    588                 eval(['vec_Y=Data.' YName ';'])
     587                eval(['vec_X=reshape(Data.' XName ',[],1);'])
     588                eval(['vec_Y=reshape(Data.' YName ',[],1);'])
    589589            elseif numel(VarType.coord)==2 && ~isequal(VarType.coord,[0 0]);%coordinates defines by dimension variables
    590590                eval(['y=Data.' Data.ListVarName{VarType.coord(1)} ';'])
     
    627627        eval(['A=squeeze(Data.' Data.ListVarName{ivar_C} ');']) ;% scalar represented as color image
    628628        test_ima=1;
    629         if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates or structured ones (then ivar_X and ivar_Y empty)
     629        if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates  (then ivar_X and ivar_Y not empty)
     630            A=reshape(A,1,[]);
    630631            XName=Data.ListVarName{ivar_X};
    631632            YName=Data.ListVarName{ivar_Y};
    632             eval(['AX=Data.' XName ';'])
    633             eval(['AY=Data.' YName ';'])
     633            eval(['AX=reshape(Data.' XName ',1,[]);'])
     634            eval(['AY=reshape(Data.' YName ',1,[]);'])
    634635            [A,AX,AY]=proj_grid(AX',AY',A',[],[],'np>256');  % interpolate on a grid 
    635636            if isfield(Data,'VarAttribute')
Note: See TracChangeset for help on using the changeset viewer.