Ignore:
Timestamp:
May 20, 2010, 1:48:25 AM (14 years ago)
Author:
sommeria
Message:

many bug corrections and cleaning. Activation of the BW option in uvmat. Improvement of the interaction of get_field with uvmat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_field_indices.m

    r85 r89  
    11%'find_file_indices': test field structure for input in proj_field and plot_field
    2 %group the variables  into 'fields' with common dimensions
    3 %----------------------------------------------------------------------
     2%    group the variables  into 'fields' with common dimensions
     3%------------------------------------------------------------------------
    44% function [DimVarIndex,CellVarIndex,NbDim,VarType]=find_field_indices(Data)
    55%
    6 %OUTPUT:
     6% OUTPUT:
    77% CellVaxIndex: cell whose elements are arrays of indices in the list data.ListVarName 
    88%              CellvarIndex{i} represents a set of variables with the same dimensions
     
    1818%      .discrete: like scalar, but set of data points without continuity, represented as dots in a usual plot, instead of continuous lines otherwise
    1919%      .scalar: scalar field (default)
    20 %
     20%      .coord: vector of indices of coordinate variables corresponding to matrix dimensions
    2121%   
    22 %INPUT:
     22% INPUT:
    2323% Data: structure representing fields, output of check_field_structure
    2424%            .ListDimName: cell listing the names of the array dimensions
     
    153153        return
    154154    end
    155     NbDim(icell)=0;% nbre of space dimensions
    156     if numel(VarIndex)>1
     155    %NbDim(icell)=0;% nbre of space dimensions
     156    NbDim(icell)=numel(DimCell);
     157    test_coord=0;
     158    if numel(VarIndex)>1     
    157159        if ~isempty(ivar_coord_z)
    158160            NbDim(icell)=3;
     161            test_coord=1;
    159162        elseif ~isempty(ivar_coord_y)
    160163            NbDim(icell)=2;
     164            test_coord=1;
    161165        elseif ~isempty(ivar_coord_x)
    162166            NbDim(icell)=1;
     167            test_coord=1;
    163168        end
    164169    end
    165170    % look at coordinates variables 
    166171    coord=zeros(1,numel(DimCell));%default
    167     if NbDim(icell)==0 && ~isempty(VarDimName)% no unstructured coordinate found
     172%     if NbDim(icell)==0 && ~isempty(VarDimName)% no unstructured coordinate found
     173    if  ~test_coord && ~isempty(VarDimName)
    168174        for idim=1:numel(DimCell)   %loop on the dimensions of the variables in cell #icell
    169175            for ivardim=1:numel(VarDimName)
Note: See TracChangeset for help on using the changeset viewer.