Ignore:
Timestamp:
Mar 3, 2010, 1:47:56 PM (14 years ago)
Author:
sommeria
Message:

-subfunction find_file_indices put back in series (it had been extracted by mistake to check_files
-aver_stat: name of output file rationalized
-read_get_field : pb with vector fields, yet to solve

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_get_field.m

    r19 r32  
    1 %'read_get_field': read the list of selected variables from the GUI get_field (SAME AS THE FIRST
     1%'read_get_field': read the list of selected variables from the GUI get_field
     2
     3% OUTPUT:
     4% SubField: structure with fields
     5   %  .ListVarName: list of selected variables
     6   %  .VarDimName: cells with the  corresponding dimension names
     7   %  .Field1, 2...: if an input file has been opened by get_field
     8% errormsg: error message (=[] when no error)
     9
    210% INPUT:
    311% hget_field: handles of the GUI get_field
     
    3442dim_vec_z=0;
    3543c_index=[];
     44
     45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     46%  ordinary (1D) plot
    3647if test_1Dplot
    37      % select ordinate variable(s)
     48    % select ordinate variable(s)
    3849    inputlist=get(handles.ordinate,'String');
    3950    val=get(handles.ordinate,'Value');% selection(s) for ordinate
     
    4253        VarIndex_y(ilist)=name2index(VarNameCell{ilist},Field.ListVarName);%index of the variable in ListVarName
    4354        dim_ordinate{ilist}=Field.VarDimName{VarIndex_y(ilist)};% name of the corresponding dimension
    44 %         if iscell(dim_ordinate{ilist})
    45 %             dim_ordinate{ilist}=dim_ordinate{ilist}{1};%take the first dimension name (char chain) in case of a matrix
    46 %         end
    4755        testpermute(ilist)=0;%default
    4856        nbvar=nbvar+1;
     
    5664    end
    5765   
    58         % select abscissa variable
     66    % select abscissa variable
    5967    inputlist=get(handles.abscissa,'String');
    6068    val=get(handles.abscissa,'Value');% a single selection is expected for abscissa
     
    95103    end
    96104end
    97 
    98105test3D=strcmp(get(handles.coord_z_scalar,'Visible'),'on')||strcmp(get(handles.coord_z_vectors,'Visible'),'on');
    99106VarSubIndexA=[];
    100107
    101 %scalar variable
     108%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     109%scalar field
    102110test_xdimvar=0;%default
    103111test_ydimvar=0;%default
     
    233241   end
    234242end
     243
     244%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     245% vectors
    235246test_vec_x_dimvar=0;%default
    236247test_vec_y_dimvar=0;%default
     
    278289        SubVarAttribute{nbvar}=VarAttribute{VarIndexV};
    279290    end
    280     SubVarAttribute{nbvar}.Role='vector_y';
    281    
     291    SubVarAttribute{nbvar}.Role='vector_y';   
    282292 
    283      % select x variable for vector
     293    % select x variable for vector
    284294    inputlist=get(handles.coord_x_vectors,'String');
    285295    val=get(handles.coord_x_vectors,'Value');% a single selection is expected for abscissa
     
    287297    VarIndex=name2index(VarName,Field.ListVarName);%index of the variable in ListVarName
    288298    if isempty(VarIndex)% default abscissa = matrix indexTODO like scalar
    289 %         coord_x_name=dimname_u{2};% name of the x coordinate = dimension of the plotted quantity
    290299        empty_coord_vec_x=1;
    291300    else
     
    315324    end
    316325       
    317          % select y variable for vector
     326     % select y variable for vector
    318327    inputlist=get(handles.coord_y_vectors,'String');
    319328    val=get(handles.coord_y_vectors,'Value');% a single selection is expected for abscissa
     
    321330    VarIndex=name2index(VarName,Field.ListVarName);%index of the variable in ListVarName
    322331    if isempty(VarIndex)% default abscissa = matrix indexTODO like scalar
    323 %         coord_x_name=dimname_u{2};% name of the x coordinate = dimension of the plotted quantity
    324332        empty_coord_vec_y=1;
    325333    else
     
    383391        end       
    384392    end   
    385        
    386      
    387      if test3D %  (a revoir) 
     393           
     394    if test3D %  (a revoir) 
    388395         %scalar w variable
    389396        inputlist=get(handles.vector_z,'String');
     
    428435    end
    429436end
     437%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    430438
    431439% get the input field
     
    434442    SubField=nc2struct(inputfield,ListVarName);
    435443else  % subfield stored in memory
     444    SubField.ListGlobalAttribute={};
    436445    SubField.ListVarName=ListVarName;
    437446    SubField.VarDimName=VarDimName;
     
    441450SubField.VarAttribute=SubVarAttribute;
    442451
    443 %permute indices if coord_y is not the first matrix index
     452%permute indices if coord_y is not the first matrix index: scalar case
    444453if test_scalar
    445454    VarNameA=Field.ListVarName{VarIndexA};
     
    560569end
    561570
    562 %permute indices if coord_y is not the first matrix index
     571%permute indices if coord_y is not the first matrix index: vector case
    563572if test_vector
    564573    VarNameU=Field.ListVarName{VarIndexU};
    565     DimCellU=Field.VarDimName{VarIndexU};  
    566     eval(['npxy=size(SubField.' VarNameU ')'])
     574    DimCellU=Field.VarDimName{VarIndexU} % list of dimensions for u component 
     575    eval(['npxy=size(SubField.' VarNameU ')']) % npxy= dimension values for the u component
    567576    SingleCellU={};
    568577    if numel(npxy) < numel(DimCellU)
Note: See TracChangeset for help on using the changeset viewer.