Changeset 1156 for trunk


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

bugs repaired

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_imadoc.m

    r1152 r1156  
    3030
    3131function XmlFileName=find_imadoc(RootPath,SubDir)
    32 
    33 dotchar=regexp(SubDir,'\.');%detect the dots in the folder name
    34 if isempty(dotchar)
    35     XmlFileName=fullfile(RootPath,[SubDir '.xml']);
    36 else %go upward to the root name, stop if an xml file already exists
    37     for idot=1:numel(dotchar)
    38         SubDir=SubDir(1:dotchar(end-idot+1)-1);
    39         XmlFileName=fullfile(RootPath,[SubDir '.xml']);
    40         if exist(XmlFileName,'file')
    41             break
     32XmlFileName=fullfile(RootPath,[SubDir '.xml']);
     33if ~exist(XmlFileName,'file')
     34    dotchar=regexp(SubDir,'\.');%detect the dots in the folder name
     35    if ~isempty(dotchar)
     36        for idot=1:numel(dotchar)
     37            SubDir=SubDir(1:dotchar(end-idot+1)-1);
     38            XmlFileName=fullfile(RootPath,[SubDir '.xml']);
     39            if exist(XmlFileName,'file')
     40                break
     41            end
    4242        end
    4343    end
    44 end
    45 if ~exist(XmlFileName,'file')
    46     XmlFileName='';
     44    if ~exist(XmlFileName,'file')
     45        XmlFileName='';
     46    end
    4747end
    4848
    4949
    5050
     51
  • 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
  • trunk/src/series/civ_3D.m

    r1152 r1156  
    5555    Data.Program=mfilename;%gives the name of the current function
    5656    Data.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    57     Data.WholeIndexRange_j='on';% prescribes the file index ranges j from min to max (options 'off'/'on', 'off' by default)
     57    Data.IndexRange_j='whole';% prescribes the file index ranges j from min to max (options 'off'/'on'/'whole', 'on' by default)
    5858    Data.NbSlice='off'; %nbre of slices ('off' by default)
    5959    Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
  • trunk/src/series/civ_input.m

    r1155 r1156  
    343343end
    344344if strcmp(Param.Action.ActionName,'civ_3D')
    345     PairIndex=1
     345    PairIndex=1;
    346346else
    347347    if isempty(PairIndex)
     
    789789%------------------------------------------------------------------------
    790790%reproduce by default the chosen pair in the checkciv2 menu
    791 list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs
    792 PairString=list_pair{get(handles.ListPairCiv1,'Value')};
    793 
    794 [ind1,ind2]=...
    795     find_pair_indices(PairString);
    796 hseries=findobj(allchild(0),'Tag','series');
    797 hhseries=guidata(hseries);
    798 set(hhseries.num_first_j,'String',num2str(ind1));
    799 set(hhseries.num_last_j,'String',num2str(ind2));
    800 set(hhseries.num_incr_j,'String',num2str(ind2-ind1));
    801 set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))%civ2 selection the same as civ& by default
    802 
     791set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))%civ2 selection the same as civ1 by default
     792ListPairCiv2_Callback(hObject, eventdata, handles)
    803793
    804794%------------------------------------------------------------------------
     
    806796function ListPairCiv2_Callback(hObject, eventdata, handles)
    807797%------------------------------------------------------------------------
    808 
    809798
    810799%------------------------------------------------------------------------
  • trunk/src/series/civ_series.m

    r1155 r1156  
    5353    path_series=fileparts(which('series'));
    5454    addpath(fullfile(path_series,'series'))
    55 
    56 
    5755    Data=civ_input(Param);% introduce the civ parameters using the GUI civ_input
    5856    % TODO: change from guide to App: modify the input procedure, adapt read_GUI function
     
    7674    Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
    7775    if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices') && strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')
    78         if isfield(Data.ActionInput.PairIndices,'ListPairCiv2')
    79             str_civ=Data.ActionInput.PairIndices.ListPairCiv2;
    80         else
    81             str_civ=Data.ActionInput.PairIndices.ListPairCiv1;
    82         end
    83         r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names');
    84         if isempty(r)
    85             r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names');
    86             if isempty(r)
    87                 r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names');
    88             end
    89         end
    90         if ~isempty(r)
    91             Data.j_index_1=stra2num(r.num1);
    92             Data.j_index_2=stra2num(r.num2);
    93         end
     76        Data.IndexRange_j='off';%no j index display in series
     77        % if isfield(Data.ActionInput.PairIndices,'ListPairCiv2')
     78        %     str_civ=Data.ActionInput.PairIndices.ListPairCiv2;
     79        % else
     80        %     str_civ=Data.ActionInput.PairIndices.ListPairCiv1;
     81        % end
     82        % r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names');
     83        % if isempty(r)
     84        %     r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names');
     85        %     if isempty(r)
     86        %         r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names');
     87        %     end
     88        % end
     89        % if ~isempty(r)
     90        %     Data.j_index_1=stra2num(r.num1);
     91        %     Data.j_index_2=stra2num(r.num2);
     92        % end
     93    else
     94        Data.IndexRange_j='on';% j index display in series if relevant
    9495    end
    9596    return
  • trunk/src/series/test_filter_tps.m

    r1155 r1156  
    5959if isstruct(Param) && isequal(Param.Action.RUN,0)
    6060    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    61     ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     61    ParamOut.WholeIndexRange='one';% prescribes the file index ranges from min to max (options 'off'/'on'/'one' (single input index), 'off' by default)
    6262    ParamOut.NbSlice='off'; % edit box nbre of slices made active
    6363    ParamOut.VelType='one';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     
    214214DataOut.ListGlobalAttribute={'Conventions','Program','CivStage','SubDomainSize','MaxDiff','CoordUnit','FieldSmooth'};
    215215DataOut.Conventions='uvmat/civdata';% states the conventions used for the description of field variables and attributes
     216if isfield(Param,'UvmatRevision')
    216217DataOut.Program=['test_patch_tps, uvmat r' Param.UvmatRevision];
     218else
     219    DataOut.Program='test_patch_tps';
     220end
    217221DataOut.CivStage=CivStage;%update the current civStage after smoothing
    218222DataOut.SubDomainSize=SubDomainSize;
     
    287291time=toc
    288292
    289 
     293%plot rms difference and proportion of excluded vectors
    290294figure(2)
    291295cla
    292296if CivStage==3% civ1
    293 ref=0.2; %recommanded value for diff rms
     297    ref=0.2; %recommanded value for diff rms
     298    txt='civ1';
    294299else
    295300    ref=0.1;
     301    txt='civ2';
    296302end
    297303semilogx(FieldSmooth,DataOut.Diff_rms,'b+-',FieldSmooth,DataOut.NbExclude,'m+-',FieldSmooth,ref*ones(size(FieldSmooth)),'b--')
    298304grid on
    299 title( [filecell{1,1} ':' Param.InputFields.VelType])
    300 legend({'rms vel. diff. ' ;' ratio excluded vectors';'recommended diff'},'Location','northwest')
     305title( [filecell{1,1} ':' txt])
     306legend({'rms vel. diff. ' ;' ratio excluded vectors';['recommended diff for' txt]},'Location','northwest')
    301307xlabel('smoothing parameter')
    302 ylabel('rms (pixels) and exclusion ratio')
    303 OutputFig=fullfile(OutputPath,OutputDir,'plot_rms_diff.png')
     308ylabel('rms (pixels) and proportion of excluded vectors')
     309OutputFig=fullfile(OutputPath,OutputDir,'plot_rms_diff.png');
    304310saveas(2,OutputFig)
    305311
  • trunk/src/xmlburst2time.m

    r1150 r1156  
    1212        Frequency=BurstTiming{k}.FrameFrequency;
    1313    end
    14     if isfield(BurstTiming{k},'Time')
     14    if ~isfield(BurstTiming{k},'Time')
    1515        BurstTiming{k}.Time=0;%time origin set to zero by default
    1616    end
Note: See TracChangeset for help on using the changeset viewer.