Changeset 1023


Ignore:
Timestamp:
Dec 12, 2017, 7:18:01 PM (7 years ago)
Author:
sommeria
Message:

bug repaired for ordinary plots

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_field_cells.m

    r1009 r1023  
    300300check_remove=false(size(CellInfo));
    301301for icell=1:numel(check_remove)
    302     if isempty(CellInfo{icell})||(numel(CellInfo{icell}.VarIndex)==1 && check_coord(icell))
     302    if isempty(CellInfo{icell})||(numel(CellInfo{icell}.VarIndex)==1 && numel(check_coord)>=icell && check_coord(icell))
    303303        check_remove(icell)=1;
    304304    end
  • trunk/src/get_field.m

    r1009 r1023  
    196196    set(handles.scalar,'Max',1)
    197197end
     198
     199%% set default field options
     200checknbdim=cellfun('size',Field.Display.VarDimName,2);
     201if max(checknbdim)<=1
     202    Field.MaxDim=1;% only 1D fields, considered as a time series by default
     203end
    198204if Field.MaxDim>=2 && ~checkseries% case of 2D (or 3D) fields
    199205    check_vec_input=0;
     
    215221        set(handles.FieldOption,'Value',3)% set vector selection option
    216222    else
     223       
    217224        set(handles.FieldOption,'Value',2)% set scalar selection option
    218225    end
  • trunk/src/uvmat.m

    r1022 r1023  
    35533553    UvData.NewSeries=1;
    35543554end
    3555 %put W as background image by default if NbDim=2:
    3556 % if  UvData.NewSeries && isequal(get(handles.SubField,'Value'),0) && isfield(Field{1},'W') && ~isempty(Field{1}.W) && ~isequal(Field{1}.NbDim,3);
    3557 %         set(handles.SubField,'Value',1);
    3558 %         set(handles.RootPath_1,'String','"')
    3559 %         set(handles.RootFile_1,'String','"')
    3560 %         set(handles.SubDir_1,'String','"');
    3561 %          indices=fullfile_uvmat('','','','',NomType,num_i1,num_i2,num_j1,num_j2);
    3562 %         set(handles.FileIndex_1,'String',indices)
    3563 %         set(handles.FileExt_1,'String','"');
    3564 %         set(handles.FieldName_1,'Visible','on');
    3565 %         set(handles.FieldName_1,'Visible','on');
    3566 %         set(handles.RootPath_1,'Visible','on')
    3567 %         set(handles.RootFile_1,'Visible','on')
    3568 %         set(handles.SubDir_1,'Visible','on');
    3569 %         set(handles.FileIndex_1,'Visible','on');
    3570 %         set(handles.FileExt_1,'Visible','on');
    3571 %         set(handles.FieldName_1,'Visible','on');
    3572 %         Field{1}.AName='w';
    3573 % end
    35743555
    35753556%% display time value of the current file
     
    37293710end
    37303711
    3731 %% get bounds and dimensions of the input field
    3732 UvData.Field=find_field_bounds(UvData.Field);
    37333712testnewseries=UvData.NewSeries;
    37343713UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback)
    37353714
    37363715
    3737 %% calculate tps coefficients if needed
    3738 UvData.Field=tps_coeff_field(UvData.Field,check_proj_tps);
    3739 
    3740 %% reset the min and max of scalar if only the mask is displayed(TODO: check the need)
    3741 % if isfield(UvData,'Mask')&& ~isfield(UvData,'A')
    3742 %     set(handles.num_MinA,'String','0')
    3743 %     set(handles.num_MaxA,'String','255')
    3744 % end
    3745 
    3746 %% usual 1D (x,y) plots
    3747 if UvData.Field.NbDim<=1
     3716%% usual (x,y) plot
     3717if strcmp(FieldName,'')
    37483718    set(handles.Objects,'Visible','off')
    37493719    set(handles.CheckFixAspectRatio,'Value',0)
     3720    coord_x_name=get(handles.Coord_x,'String');
     3721    check_x_name=find(strcmp(coord_x_name,UvData.Field.ListVarName));
     3722    UvData.Field.VarAttribute{check_x_name}.Role='coord_x';
    37503723    [PlotType,PlotParamOut,haxes]=plot_field(UvData.Field,handles.PlotAxes,read_GUI(handles.uvmat));
    37513724    UvData.PlotAxes=UvData.Field; %store data for further plot modifications
     
    37643737    end
    37653738    cla(handles.HistoAxes)% clear the curves and legend in histogram axes
     3739    UvData.Field.NbDim=1;
    37663740    set(handles.uvmat,'UserData',UvData)
     3741   
    37673742%% 2D or 3D fieldname are generally projected
    37683743else
     3744    UvData.Field=find_field_bounds(UvData.Field);
     3745
     3746%% get bounds and dimensions of the input field
     3747
     3748%% calculate tps coefficients if needed
     3749    UvData.Field=tps_coeff_field(UvData.Field,check_proj_tps);
     3750
     3751%% reset the min and max of scalar if only the mask is displayed(TODO: check the need)
     3752% if isfield(UvData,'Mask')&& ~isfield(UvData,'A')
     3753%     set(handles.num_MinA,'String','0')
     3754%     set(handles.num_MaxA,'String','255')
     3755% end
    37693756    set(handles.Objects,'Visible','on')
    37703757
     
    44544441            case '1D plot'
    44554442                YName=GetFieldData.PanelOrdinate.ordinate;
     4443                FieldList={''};         
    44564444            case 'civdata...'%reinitiate input, return to automatic civ data reading
    44574445                display_file_name(handles,FileName,1)
Note: See TracChangeset for help on using the changeset viewer.