Changeset 523 for trunk/src/series.m


Ignore:
Timestamp:
Aug 19, 2012, 11:40:34 AM (9 years ago)
Author:
sommeria
Message:
 
File:
1 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');
Note: See TracChangeset for help on using the changeset viewer.