Changeset 586


Ignore:
Timestamp:
Mar 13, 2013, 9:12:09 AM (8 years ago)
Author:
sommeria
Message:

tps_coeff_field introduced and several bugs corrected

Location:
trunk/src
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r582 r586  
    406406    set(handles.CheckScalar,'Value',0)
    407407    set(handles.PanelVectors,'Visible','on')
     408    set(handles.XVarName,'Visible','on')
     409    set(handles.YVarName,'Visible','on')
     410    set(handles.X_title,'Visible','on')
     411    set(handles.Y_title,'Visible','on')
    408412end
    409413
     
    413417function scalar_Callback(hObject, eventdata, handles)
    414418%------------------------------------------------------------------------
     419Field=get(handles.get_field,'UserData');
    415420index=get(handles.scalar,'Value');
    416421string=get(handles.scalar,'String');
     
    420425%eliminate time
    421426TimeDimName='';%default
    422 if strcmp(get(handles.TimeDimensionMenu,'Visible'),'on')
    423     TimeDimList=get(handles.TimeDimensionMenu,'String');
    424     TimeDimIndex=get(handles.TimeDimensionMenu,'Value');
    425     TimeDimName=TimeDimList{TimeDimIndex};
    426 end
     427SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String');
     428TimeVarOption=SwitchVarIndexTime{get(handles.SwitchVarIndexTime,'Value')};
     429if strcmp(TimeVarOption,'variable')
     430    List=get(handles.TimeVarName,'String');
     431    TimeVarName=List{get(handles.TimeVarName,'Value')};
     432elseif  strcmp(TimeVarOption,'dim index')
     433    List=get(handles.TimeVarName,'String');
     434    TimeDimName=List{get(handles.TimeVarName,'Value')};
     435end
     436% A completer
     437% if strcmp(get(handles.TimeDimensionMenu,'Visible'),'on')
     438%     TimeDimList=get(handles.TimeDimensionMenu,'String');
     439%     TimeDimIndex=get(handles.TimeDimensionMenu,'Value');
     440%     TimeDimName=TimeDimList{TimeDimIndex};
     441% end
    427442
    428443%check possible coordinates
     
    432447for ilist=1:numel(Field.VarDimName)
    433448    dimnames=Field.VarDimName{ilist}; %list of dimensions for variable #ilist
    434     if isequal(dimnames,{TimeDimName})
     449    if isequal(dimnames,TimeDimName)
    435450        test_coord(ilist)=0;%mark time variables fo elimination
     451    end
     452    if ischar(dimnames)
     453        dimnames={dimnames};
    436454    end
    437455    for idim=1:numel(dimnames)
  • trunk/src/proj_field.m

    r581 r586  
    21872187
    21882188%% transfer coordinate unit
     2189if isfield(ProjData,'CoordUnit')
     2190    ProjData=rmfield(ProjData,'CoordUnit');% do not transfer by default (to avoid x/y=1 for profiles)
     2191end
    21892192if isfield(FieldData,'CoordUnit')
    21902193    if isfield(ObjectData,'CoordUnit') && ~strcmp(FieldData.CoordUnit,ObjectData.CoordUnit)
    21912194        errormsg=[ObjectData.Type ' in ' ObjectData.CoordUnit ' coordinates, while field in ' FieldData.CoordUnit ];
    21922195        return
    2193     else
     2196    elseif strcmp(ObjectData.Type,'plane')|| strcmp(ObjectData.Type,'volume')
    21942197         ProjData.CoordUnit=FieldData.CoordUnit;
    21952198    end
  • trunk/src/series.m

    r554 r586  
    13741374set(handles.RUN,'BackgroundColor',[1 0 0])
    13751375set(handles.RUN,'enable','on')
    1376 % set(handles.BATCH,'BackgroundColor',[1 0 0])
    1377 % set(handles.BATCH,'enable','on')
    1378 
    1379 %------------------------------------------------------------------------
    1380 % --- Executes on button press in BATCH.
    1381 function BATCH_Callback(hObject, eventdata, handles)
    1382 %------------------------------------------------------------------------   
    1383 
    13841376
    13851377% %------------------------------------------------------------------------
     
    14701462index=get(handles.ActionName,'Value');
    14711463action= list_action{index}; % selected string
    1472 %Series.Action=action;%name of the processing programme
    14731464Series.hseries=handles.series; % handles to the series GUI
    14741465path_series=which('series');
     
    15201511    end
    15211512    Series.OutputDirExt=regexprep(SubDirOutNew,Series.OutputSubDir,'');
    1522  %   Series.OutputSubDir=SubDirOutNew;
    1523  %   Series.OutputDir=fullfile(Series.InputTable{1,1},Series.OutputSubDir);%directory set for output results
    15241513    Series.OutputRootFile=Series.InputTable{1,3};% the first sorted RootFile taken for output
    15251514    set(handles.OutputDirExt,'String',Series.OutputDirExt)
     
    20562045set(handles.PairString,'Unit','normalized')
    20572046set(handles.PairString,'ColumnWidth',{Pos(3)-5})
     2047
     2048
     2049% --- Executes on button press in status.
     2050function status_Callback(hObject, eventdata, handles)
     2051val=get(handles.status,'Value');
     2052if val==0
     2053    set(handles.status,'BackgroundColor',[0 1 0])
     2054    hfig=findobj(allchild(0),'name','series_status');
     2055    if ~isempty(hfig)
     2056        delete(hfig)
     2057    end
     2058    return
     2059end
     2060set(handles.status,'BackgroundColor',[1 1 0])
     2061drawnow
     2062% listtype={'civ1','fix1','patch1','civ2','fix2','patch2'};
     2063% Param.CheckCiv1=get(handles.CheckCiv1,'Value');
     2064% Param.CheckFix1=get(handles.CheckFix1,'Value');
     2065% Param.CheckPatch1=get(handles.CheckPatch1,'Value');
     2066% Param.CheckCiv2=get(handles.CheckCiv2,'Value');
     2067% Param.CheckFix2=get(handles.CheckFix2,'Value');
     2068% Param.CheckPatch2=get(handles.CheckPatch2,'Value');
     2069% box_test=[Param.CheckCiv1 Param.CheckFix1 Param.CheckPatch1 Param.CheckCiv2 Param.CheckFix2 Param.CheckPatch2];
     2070%
     2071% option_civ=find(box_test,1,'last');%last selected option (non-zero index of box_test)
     2072% filecell=get(handles.civ,'UserData');%retrieve the list of output files expected for PIV
     2073% test_new=0;
     2074% if ~isfield(filecell,'nc')
     2075%     test_new=1;
     2076%     [ref_i,ref_j,errormsg]=find_ref_indices(handles);
     2077%     if ~isempty(errormsg)
     2078%         msgbox_uvmat('ERROR',errormsg)
     2079%         return
     2080%     end
     2081%     filecell=set_civ_filenames(handles,ref_i,ref_j,box_test);%determine the output file expected from the GUI status
     2082% end
     2083% if ~isequal(box_test(4:6),[0 0 0])
     2084%     civ_files=filecell.nc.civ2;%case of civ2 operations
     2085% else
     2086%     civ_files=filecell.nc.civ1;
     2087% end
     2088hfig=findobj(allchild(0),'name','series_status');
     2089if isempty(hfig)
     2090    hfig=figure('DeleteFcn',@stop_status);
     2091    set(hfig,'MenuBar','none')% suppress the menu bar
     2092    set(hfig,'NumberTitle','off')%suppress the fig number in the title
     2093    set(hfig,'name','series_status')
     2094    set(hfig,'tag','series_status')
     2095%    set(hfig,'UserData',civ_files)
     2096    hlist= uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.09 0.9 0.71], 'Callback', {'open_uvmat'},'tag','list');
     2097    uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.87 0.9 0.1],'tag','msgbox','Max',2,'String','checking files...');
     2098    uicontrol('Style','frame','Units','normalized', 'Position', [0.05 0.81 0.9 0.05]);
     2099    uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.7 0.01 0.2 0.07],'String','Close','FontWeight','bold','FontUnits','normalized','FontSize',0.9,'Callback',@close_GUI);
     2100    hrefresh=uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.1 0.01 0.2 0.07],'String','Refresh','FontWeight','bold','FontUnits','normalized','FontSize',0.9,'Callback',@refresh_GUI);
     2101    BarPosition=[0.05 0.81 0.01 0.05];
     2102    uicontrol('Style','frame','Units','normalized', 'Position',BarPosition ,'BackgroundColor',[1 0 0],'tag','waitbar');
     2103    drawnow
     2104end
     2105StatusData.time_ref=get(handles.RUN,'UserData');% get the time of launch
     2106% StatusData.option_civ=option_civ;
     2107set(hrefresh,'UserData',StatusData)
     2108Param=read_GUI(handles.series);
     2109RootPath=Param.InputTable{1,1};
     2110SubDir=Param.InputTable{1,2};
     2111OutputSubDir=[Param.OutputSubDir Param.OutputDirExt];% subdirectory for output files
     2112OutputDir=fullfile(RootPath,SubDir,OutputSubDir);
     2113set(hlist,'UserData',OutputDir)
     2114%refresh_GUI(hrefresh,[])
  • trunk/src/set_object.m

    r581 r586  
    486486else
    487487    % create tps coeff if needed for ProjMode 'interp_tps'
    488     if strcmp(ObjectData.ProjMode,'interp_tps')&&~isfield(UvData.Field,'Coord_tps')     
    489         UvData.Field=calc_tps(UvData.Field,1);
     488    if strcmp(ObjectData.ProjMode,'interp_tps')&&~isfield(UvData.Field,'Coord_tps')
     489        %UvData.Field=calc_tps(UvData.Field,1);
     490        [UvData.Field,errormsg]=tps_coeff_field(UvData.Field,1);
     491        if ~isempty(errormsg)
     492            msgbox_uvmat('ERROR', ['set_object/tps_coeff_field/' errormsg])
     493            set(handles.PLOT,'enable','on')
     494            return
     495        end
    490496    end
    491497    [ProjData,errormsg]= proj_field(UvData.Field,ObjectData);%project the current field of uvmat on ObjectData
    492498    if ~isempty(errormsg)
    493         msgbox_uvmat('ERROR', errormsg)
     499        msgbox_uvmat('ERROR', ['set_object/proj_field/' errormsg])
    494500        set(handles.PLOT,'enable','on')
    495501        return
    496     end   
     502    end
    497503    if isequal(IndexObj_1,IndexObj) % if  the projection is in uvmat
    498          PlotType=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(get(hhuvmat.PlotAxes,'parent')));%update the current uvmat plot
     504        PlotType=plot_field(ProjData,hhuvmat.PlotAxes,read_GUI(get(hhuvmat.PlotAxes,'parent')));%update the current uvmat plot
    499505    else  % if the projection is in view_field
    500506        hview_field=findobj(allchild(0),'tag','view_field');
     
    509515                return
    510516            end
    511        %     write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
     517            %     write_plot_param(hhview_field,PlotParam); %update the display of plotting parameters for the current object
    512518        end
    513519        haxes=findobj(hview_field,'tag','axes3');
     
    523529            set(hview_field,'Position',Data.GUISize)
    524530        end
    525       %  set(hhuvmat.ViewField,'Value',1)% indicate that the field projection on the current object is plotted in view_field
     531        %  set(hhuvmat.ViewField,'Value',1)% indicate that the field projection on the current object is plotted in view_field
    526532    end
    527533end
  • trunk/src/tps_coeff.m

    r581 r586  
    2929function [U_smooth,U_tps]=tps_coeff(ctrs,U,Smoothing)
    3030%------------------------------------------------------------------------
    31 
     31warning off
    3232N=size(ctrs,1);% nbre of source centres
    3333NbDim=size(ctrs,2);% space dimension (2 or 3)
  • trunk/src/uvmat.m

    r582 r586  
    31093109        UName=GetFieldData.PanelVectors.vector_x;
    31103110        VName=GetFieldData.PanelVectors.vector_y;
    3111         XName=GetFieldData.PanelVectors.coord_x_vectors;
    3112         YName=GetFieldData.PanelVectors.coord_y_vectors;
     3111        XName=GetFieldData.XVarName;
     3112        YName=GetFieldData.YVarName;
    31133113        CName=GetFieldData.PanelVectors.vec_color;
    31143114        [FieldList,VecColorList]=set_field_list(UName,VName,CName);
     
    31273127    if GetFieldData.CheckScalar
    31283128        AName=GetFieldData.PanelScalar.scalar;
    3129         XName=GetFieldData.PanelScalar.coord_x_scalar;
    3130         YName=GetFieldData.PanelScalar.coord_y_scalar;
     3129        XName=GetFieldData.XVarName;
     3130        YName=GetFieldData.YVarName;
    31313131        FieldList={AName};
    31323132    end
Note: See TracChangeset for help on using the changeset viewer.