Changeset 516


Ignore:
Timestamp:
Aug 16, 2012, 8:47:11 AM (12 years ago)
Author:
sommeria
Message:

various bug corrections

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/calc_field_interp.m

    r515 r516  
    1717function [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp(Coord,FieldVar,Operation,XI,YI)
    1818
    19 %% nbre of subdomains
    20 % if ndims(Coord_interp)==3
    21 %     nb_coord=size(Coord_interp,3);
    22 %     npx=size(Coord_interp,2);
    23 %     npy=size(Coord_interp,1);
    24 %     nb_sites=npx*npy;
    25 %     Coord_interp=reshape(Coord_interp,nb_sites,nb_coord);
    26 % else
    27 %     nb_coord=size(Coord_interp,2);
    28 %     nb_sites=size(Coord_interp,1);
    29 % end
    3019VarVal=[];
    3120ListVarName={};
  • trunk/src/calc_tps.m

    r515 r516  
    1515        if ~isempty(VarType.vector_x)&&~isempty(VarType.vector_y)
    1616            Attr=DataIn.VarAttribute{VarType.vector_x};
    17             if ~isfield(Attr,'VarIndex_tps')&& (checkall || (isfield(Attr,'FieldRequest')&&strcmp(Attr.FieldRequest,'derivatives')))               
     17            if ~isfield(Attr,'VarIndex_tps')&& (checkall || (isfield(Attr,'FieldRequest')&&strcmp(Attr.FieldRequest,'interp_tps')))               
    1818                U=DataIn.(DataIn.ListVarName{VarType.vector_x});
    1919                V=DataIn.(DataIn.ListVarName{VarType.vector_y});
     
    5252        DataOut.VarAttribute{nbvar+5}=DataIn.VarAttribute{VarType.vector_y};%reproduce attributes of velocity
    5353         DataOut.VarAttribute{nbvar+5}.Role='vector_y_tps';
    54 %          if isfield(DataOut.VarAttribute{VarType.vector_x},'FieldRequest')
    55 %              DataOut.VarAttribute{VarType.vector_x}=rmfield(DataOut.VarAttribute{VarType.vector_x},'FieldRequest');
    56 %          end
    57 %          if isfield(DataOut.VarAttribute{VarType.vector_x},'Operation')
    58 %              DataOut.VarAttribute{VarType.vector_x}=rmfield(DataOut.VarAttribute{VarType.vector_x},'Operation');
    59 %          end
    60         if isfield(DataOut,'ListDimName')%cleaning'FieldRequest'
     54        if isfield(DataOut,'ListDimName')%cleaning'
    6155            DataOut=rmfield(DataOut,'ListDimName');
    6256        end
  • trunk/src/find_field_cells.m

    r515 r516  
    2020%      .coord: vector of indices of coordinate variables corresponding to matrix dimensions
    2121%
    22 %      .FieldRequest= 'interp', 'derivatives' indicate whether interpolation  or derivatives (tps) is needed to calculate the requested field
     22%      .FieldRequest= 'interp_lin', 'interp_tps' indicate whether lin interpolation  or derivatives (tps) is needed to calculate the requested field
    2323%      .FieldNames = cell of fields to calculate from the fied cell
    2424%
  • trunk/src/proj_field.m

    r515 r516  
    980980    if isfield(VarTypeCell{icell},'FieldRequest')
    981981        switch VarTypeCell{icell}.FieldRequest
    982             case 'interp'
     982            case 'interp_lin'
    983983                ProjMode{icell}='interp';
    984             case 'derivatives'
     984            case 'interp_tps'
    985985                ProjMode{icell}='filter';
    986986        end
     
    12251225                    VarDimName{ilist}={'coord_y','coord_x'};
    12261226                end
    1227 %                 if ~isfield(ProjData,'coord_x')
    1228 %                 ProjData.coord_x=[XMin XMax];
    1229 %                 ProjData.coord_y=[YMin YMax];
    1230 %                 ListFieldProj=[{'coord_x','coord_y'} ListFieldProj'];
    1231 %                 VarDimName=[{'coord_x','coord_y'} VarDimName];
    1232 %                 VarAttribute=[{[],[]} VarAttribute];
    1233 %                 end
    12341227                ProjData.ListVarName=[ProjData.ListVarName ListFieldProj];
    12351228                ProjData.VarDimName=[ProjData.VarDimName VarDimName];
     
    12761269            ProjData.ListVarName=[ProjData.ListVarName {AYProjName} {AXProjName}]; %TODO: check if it already exists in Projdata (several cells)
    12771270            ProjData.VarDimName=[ProjData.VarDimName {AYProjName} {AXProjName}];
     1271            ProjData.VarAttribute=[ProjData.VarAttribute {[]} {[]}];
    12781272            Coord_z=[];
    12791273            Coord_y=[];
  • trunk/src/read_GUI.m

    r497 r516  
    5757                        if ~isempty(listinput)
    5858                            if numel(value)==1% single selection
     59                                if ischar(listinput)
     60                                    input=listinput;
     61                                else
    5962                            input=listinput{value};
     63                                end
    6064                            else % multiple selection
    6165                              input=listinput(value); 
  • trunk/src/read_civdata.m

    r515 r516  
    6464errormsg='';
    6565if ischar(FieldNames), FieldNames={FieldNames}; end;
    66 FieldRequest='vec';
     66FieldRequest='';
    6767for ilist=1:length(FieldNames)
    6868    if ~isempty(FieldNames{ilist})
    6969        switch FieldNames{ilist}
    7070            case{'U','V','norm(U,V)'}
    71                 FieldRequest='interp';
     71                FieldRequest='interp_lin';
    7272            case {'curl(U,V)','div(U,V)','strain(U,V)'}
    73                 FieldRequest='derivatives';
     73                FieldRequest='interp_tps';
    7474        end
    7575    end
     
    128128    Field.VarAttribute{ivar_U}.VarIndex_tps=ivar_U_tps;
    129129end
    130 % if strcmp(FieldRequest,'derivatives')% fields will be calculated from the tps
    131 %     Field.VarAttribute{ivar_U_tps}.FieldRequest=FieldRequest;
    132 %     Field.VarAttribute{ivar_U_tps}.Operation=FieldNames;
    133 % else% fields will be calculated from the initial fields
    134 %     Field.VarAttribute{ivar_U}.FieldRequest=FieldRequest;%
    135 %     Field.VarAttribute{ivar_U}.Operation=FieldNames;
    136 % end
    137130
    138131Field.ListGlobalAttribute=[Field.ListGlobalAttribute {'NbCoord','NbDim','TimeUnit','CoordUnit'}];
     
    211204       % units={'pixel','pixel','pixel','pixel','pixel','pixel','','','','pixel','pixel','pixel','pixel','pixel',''};
    212205end
    213 if ~strcmp(FieldRequest,'derivatives')
     206if ~strcmp(FieldRequest,'interp_tps')
    214207    var=var(:,1:9);%suppress tps if not needed
    215208end
  • trunk/src/read_field.m

    r497 r516  
    4343    switch FileType
    4444        case {'civx','civdata','netcdf'}  %read the first nc field
    45             %         ParamOut.FieldName=ParamIn.FieldName;
    4645            GUIName='get_field'; %default name of the GUI get_field
    4746            if isfield(ParamIn,'GUIName')
     
    115114                    set(hhget_field.TimeIndexValue,'String',num2str(num))
    116115                end
    117                 funct_list=get(hhget_field.ACTION,'UserData');
    118                 funct_index=get(hhget_field.ACTION,'Value');
    119                 funct=funct_list{funct_index};%select  the current action in get_field, e;g. PLOT
    120                 Field=funct(hget_field); %%activate the current action selected in get_field, e;g.read the names of the variables to plot
     116%                 funct_list=get(hhget_field.ACTION,'UserData');
     117%                 funct_index=get(hhget_field.ACTION,'Value');
     118%                 funct=funct_list{funct_index};%select  the current action in get_field, e;g. PLOT
     119%                 Field=funct(hget_field); %%activate the current action selected in get_field, e;g.read the names of the variables to plot
     120                [Field,errormsg]=read_get_field(hget_field);
    121121                Tabchar={''};%default
    122122                Tabcell=[];
  • trunk/src/uvmat.m

    r515 r516  
    22162216% display the Fields menu from the input file and pick the selected one:
    22172217if isstruct(ParamOut)
    2218 field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList);
    2219 set(handles.Fields,'String',ParamOut.FieldList); %update the field menu
    2220 set(handles.Fields,'Value',find(field_index,1))
     2218    field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList);
     2219    set(handles.Fields,'String',ParamOut.FieldList); %update the field menu
     2220    set(handles.Fields,'Value',find(field_index,1))
    22212221end
    22222222
Note: See TracChangeset for help on using the changeset viewer.