Changeset 654 for trunk/src/read_field.m


Ignore:
Timestamp:
Jun 30, 2013, 11:16:45 PM (11 years ago)
Author:
sommeria
Message:

various bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_field.m

    r648 r654  
    4949        end
    5050    end
     51    check_colorvar=zeros(size(InputField));
    5152    if isfield(ParamIn,'ColorVar')
    5253        InputField=[ParamIn.FieldName {ParamIn.ColorVar}];
    53         check_colorvar=1;
     54        check_colorvar(numel(InputField))=1;
    5455    end
    5556end
     
    7071        for ilist=1:numel(InputField)
    7172            r=regexp(InputField{ilist},'(?<Operator>(^vec|^norm))\((?<UName>.+),(?<VName>.+)\)$','names');
    72             if isempty(r)
     73            if isempty(r)%  no operator used
    7374                ListVar=[ListVar InputField(ilist)];
     75                if check_colorvar(ilist)
     76                                    Role{numel(ListVar)}='ancillary';% not projected with interpolation
     77                ProjModeRequest{numel(ListVar)}='';
     78                else
    7479                Role{numel(ListVar)}='scalar';
    7580                ProjModeRequest{numel(ListVar)}='interp_lin';%scalar field (requires interpolation for plot)
    76             else
     81                end
     82            else  % an operator 'vec' or 'norm' is used
    7783                ListVar=[ListVar {r.UName,r.VName}];
    7884                Role{numel(ListVar)}='vector_y';
    7985                Role{numel(ListVar)-1}='vector_x';
    80                             switch r.Operator
    81                                 case 'norm'
     86                      if ~check_colorvar(ilist) && strcmp(r.Operator,'norm')
    8287                                    ProjModeRequest{numel(ListVar)-1}='interp_lin';%scalar field (requires interpolation for plot)
    8388                                    ProjModeRequest{numel(ListVar)}='interp_lin';
    84                                 otherwise
     89                      else
    8590                                   ProjModeRequest{numel(ListVar)-1}='';
    8691                                   ProjModeRequest{numel(ListVar)}='';
    8792                            end
    8893            end
    89         end
    90         if check_colorvar
    91             Role{numel(ListVar)}='ancillary';% scalar used for color vector (not projected)
    9294        end
    9395        if isfield(ParamIn,'TimeDimName')% case of reading of a single time index in a multidimensional array
Note: See TracChangeset for help on using the changeset viewer.