Changeset 523 for trunk/src


Ignore:
Timestamp:
Aug 19, 2012, 11:40:34 AM (12 years ago)
Author:
sommeria
Message:
 
Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r521 r523  
    110110    end
    111111end 
     112if isfield(param,'incr_i')
     113    set(handles.num_incr_i,'String',num2str(param.incr_i))
     114end
     115if isfield(param,'incr_j')
     116    set(handles.num_incr_j,'String',num2str(param.incr_j))
     117end
    112118
    113119%% fields input initialisation
     
    132138
    133139%% TRANSFORM menu: loads the information stored in prefdir to initiate  the list of field transform functions
    134 menu_str={'';'phys';'px';'phys_polar'};
     140menu_str={'';'sub_field';'phys';'phys_polar'};
    135141nb_builtin_transform=numel(menu_str); %number of functions
    136142[path_uvmat,name,ext]=fileparts(which('uvmat'));
     
    148154rmpath(fullfile(path_uvmat,'transform_field'))
    149155
    150 %% read the list of functions stored in the personal file 'uvmat_perso.mat' in prefdir
     156%% read the list of transform functions stored in the personal file 'uvmat_perso.mat' in prefdir
    151157if test_profil_perso
    152158    if isfield(h,'series_fct') && iscell(h.series_fct)
     
    214220    set(handles.RunMode,'String',{'local';'background';'cluster'})
    215221end
    216 % if isfield(sparam.RunParam,'CivBin')
    217 %     if ~exist(sparam.RunParam.CivBin,'file')
    218 %         sparam.RunParam.CivBin=fullfile(path_uvmat,sparam.RunParam.CivBin);
    219 %     end
    220 % else
    221 %     sparam.RunParam.CivBin='';
    222 % end
    223 % display the GUI for the default actionname 'check_data_files'
    224 % ActionName_Callback(hObject, eventdata, handles)
    225222
    226223%------------------------------------------------------------------------
     
    596593MaxIndex_j=max(find(i_max))-1;% max ref index i
    597594MinIndex_j=min(find(i_max))-1;% min ref index i
    598 % i2_min=[];
    599 % if ~isempty(i2_series)
    600 %     i2_min=i2_series(1,2,2);
    601 % end
    602 % j1_min=[];
    603 % if ~isempty(j1_series)
    604 %     j1_min=j1_series(1,2,2);
    605 % end
    606 % j2_min=[];
    607 % if ~isempty(j2_series)
    608 %     j2_min=j2_series(1,2,2);
    609 % end
    610 % if isequal(MinIndex_i,1) &&...
    611 %         exist (fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},0,i2_min, j1_min,j2_min),'file')
    612 %     MinIndex_i=0;
    613 % end
    614 % j_sum=sum(sum(j1_series,1),1);
    615 % MaxIndex_j=max(find(j_sum>0))-1;
    616 % MinIndex_j=min(find(j_sum>0))-1;
    617595MinIndex=get(handles.MinIndex,'Data');%retrieve the min indices in the table MinIndex
    618596MaxIndex=get(handles.MaxIndex,'Data');%retrieve the max indices in the table MaxIndex
     
    724702%% update time table
    725703if ~isempty(time)
    726 TimeTable=get(handles.TimeTable,'Data');
    727 first_i=str2num(get(handles.num_first_i,'String'));
    728 last_i=str2num(get(handles.num_last_i,'String'));
    729 first_j=str2num(get(handles.num_first_j,'String'));
    730 last_j=str2num(get(handles.num_last_j,'String'));
    731 MinIndexTable=get(handles.MinIndex,'Data');
    732 MinIndex_i=MinIndexTable{iview,1};
    733 MinIndex_j=MinIndexTable{iview,2};
    734 MaxIndexTable=get(handles.MaxIndex,'Data');
    735 MaxIndex_i=MaxIndexTable{iview,1};
    736 MaxIndex_j=MaxIndexTable{iview,2};
    737 if isempty(MinIndex_j)
    738     if MinIndex_i>0
    739     TimeTable{iview,1}=time(MinIndex_i);
    740     end
    741     TimeTable{iview,2}=time(first_i);
    742     TimeTable{iview,3}=time(last_i);
    743     TimeTable{iview,4}=time(MaxIndex_i);
    744 elseif ~isempty(time)
    745     if MinIndex_i>0
    746     TimeTable{iview,1}=time(MinIndex_i,MinIndex_j);
    747     end
    748     TimeTable{iview,2}=time(first_i,first_j);
    749     TimeTable{iview,3}=time(last_i,last_j);
    750     TimeTable{iview,4}=time(MaxIndex_i,MaxIndex_j);
    751 end
    752 set(handles.TimeTable,'Data',TimeTable)
     704    TimeTable=get(handles.TimeTable,'Data');
     705    first_i=str2num(get(handles.num_first_i,'String'));
     706    last_i=str2num(get(handles.num_last_i,'String'));
     707    first_j=str2num(get(handles.num_first_j,'String'));
     708    last_j=str2num(get(handles.num_last_j,'String'));
     709    MinIndexTable=get(handles.MinIndex,'Data');
     710    MinIndex_i=MinIndexTable{iview,1};
     711    MinIndex_j=MinIndexTable{iview,2};
     712    MaxIndexTable=get(handles.MaxIndex,'Data');
     713    MaxIndex_i=MaxIndexTable{iview,1};
     714    MaxIndex_j=MaxIndexTable{iview,2};
     715    if isempty(MinIndex_j)
     716        if MinIndex_i>0
     717            TimeTable{iview,1}=time(MinIndex_i);
     718        end
     719        TimeTable{iview,2}=time(first_i);
     720        TimeTable{iview,3}=time(last_i);
     721        TimeTable{iview,4}=time(MaxIndex_i);
     722    elseif ~isempty(time)
     723        if MinIndex_i>0
     724            TimeTable{iview,1}=time(MinIndex_i,MinIndex_j);
     725        end
     726        TimeTable{iview,2}=time(first_i,first_j);
     727        TimeTable{iview,3}=time(last_i,last_j);
     728        TimeTable{iview,4}=time(MaxIndex_i,MaxIndex_j);
     729    end
     730    set(handles.TimeTable,'Data',TimeTable)
    753731end
    754732
     
    802780xI=0.5:Position(3)-0.5;
    803781nbview=numel(SeriesData.i1_series);
     782pair_max=cell(1,nbview);
    804783for iview=1:nbview
    805     index_min(iview)=min(find(SeriesData.i1_series{iview}(1,2:end,2:end)>0));
    806     index_max(iview)=max(find(SeriesData.i1_series{iview}(1,2:end,2:end)>0));
     784    pair_max{iview}=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index
     785    index_min(iview)=find(pair_max{iview}>0, 1 );
     786    index_max(iview)=find(pair_max{iview}>0, 1, 'last' );
    807787end
    808788index_min=min(index_min);
     
    818798    ind_y=1+(iview-1)*range_y:iview*range_y;
    819799    LineData=zeros(1,range_index);
    820     x_index=find(SeriesData.i1_series{iview}(1,2:end,2:end)>0)-index_min+1;
     800    x_index=find(pair_max{iview}>0)-index_min+1;
    821801    LineData(x_index)=1;
    822802    LineData=interp1(x,LineData,xI,'nearest');
  • trunk/src/uvmat.m

    r521 r523  
    207207transform_menu={'';'sub_field';'phys';'phys_polar'};
    208208UvData.OpenParam.NbBuiltin=numel(transform_menu); %number of functions
    209 path_list=(num2cell(blanks(UvData.OpenParam.NbBuiltin)))';%initialize a cell array of nbvar blanks
    210209transform_path=fullfile(path_uvmat,'transform_field');
    211210path_list{1}='';
    212 path_list(2:end)=regexprep(path_list(2:end),' ',transform_path); % set transform_path to the path_list
     211for ilist=2:UvData.OpenParam.NbBuiltin
     212path_list{ilist}=transform_path; % set transform_path to the path_list
     213end
    213214
    214215%% load the list of previously browsed files in menus Open, Open_1 and transform_fct
     
    217218 if exist(profil_perso,'file')
    218219     h=load (profil_perso);
    219      if isfield(h,'MenuFile')
     220     if isfield(h,'MenuFile')% load the menu of previously opened files
    220221         for ifile=1:min(length(h.MenuFile),5)
    221222             eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',h.MenuFile{ifile});'])
     
    223224         end
    224225     end
    225      if isfield(h,'transform_fct') && iscell(h.transform_fct)
     226     if isfield(h,'transform_fct') && iscell(h.transform_fct) % load the menu of transform fct set by user
    226227         for ilist=1:length(h.transform_fct);
    227228             if exist(h.transform_fct{ilist},'file')
     
    233234     end
    234235 end
    235 transform_menu=[transform_menu;{'more...'}];
    236 set(handles.transform_fct,'String',transform_menu)
    237 set(handles.transform_fct,'UserData',path_list)% store the list of path in UserData of ACTION
     236transform_menu=[transform_menu;{'more...'}];%append the option more.. to the menu
     237set(handles.transform_fct,'String',transform_menu)% display the menu of transform fcts
     238set(handles.transform_fct,'UserData',path_list)% store the corresponding list of path in UserData of uicontrol transform_fct
    238239set(handles.path_transform,'String','')
    239240set(handles.path_transform,'UserData',[])
     
    36043605    if exist(profil_perso,'file')
    36053606        nb_builtin=UvData.OpenParam.NbBuiltin;% number of 'builtin' (basic) transform fcts in uvmat
     3607        if nb_builtin<numel(list_path)
    36063608        for ilist=nb_builtin+1:numel(list_path)
    36073609            transform_fct{ilist-nb_builtin}=[fullfile(list_path{ilist},menu{ilist}) '.m'];
    36083610        end
    36093611        save (profil_perso,'transform_fct','-append'); %store the root name for future opening of uvmat
     3612        end
    36103613    end
    36113614end
     
    46834686    data.CoordType=UvData.CoordType;
    46844687end
    4685 % pos=get(handles.uvmat,'Position');
    4686 % pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)
    4687 % pos(2)=pos(2)-0.02;
    46884688[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles);
    46894689FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];
Note: See TracChangeset for help on using the changeset viewer.