Changeset 128 for trunk/src/get_field.m


Ignore:
Timestamp:
Nov 21, 2010, 10:06:11 PM (13 years ago)
Author:
sommeria
Message:

series: give writting access to the group for all subdirectories produced
uvmat.fig: change of vect and scalar frames (to be consistent with view_field)
uvmat: various cleaning
plot_field: various cleaning to improve axes definition and avoid blinking
geometry_calib: improved dispay of point coordiantes, improved link with dataview for REPLICATE.
struct2nc: repair bug , file was not closed.
cell2tab: cleaning
dataview: improve the browser
civ: solve pb of image naming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r107 r128  
    3232                   'gui_LayoutFcn',  [] , ...
    3333                   'gui_Callback',   []);
    34 if nargin & isstr(varargin{1})
     34if nargin && ischar(varargin{1})&& ~isempty(regexp(varargin{1},'_Callback','once'))
    3535    gui_State.gui_Callback = str2func(varargin{1});
    3636end
     
    4848%------------------------------------------------------------------------
    4949global nb_builtin
     50
     51%% look at the existing figues in the work space
    5052browse_fig(handles.list_fig)
    5153
    52 % Choose default command line output for get_field
     54%% Choose default command line output for get_field
    5355handles.output = hObject;
    5456
    55 % Update handles structure
     57%% Update handles structure
    5658guidata(hObject, handles);
    5759
    58 %ACTION menu: builtin fcts
    59 menu_str={'PLOT';'FFT';'filter_band';'histogram'}; %list of functions included in 'get_field.m'
     60%% activate the mouse action function: visualise the current field on work space by right click action
     61set(hObject,'WindowButtonUpFcn',{@mouse_up_gui,handles})
     62
     63%% prepare the list of builtin fcts and set their paths
     64menu_str={'PLOT';'FFT';'filter_band';'histogram'}; %list of functions included by default in 'get_field.m'
    6065nb_builtin=numel(menu_str);
    6166path_uvmat=fileparts(which('uvmat'));%path of the function 'uvmat'
     
    7277end
    7378rmpath(fullfile(path_uvmat,'get_field'))
    74 
    7579dir_perso=prefdir;
    7680profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     
    102106set(handles.path_action,'String',fullfile(path_uvmat,'get_field'))
    103107set(handles.ACTION,'Value',1)% PLOT option selected
    104 set(hObject,'WindowButtonUpFcn',{@mouse_up_gui,handles})%set mouse click action function
    105 if exist('filename','var')& ischar(filename)
     108
     109%% settings for 'slave' mode, called by uvamt, or 'master' mode
     110if exist('filename','var') && ischar(filename) %transfer input file name in slave mode
    106111    set(handles.inputfile,'String',filename)% prefill the input file name
    107112    set(handles.inputfile,'Enable','off')% desactivate the input file edit box   
     
    113118    set(handles.MenuHelp,'Visible','off')
    114119    inputfile_Callback(hObject, eventdata, handles)
    115 else
     120else  %master mode
    116121    set(handles.inputfile,'String','')   
    117 end
    118 %ACTION_Callback(hObject, eventdata, handles)
    119 if exist('Field','var') & isstruct(Field)
     122    % load the list of previously browsed files for the upper bar menu Open
     123    dir_perso=prefdir;
     124    profil_perso=fullfile(dir_perso,'uvmat_perso.mat');%
     125    if exist(profil_perso,'file')
     126        h=load (profil_perso);
     127        if isfield(h,'MenuFile_1')
     128            set(handles.MenuFile_1,'Label',h.MenuFile_1);
     129        end
     130        if isfield(h,'MenuFile_1')
     131            set(handles.MenuFile_2,'Label',h.MenuFile_2);
     132        end
     133        if isfield(h,'MenuFile_1')
     134            set(handles.MenuFile_3,'Label',h.MenuFile_3);
     135        end
     136        if isfield(h,'MenuFile_1')
     137            set(handles.MenuFile_4,'Label',h.MenuFile_4);
     138        end
     139        if isfield(h,'MenuFile_1')
     140            set(handles.MenuFile_5,'Label',h.MenuFile_5);
     141        end
     142    end
     143end
     144%transfer input field  in slave mode
     145if exist('Field','var') && isstruct(Field)
    120146        Field_input(eventdata,handles,Field)
    121         if exist('haxes','var')
    122             Field.PlotAxes=haxes;
    123         end
     147%         if exist('haxes','var')
     148%             'TESTget'
     149%             get(haxes,'Tag')
     150%             Field.PlotAxes=haxes;
     151%         end
    124152    set(hObject,'UserData',Field);
    125153end
    126154
    127 %load the list of previously browsed files in menus Open
    128  dir_perso=prefdir;
    129  profil_perso=fullfile(dir_perso,'uvmat_perso.mat');%
    130  if exist(profil_perso,'file')
    131       h=load (profil_perso);
    132       if isfield(h,'MenuFile_1')
    133           set(handles.MenuFile_1,'Label',h.MenuFile_1);
    134       end
    135       if isfield(h,'MenuFile_1')
    136           set(handles.MenuFile_2,'Label',h.MenuFile_2);
    137       end
    138       if isfield(h,'MenuFile_1')
    139           set(handles.MenuFile_3,'Label',h.MenuFile_3);
    140       end
    141       if isfield(h,'MenuFile_1')
    142           set(handles.MenuFile_4,'Label',h.MenuFile_4);
    143       end
    144       if isfield(h,'MenuFile_1')
    145           set(handles.MenuFile_5,'Label',h.MenuFile_5);
    146      end
    147  end
     155
    148156
    149157%------------------------------------------------------------------------
     
    822830end
    823831
    824 %------------------------------------------------
    825 % --- Executes on button press in Plot_histo.
    826 %RUN global histograms
    827 %-------------------------------------------------
    828 function RUN_histo_Callback(hObject, eventdata, handles)
    829 % hObject    handle to RUN (see GCBO)
    830 % eventdata  reserved - to be defined in a future version of MATLAB
    831 % handles    structure with handles and user data (see GUIDATA)
    832 
    833 %time plots
    834 leg={};
    835 n=0;
    836 if (get(handles.cm_switch,'Value')==1)
    837     Uval_p=Uval_cm;
    838     Vval_p=Vval_cm;
    839     Uhist_p=Uhist_cm;
    840     Vhist_p=Vhist_cm;
    841     xlab='velocity (cm/s)';
    842 else
    843     Uval_p=Uval;
    844     Vval_p=Vval;
    845     Uhist_p=Uhist;
    846     Vhist_p=Vhist;
    847     xlab='velocity (pixels)';
    848 end
    849 if (get(handles.vector_y,'Value') == 1)
    850    hhh=figure(2);
    851    hold on
    852    title([filebase ', ' strindex ', ' fieldtitle])
    853    plot(Uval_p,Uhist_p,'b-')
    854    n=n+1;
    855    leg{n}='Uhist';
    856    xlabel(xlab)
    857 end
    858 if (get(handles.Vhist_input,'Value') == 1)
    859    hhh=figure(2);
    860    hold on
    861    title([filebase ', ' strindex ', ' fieldtitle])
    862    plot(Vval_p,Vhist_p,'r-')
    863    n=n+1;
    864    leg{n}='Vhist';
    865    xlabel(xlab);
    866 end
    867 if (get(handles.Chist_input,'Value') == 1)
    868    hhhh=figure(3);
    869    hold on
    870    title([filebase ', ' strindex ', ' fieldtitle])
    871    plot(Cval,Chist,'k-')
    872    leg{1}='Chist';
    873 end
    874 % hold off
    875 grid on
    876 legend(leg);
     832% %------------------------------------------------
     833% % --- Executes on button press in Plot_histo.
     834% %RUN global histograms
     835% %-------------------------------------------------
     836% function RUN_histo_Callback(hObject, eventdata, handles)
     837% % hObject    handle to RUN (see GCBO)
     838% % eventdata  reserved - to be defined in a future version of MATLAB
     839% % handles    structure with handles and user data (see GUIDATA)
     840%
     841% %time plots
     842% leg={};
     843% n=0;
     844% if (get(handles.cm_switch,'Value')==1)
     845%     Uval_p=Uval_cm;
     846%     Vval_p=Vval_cm;
     847%     Uhist_p=Uhist_cm;
     848%     Vhist_p=Vhist_cm;
     849%     xlab='velocity (cm/s)';
     850% else
     851%     Uval_p=Uval;
     852%     Vval_p=Vval;
     853%     Uhist_p=Uhist;
     854%     Vhist_p=Vhist;
     855%     xlab='velocity (pixels)';
     856% end
     857% if (get(handles.vector_y,'Value') == 1)
     858%    hhh=figure(2);
     859%    hold on
     860%    title([filebase ', ' strindex ', ' fieldtitle])
     861%    plot(Uval_p,Uhist_p,'b-')
     862%    n=n+1;
     863%    leg{n}='Uhist';
     864%    xlabel(xlab)
     865% end
     866% if (get(handles.Vhist_input,'Value') == 1)
     867%    hhh=figure(2);
     868%    hold on
     869%    title([filebase ', ' strindex ', ' fieldtitle])
     870%    plot(Vval_p,Vhist_p,'r-')
     871%    n=n+1;
     872%    leg{n}='Vhist';
     873%    xlabel(xlab);
     874% end
     875% if (get(handles.Chist_input,'Value') == 1)
     876%    hhhh=figure(3);
     877%    hold on
     878%    title([filebase ', ' strindex ', ' fieldtitle])
     879%    plot(Cval,Chist,'k-')
     880%    leg{1}='Chist';
     881% end
     882% % hold off
     883% grid on
     884% legend(leg);
    877885
    878886% %-------------------------------------------------------------
     
    10281036    var_select=list_var{index};
    10291037    set(handles.attributes_txt,'String', ['attributes of ' var_select])
    1030     if isfield(Field,'VarAttribute')& length(Field.VarAttribute)>=index-1
     1038    if isfield(Field,'VarAttribute')&& length(Field.VarAttribute)>=index-1
    10311039%         nbline=0;
    10321040        VarAttr=Field.VarAttribute{index-1};
     
    10501058    Tabchar=[{''};Tabchar];
    10511059end
     1060set(handles.attributes,'Value',1);% select the first item
    10521061set(handles.attributes,'String',Tabchar);
    10531062
Note: See TracChangeset for help on using the changeset viewer.