Changeset 1156 for trunk/src/series.m


Ignore:
Timestamp:
Jul 8, 2024, 11:03:33 PM (3 months ago)
Author:
sommeria
Message:

bugs repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r1154 r1156  
    540540function check_input_file_series(handles)
    541541%------------------------------------------------------------------------
    542 InputTable=get(handles.InputTable,'Data');
     542InputTable=get(handles.InputTable,'Data');%read the table of input file series
    543543set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch'
    544544set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH  button to yellow color (indicate activation)
     
    548548    empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3)));%check the empty lines in the input table
    549549end
    550 if ~isempty(find(empty_line,1))
     550if ~isempty(find(empty_line,1))%removes the empty lines in the table
    551551    InputTable(empty_line,:)=[]; % remove empty lines
    552552    set(handles.InputTable,'Data',InputTable)
     
    579579        end
    580580        InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,j2);
    581         [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
     581        [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,~,FileInfo,MovieObject]=...
    582582                find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),InputFile);
    583583    end
     
    589589            return
    590590        else
    591             display_file_name(handles,fileinput,iview)
     591            display_file_name(handles,fileinput,iview)% update the table of input file series, then call update_rootinfo
    592592        end
    593593    else
     
    771771end
    772772for ifile=1:min(length(MenuFile),5)
    773     eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
     773    ffname=['MenuFile_' num2str(ifile)];
     774    set(handles.(ffname),'Label',MenuFile{ifile});
    774775end
    775776dir_perso=prefdir;
     
    792793set(handles.Device,'String',[Device DeviceExt])
    793794set(handles.Experiment,'String',[Experiment ExperimentExt])
    794 if ~isempty(regexp(InputTable{1,1},'(^http://)|(^https://)'))
     795if ~isempty(regexp(InputTable{1,1},'(^http://)|(^https://)', 'once'))
    795796    set(handles.OutputPathBrowse,'Value',1)% an output folder needs to be specified for OpenDAP data
    796797end
     
    814815%% initiate input file series and refresh the current field view:
    815816update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview);
     817
    816818%% enable field and veltype menus, in accordance with the current action
    817819ActionName_Callback([],[], handles)
     
    828830%------------------------------------------------------------------------
    829831InputTable=get(handles.InputTable,'Data');
     832
     833%% make the j indices visible if relevant
     834if (isempty(j1_series)|| ~isempty(j2_series))% no j series or j1-j2 pair
     835    enable_j(handles,'off');
     836else
     837   enable_j(handles,'on')%%%%remark: put series with j index at the end in the case of a list
     838end
    830839
    831840%% display the min and max indices for the whole file series
     
    838847    ref_i=squeeze(max(i1_series(1,:,:),[],2)); % select ref_j index for each ref_i
    839848    ref_j=squeeze(max(j1_series(1,:,:),[],3)); % select ref_i index for each ref_j
    840      MinIndex_i=min(find(ref_i))-1;
    841      MaxIndex_i=max(find(ref_i))-1;
    842      MaxIndex_j=max(find(ref_j))-1;
    843      MinIndex_j=min(find(ref_j))-1;
     849     MinIndex_i=find(ref_i, 1 )-1;
     850     MaxIndex_i=find(ref_i, 1, 'last' )-1;
     851     MaxIndex_j=find(ref_j, 1, 'last' )-1;
     852     MinIndex_j=find(ref_j, 1 )-1;
    844853    diff_j_max=diff(ref_j);
    845854    diff_i_max=diff(ref_i);
     
    873882set(handles.MaxIndex_i,'Data',MaxIndex_i_table)%display the min indices in the table MinIndex
    874883set(handles.MaxIndex_j,'Data',MaxIndex_j_table)%display the max indices in the table MaxIndex
     884
     885
    875886SeriesData=get(handles.series,'UserData');
    876887
     
    10631074
    10641075
    1065 %% display the set of existing files as an image
     1076%% display the set of existing files as an image with black bands for gaps showing gaps in the series
    10661077set(handles.FileStatus,'Units','pixels')
    10671078Position=get(handles.FileStatus,'Position');
     
    13161327end
    13171328
    1318 %-------------------------------------
    1319 function enable_i(handles,state)
    1320 set(handles.i_txt,'Visible',state)
    1321 set(handles.num_first_i,'Visible',state)
    1322 set(handles.num_last_i,'Visible',state)
    1323 set(handles.num_incr_i,'Visible',state)
    13241329
    13251330%-----------------------------------
     
    25792584    ParamOut.WholeIndexRange='off';
    25802585end
    2581 if ~isfield(ParamOut,'WholeIndexRange_j')
    2582     ParamOut.WholeIndexRange_j='off';
    2583 end
    2584 
     2586if ~isfield(ParamOut,'IndexRange_j')
     2587    ParamOut.IndexRange_j='on';% accept Index_j as input by default
     2588end
    25852589if strcmp(ParamOut.WholeIndexRange,'on')
    25862590    MinIndex_i=get(handles.MinIndex_i,'Data');
     
    25962600    end
    25972601end
    2598 if strcmp(ParamOut.WholeIndexRange,'on')||strcmp(ParamOut.WholeIndexRange_j,'on')
     2602if strcmp(ParamOut.WholeIndexRange,'on')||strcmp(ParamOut.IndexRange_j,'whole')
    25992603    MinIndex_j=get(handles.MinIndex_j,'Data');
    26002604    MaxIndex_j=get(handles.MaxIndex_j,'Data');
     
    26132617
    26142618%% enable or desable j index visibility
    2615 status_j='on'; % default
    2616 if isfield(SeriesData,'j1_series') && isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)) % case of empty j indices
    2617     status_j='off'; % no j index needed
    2618 elseif strcmp(get(handles.PairString,'Visible'),'on')
    2619     check_burst=cellfun(@isempty,regexp(get(handles.PairString,'Data'),'^j')); % =0 for burst case, 1 otherwise
    2620     if isempty(find(check_burst, 1))% if all pair string begins by j (burst)
    2621         status_j='off'; % no j index needed for bust case
    2622     end
    2623 end
    2624 enable_j(handles,status_j) % no j index needed
    2625 if isfield(ParamOut,'j_index_1')&& isfield(ParamOut,'j_index_2')%strcmp(ParamOut.Desable_j_index,'on')
    2626     %status_j='off';
    2627     set(handles.num_first_j,'String',num2str(ParamOut.j_index_1))
    2628     set(handles.num_last_j,'String',num2str(ParamOut.j_index_2))
    2629     % set(handles.num_first_j,'enable','off')
    2630     % set(handles.num_last_j,'enable','off')
    2631     set(handles.num_first_j,'visible','off')
    2632     set(handles.num_last_j,'visible','off')
    2633     set(handles.num_incr_j,'visible','off')
    2634 else
    2635     set(handles.num_first_j,'visible','on')
    2636     set(handles.num_last_j,'visible','on')
    2637     set(handles.num_incr_j,'visible',status_j)
    2638 end
     2619if strcmp(ParamOut.IndexRange_j,'off')%do not show the j index
     2620    enable_j(handles,'off')
     2621else% show j index if relevant in the input series
     2622    j1_series=SeriesData.j1_series;
     2623    for iview=1:size(j1_series,1)
     2624        if ~isempty(j1_series{iview})
     2625            enable_j(handles,'on')
     2626            break
     2627        end
     2628    end
     2629end
     2630
     2631% status_j='on'; % default
     2632% if isfield(SeriesData,'j1_series') && isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)) % case of empty j indices
     2633%     status_j='off'; % no j index needed
     2634% elseif strcmp(get(handles.PairString,'Visible'),'on')
     2635%     check_burst=cellfun(@isempty,regexp(get(handles.PairString,'Data'),'^j')); % =0 for burst case, 1 otherwise
     2636%     if isempty(find(check_burst, 1))% if all pair string begins by j (burst)
     2637%         status_j='off'; % no j index needed for bust case
     2638%     end
     2639% end
     2640% enable_j(handles,status_j) % no j index needed
     2641% if isfield(ParamOut,'j_index_1')&& isfield(ParamOut,'j_index_2')%strcmp(ParamOut.Desable_j_index,'on')
     2642%     %status_j='off';
     2643%     set(handles.num_first_j,'String',num2str(ParamOut.j_index_1))
     2644%     set(handles.num_last_j,'String',num2str(ParamOut.j_index_2))
     2645%     % set(handles.num_first_j,'enable','off')
     2646%     % set(handles.num_last_j,'enable','off')
     2647%     set(handles.num_first_j,'visible','off')
     2648%     set(handles.num_last_j,'visible','off')
     2649%     set(handles.num_incr_j,'visible','off')
     2650% else
     2651%     set(handles.num_first_j,'visible','on')
     2652%     set(handles.num_last_j,'visible','on')
     2653%     set(handles.num_incr_j,'visible',status_j)
     2654% end
    26392655
    26402656%% NbSlice visibility
Note: See TracChangeset for help on using the changeset viewer.