Changeset 59 for trunk/src/uvmat.m


Ignore:
Timestamp:
Mar 21, 2010, 2:34:24 PM (11 years ago)
Author:
sommeria
Message:

upgrade and cleaning in uvmat: run min plus does not modify the field counters in case of error
nomtype2pair: comments added
get_field: minor cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r57 r59  
    316316    elseif ischar(input)% file name introduced as input
    317317           inputfile=input;
    318     elseif isnumeric(input)
     318    elseif isnumeric(input)%simple matrix introduced as input
    319319        sizinput=size(input);
    320320        if sizinput(1)<=1 || sizinput(2)<=1
     
    322322            return
    323323        end
     324        Field.ListVarName={'A','coord_y','coord_x'};
     325        Field.VarDimName={{'coord_y','coord_x'},'cord_y','coord_x'};
    324326        Field.A=input;
    325         Field.AX=[0.5 size(input,2)-0.5];
    326         Field.AY=[size(input,1)-0.5 0.5];
     327        Field.coord_x=[0.5 size(input,2)-0.5];
     328        Field.coord_y=[size(input,1)-0.5 0.5];
    327329    end
    328330    if ~isempty(inputfile)
     
    335337        set(handles.Fields,'Value',1)
    336338        set(handles.Fields,'String',{'get_field...'})   
    337         set(handles.Fields,'UserData',Field)
     339       % set(handles.Fields,'UserData',Field)
    338340        testinputfield=1;
    339341       
     
    364366    end 
    365367    if isempty(inputfile)
    366         run0_Callback(hObject, eventdata, handles)
     368        errormsg=refresh_field(handles,[],[],[],[],[],[],{Field});
    367369        set(handles.MenuTools,'Enable','on')
    368370        set(handles.OBJECT_txt,'Visible','on')
     
    636638drawnow
    637639set(handles.Fields,'UserData',[])% reinialize data from uvmat opening
    638 huvmat=get(handles.RootPath,'parent');
    639 UvData=get(huvmat,'UserData');%huvmat=handles of the uvmat interface
     640%huvmat=get(handles.RootPath,'parent');
     641UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface
    640642UvData.NewSeries=1; %flag for run0: begin a new series
    641643UvData.TestInputFile=1;
     
    662664    nburst=1;
    663665    set(handles.Dt_txt,'String',['Dt=' num2str(1000/info.FramesPerSecond) 'ms']);%display the elementary time interval in millisec
    664     XmlData.Time=[0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond]';
     666    XmlData.Time=(0:1/info.FramesPerSecond:(info.NumFrames-1)/info.FramesPerSecond)';
    665667    TimeUnit='s';
    666668    set(handles.npx,'String',num2str(info.Width));%fills nbre of pixels x box
     
    810812UvData.XmlData=XmlData;
    811813UvData.NewSeries=1;
    812 set(huvmat,'UserData',UvData)
     814set(handles.uvmat,'UserData',UvData)
    813815
    814816%display warning message
     
    824826   Data=nc2struct(FileName,'ListGlobalAttribute','absolut_time_T0','civ');
    825827   col_vec=get(handles.col_vec,'String');
    826    if isfield(Data,'absolut_time_T0')&& ~(isfield(Data,'civ') && isequal(Data.civ,0))
     828   if ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)
    827829       set(handles.Fields,'String',{'image';'get_field...';'velocity';'vort';'div';'more...'})
    828830       set(handles.Fields,'Value',3) % set menu to 'velocity'
     
    899901    mask_test_Callback(hObject, eventdata, handles)
    900902end
     903
    901904%-------------------------------------------------------------------
    902905function MenuBrowse_1_Callback(hObject, eventdata, handles)
     
    16131616movie_status=get(handles.movie_pair,'Value');
    16141617if isequal(movie_status,1)
    1615     STOP_Callback(hObject, eventdata, handles)
     1618    STOP_Callback(hObject, eventdata, handles)%interrupt movie pair if active
    16161619end
    16171620%read the data on the current input rootfile(s)
     
    16261629
    16271630sub_value= get(handles.SubField,'Value');
    1628 if sub_value ==1
     1631if sub_value % a second input file has been entered
    16291632    [FileName_1,RootPath_1,filebase_1,FileIndices_1,FileExt_1,SubDir_1]=read_file_boxes_1(handles);
     1633    [pp,ff,str1,str2,str_a,str_b]=name2display(FileIndices_1);
     1634    num1_1=stra2num(str1);%current set of indices for the second field (may be set different than the main indices)
     1635    num2_1=stra2num(str2);
     1636    num_a_1=stra2num(str_a);
     1637    num_b_1=stra2num(str_b);
     1638    NomType_1=get(handles.FileIndex_1,'UserData');
     1639else
     1640    filename_1=[];
    16301641end   
    16311642
    16321643comp_input=get(handles.fix_pair,'Value');
    1633 if isequal(NomType,'_i1-i2')|isequal(NomType,'_i1-i2_j')
    1634     comp_input=1; %impose a fixed pair interval
     1644if isequal(NomType,'_i1-i2')||isequal(NomType,'_i1-i2_j')
     1645    comp_input=1; %impose a fixed pair
    16351646    set(handles.fix_pair,'Value',1)
    16361647end
    16371648
    16381649%case of scanning along the first direction (rootfile numbers)
    1639 if get(handles.scan_i,'Value')==1% case of scanning along field numbers   
     1650if get(handles.scan_i,'Value')==1% case of scanning along index i   
    16401651     num1=num1+increment;
    16411652     num2=num2+increment;
    1642     if comp_input==0% find a free pair
    1643         [filename,num_i1_out,num_j1_out,num_i2_out,num_j2_out]=...
    1644            name_generator(filebase,num1,num_a,FileExt,NomType,0,num2,num_b,subdir);
    1645         if exist(filename,'file')
    1646             num_a=num_j1_out;
    1647             num_b=num_j2_out;
    1648         end
    1649     end
    1650     if sub_value>=2
    1651         num_i1=num_i1+increment;
    1652         num_i2=num_i2+increment;
    1653     end   
    1654 else % case of scanning along the second direction (burst numbers)
    1655     lastfield_cell=get(handles.last_j,'String'); % get the last field number
    1656     lastfield=str2num(lastfield_cell{1});
     1653     [filename,num1,num_a,num2,num_b]=name_generator(filebase,num1,num_a,FileExt,NomType,comp_input,num2,num_b,subdir);
     1654     if sub_value% set the second field name and indices
     1655        num1_1=num1_1+increment;
     1656        num2_1=num2_1+increment;
     1657        filename_1=name_generator(filebase_1,num1_1,num_a_1,FileExt_1,NomType_1,1,num2_1,num_b_1,SubDir_1);
     1658     end   
     1659else % case of scanning along index j (burst numbers)
    16571660    num_a=num_a+increment;
    16581661    num_b=num_b+increment;
    1659     if sub_value >=2
    1660       num_j1=num_j1+increment;
    1661       num_j2=num_j2+increment;
    1662     elseif ~isempty(lastfield) && num_a>lastfield
    1663         num_a=1;
    1664         num1=num1+1;
    1665         num2=num2+1;
    1666     end
    1667 end
    1668 
    1669 % display the new open numbers
    1670 set(handles.i1,'String',num2stra(num1,NomType,1));
    1671 set(handles.i2,'String',num2stra(num2,NomType,1));
    1672 set(handles.j1,'String',num2stra(num_a,NomType,2));
    1673 set(handles.j2,'String',num2stra(num_b,NomType,2));
    1674 [indices]=name_generator('',num1,num_a,'',NomType,1,num2,num_b,'');
    1675 set(handles.FileIndex,'String',indices);
    1676 if sub_value ==1
    1677     NomType_1=get(handles.FileIndex_1,'UserData');
    1678      [indices]=...
    1679            name_generator('',num1,num_a,'',NomType_1,1,num2,num_b,'');
    1680      set(handles.FileIndex_1,'String',indices);
    1681 end
    1682 
    1683 if isequal(movie_status,1)
    1684     set(handles.movie_pair,'Value',1)
    1685     movie_pair_Callback(hObject, eventdata, handles); %run
    1686 else
     1662    if sub_value
     1663        num_a_1=num_a_1+increment;
     1664        num_b_1=num_b_1+increment;
     1665        filename_1=name_generator(filebase_1,num1_1,num_a_1,FileExt_1,NomType_1,1,num2_1,num_b_1,SubDir_1);
     1666%     else % redefine the j index if it exceeds its upper bound (only in the absence of a second field)
     1667%         lastfield_cell=get(handles.last_j,'String'); % get the last field number
     1668%         lastfield=str2double(lastfield_cell{1});
     1669%         if num_a>lastfield && ~isnan(lastfield)
     1670%             num_a=mod(num_a,lastfield);
     1671%             num_b=mod(num_b,lastfield)
     1672%         end
     1673    end
     1674    filename=name_generator(filebase,num1,num_a,FileExt,NomType,comp_input,num2,num_b,subdir);
     1675end
     1676
    16871677% refresh plots
    1688     run0_Callback(hObject, eventdata, handles); %run
    1689 end
     1678errormsg=refresh_field(handles,filename,filename_1,num1,num2,num_a,num_b);
     1679
     1680if isempty(errormsg)  %update the index counters
     1681    set(handles.i1,'String',num2stra(num1,NomType,1));
     1682    if isequal(num2,num1)
     1683         set(handles.i2,'String','');
     1684    else
     1685        set(handles.i2,'String',num2stra(num2,NomType,1));
     1686    end
     1687    set(handles.j1,'String',num2stra(num_a,NomType,2));
     1688    if isequal(num_b,num_a)
     1689         set(handles.j2,'String','');
     1690    else
     1691        set(handles.j2,'String',num2stra(num_b,NomType,2));
     1692    end
     1693    [indices]=name_generator('',num1,num_a,'',NomType,1,num2,num_b,'');
     1694    set(handles.FileIndex,'String',indices);
     1695    if sub_value
     1696         indices_1=name_generator('',num1_1,num_a_1,'',NomType_1,1,num2_1,num_b_1,'');
     1697         set(handles.FileIndex_1,'String',indices_1);
     1698    end
     1699    if isequal(movie_status,1)
     1700        set(handles.movie_pair,'Value',1)
     1701        movie_pair_Callback(hObject, eventdata, handles); %reactivate moviepair if it was activated
     1702    end
     1703else
     1704     msgbox_uvmat('ERROR',errormsg);
     1705end
     1706
    16901707
    16911708
     
    16961713status=get(handles.movie_pair,'value');
    16971714if isequal(status,0)
    1698     set(handles.movie_pair,'BusyAction','Cancel')
     1715    set(handles.movie_pair,'BusyAction','Cancel')%stop movie pair if button is 'off'
     1716    set(handles.i2,'String','')
     1717    set(handles.j2,'String','')
    16991718    return
    17001719else
     
    17081727FieldName=list_fields{index_fields}; % selected field
    17091728if isequal(FieldName,'image')
    1710     run0_Callback(hObject, eventdata, handles)%display the first image
     1729%     run0_Callback(hObject, eventdata, handles)%display the first image
    17111730    UvData=get(handles.uvmat,'UserData');
    17121731else
     
    18061825set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command button in red
    18071826
    1808 %-------------------------------------------------------
     1827%------------------------------------------------------------------------
    18091828% --- Executes on button press in run0.
    1810 %-------------------------------------------------
    18111829function run0_Callback(hObject, eventdata, handles)
    1812 
     1830%------------------------------------------------------------------------
     1831filename=read_file_boxes(handles);
     1832
     1833filename_1=[];%default
     1834if get(handles.SubField,'Value')
     1835    filename_1=read_file_boxes_1(handles);
     1836end
     1837num_i1=stra2num(get(handles.i1,'String'));
     1838num_i2=stra2num(get(handles.i2,'String'));
     1839num_j1=stra2num(get(handles.j1,'String'));
     1840num_j2=stra2num(get(handles.j2,'String'));
     1841errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2);
     1842if ~isempty(errormsg)
     1843      msgbox_uvmat('ERROR',errormsg);
     1844end   
     1845
     1846%------------------------------------------------------------------------
     1847% --- read the input files and refresh all the plots, including projection.
     1848% OUTPUT:
     1849%  errormsg: error message char string  =[] by default
     1850% INPUT:
     1851% filename: first input file (=[] in the absence of input file)
     1852% filename_1: second input file (=[] in the asbsenc of secodn input file)
     1853% num_i1,num_i2,num_j1,num_j2; frame indices
     1854% Field: structure describing an optional input field (then replace the input file)
     1855
     1856function errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,Field)
     1857%------------------------------------------------------------------------
    18131858%initialisation
    18141859set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow
    18151860drawnow
     1861errormsg=[]; % default error message
    18161862abstime=[];
    18171863abstime_1=[];
    18181864dt=[];
    1819 Field={};
     1865if ~exist('Field','var')
     1866    Field={};
     1867end
    18201868UvData=get(handles.uvmat,'UserData');
    1821 if isfield(UvData,'Txt')
    1822     UvData=rmfield(UvData,'Txt');%erase previous error message
    1823 end
    1824 %set(handles.run0,'BusyAction','queue');
     1869% if isfield(UvData,'Txt')
     1870%     UvData=rmfield(UvData,'Txt');%erase previous error message
     1871% end
    18251872if ishandle(handles.UVMAT_title) %remove title panel on uvmat
    18261873    delete(handles.UVMAT_title)
     
    18281875
    18291876% determine the main input file information for action
    1830 TestInputFile=1;%default
    1831 if isfield(UvData,'TestInputFile')&& isequal(UvData.TestInputFile,0),
    1832     TestInputFile=0;
    1833 end
    1834 num_i1=[];%default
    18351877FileType=[];%default
    1836 if TestInputFile
    1837     [filename,RootPath,filebase,xx,Ext]=read_file_boxes(handles);
     1878if ~isempty(filename)
     1879%     [filename,RootPath,filebase,xx,Ext]=read_file_boxes(handles);
    18381880    if ~exist(filename,'file')
    1839         msgbox_uvmat('ERROR',['input file ' filename ' does not exist'])
     1881        errormsg=['input file ' filename ' does not exist'];
    18401882        return
    18411883    end
    1842     num_i1=stra2num(get(handles.i1,'String'));
    1843     num_i2=stra2num(get(handles.i2,'String'));
    1844     num_j1=stra2num(get(handles.j1,'String'));
    1845     num_j2=stra2num(get(handles.j2,'String'));
     1884    Ext=get(handles.FileExt,'String');
    18461885    NomType=get(handles.FileIndex,'UserData');
    18471886    %update the z position index
     
    18801919    end
    18811920else
    1882     filename=[];
    18831921    FileType='netcdf';
    18841922    FieldName='get_field...';
     
    18891927    index_fields=get(handles.Fields,'Value');% selected string index
    18901928    FieldName= list_fields{index_fields}; % selected field
    1891     if isequal(FieldName,'get_field...')% read the field names on the interface get_field...
    1892         VelType=get(handles.Fields,'UserData');
    1893         Field{1}=get(handles.Fields,'UserData');
    1894     else
     1929    if ~isequal(FieldName,'get_field...')% read the field names on the interface get_field...
    18951930       VelType=setfield(handles);
    18961931    end
     
    18981933
    18991934% choose a second field if Subfield option is 'on'
    1900 filename_1=[];
    19011935FieldName_1=[];
    19021936scal_color=[];
     
    19041938sub_value=get(handles.SubField,'Value');
    19051939FileType_1='none';%default
    1906 if sub_value==1
    1907     filename_1=read_file_boxes_1(handles);
    1908     if ~exist(filename_1,'file')
    1909         msgbox_uvmat('ERROR',['second file ' filename_1 ' does not exist'])
    1910         return
    1911     end
     1940%if sub_value==1
     1941if ~isempty(filename_1)
     1942    % test for a constant second field (comparison with a fixed field)
    19121943    NomType_1=get(handles.FileIndex_1,'UserData');
    19131944    Ext_1=get(handles.FileExt_1,'String');
     
    19491980        end
    19501981    end
    1951 end
    1952 
    1953 % test for keeping the previous stored data if the input files are unchanged
    1954 test_keepdata_1=0;%defautl
    1955 test_keepdata=0;
    1956 if sub_value>=2
    1957     if ~isequal(NomType_1,'*')%in cas of a series of files (not avi movie)
     1982    test_keepdata_1=0;% test for keeping the previous stored data if the input files are unchanged
     1983    if ~isequal(NomType_1,'*')%in case of a series of files (not avi movie)
    19581984        if isfield(UvData,'filename_1')&& isfield(UvData,'VelType_1') && isfield(UvData,'FieldName_1')
    19591985            test_keepdata_1= isequal(filename_1,UvData.filename_1)&&...
    19601986                isequal(VelType_1,UvData.filename_1) && isequal(FieldName_1,UvData.FieldName_1);
    1961 
    19621987        end
    19631988    end
     1989    if test_keepdata_1
     1990        Field{2}=UvData.Field_1;   
     1991    elseif ~exist(filename_1,'file')
     1992        errormsg=['second file ' filename_1 ' does not exist'];
     1993        return
     1994    end
    19641995end
    19651996
    19661997%read the input field(s)
    1967 
    19681998%read images
    19691999if ~isempty(filename) && isequal(FieldName,'image')
     
    20012031
    20022032%read a second image
    2003 if ~isfield(UvData,'Txt')&& ~isempty(filename_1) && isequal(FieldName_1,'image')
     2033if  ~isempty(filename_1) && ~test_keepdata_1 && isequal(FieldName_1,'image')
    20042034    switch FileType_1
    20052035        case 'movie'
     
    20392069InputField={FieldName};
    20402070InputField_1={FieldName_1};
    2041 if ~isfield(UvData,'Txt') && ((~isempty(filename)&& isequal(FileType,'netcdf')) || (~isempty(filename_1)&& isequal(FileType,'netcdf'))) ;
     2071if (~isempty(filename)&& isequal(FileType,'netcdf')) || (~isempty(filename_1)&& isequal(FileType_1,'netcdf')) ;
    20422072    %read the velocity field(s) from netcdf rootfile(s)
    20432073    list_code=get(handles.col_vec,'String');% list menu fields
     
    20522082    if isequal(FileType,'netcdf')  %read the first nc field
    20532083        if isequal(FieldName,'get_field...')% read the field names on the interface get_field.
    2054             VelType=get(handles.Fields,'UserData');
     2084            %VelType=get(handles.Fields,'UserData');
    20552085            hget_field=findobj(allchild(0),'Name','get_field');%find the get_field... GUI
    20562086            if isempty(hget_field)
     
    20632093            [Field{1},errormsg]=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI
    20642094            if ~isempty(errormsg)
    2065                 msgbox_uvmat('ERROR',['error in uvmat/run0_Callback/read_get_field: ' errormsg])
     2095                errormsg=['error in uvmat/run0_Callback/read_get_field: ' errormsg];
    20662096                return
    20672097            end
     
    20712101            [Field{1},VelType_out]=read_civxdata(filename,InputField,VelType);
    20722102            if isfield(Field{1},'Txt')
    2073                 msgbox_uvmat('ERROR',Field{1}.Txt)
     2103                errormsg=Field{1}.Txt;
    20742104                return
    20752105            end
     
    20782108        end
    20792109    end
    2080     if ~isempty(filename_1) && isequal(FileType_1,'netcdf') %read the second file
     2110    if ~isempty(filename_1) && ~test_keepdata_1 && isequal(FileType_1,'netcdf') %read the second file
    20812111        if isequal(FieldName_1,'get_field...')% read the field names on the interface get_field.
    20822112            hget_field=findobj(allchild(0),'Name','get_field_1');%find the get_field... GUI
     
    21232153end
    21242154
     2155%store the second field for possible latter use
     2156if numel(Field)==2
     2157    UvData.Field_1=Field{2};
     2158end
     2159
    21252160%update the display buttons for the first velocity type (first menuline)
    21262161veltype_handles=[handles.civ1 handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2];
    21272162if ~isequal(FileType,'netcdf')
    21282163    reset_vel_type(veltype_handles)
    2129 elseif isempty(VelType)
     2164elseif isempty(VelType) && ~isequal(FieldName,'get_field...')
    21302165    set_veltype_display(veltype_handles,CivStage)%update the display of available velocity types for the first field
    21312166    if isempty(VelType_out)
     
    21412176if ~isequal(FileType_1,'netcdf')
    21422177    reset_vel_type(veltype_handles_1)
    2143 elseif isempty(VelType_1)
     2178elseif isempty(VelType_1) && ~isequal(FieldName_1,'get_field...')
    21442179    set_veltype_display(veltype_handles_1,CivStage_1)%update the display of available velocity types for the first field
    21452180    if isempty(VelType_out_1)
     
    21802215
    21812216%multislice case
    2182 if TestInputFile &&(~isfield(UvData,'NbDim') || isequal(UvData.NbDim,2))&&...%2D case
     2217if ~isempty(filename) &&(~isfield(UvData,'NbDim') || isequal(UvData.NbDim,2))&&...%2D case
    21832218      isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')&& isfield(UvData.XmlData.GeometryCalib,'SliceCoord')
    2184 %     nbfield2=str2num(get(handles.last_j,'String'));
    21852219       siz=size(UvData.XmlData.GeometryCalib.SliceCoord);
    21862220       if siz(1)>1
     
    21922226       end
    21932227       set(handles.nb_slice,'String',num2str(NbSlice))
    2194        slices_Callback(hObject, eventdata, handles)
    2195 %        Coord=UvData.XmlData.GeometryCalib.SliceCoord;
    2196 %        ZIndex=num_i1-NbSlice*(floor((num_i1-1)/NbSlice));
    2197 %        Field{1}.Z=ZIndex;
     2228       slices_Callback(handles.uvmat, [], handles)
    21982229end
    21992230
     
    22202251menu_transform=get(handles.transform_fct,'String');
    22212252choice_value=get(handles.transform_fct,'Value');
    2222 %transform=menu_transform{choice_value};%name of the transform fct  given by the menu 'transform_fct'
    22232253transform_list=get(handles.transform_fct,'UserData');
    22242254transform=transform_list{choice_value};%selected function handles
    22252255
    22262256% z index
    2227 if TestInputFile
     2257if ~isempty(filename)
    22282258    Field{1}.ZIndex=mod(num_i1-1,nbslice)+1;
    22292259end
     2260
    22302261%px to phys or other transform on field
    2231 if  ~isempty(transform)
     2262if ~isempty(transform)
    22322263    if length(Field)>=2
    22332264        Field{2}.ZIndex=mod(num_i1-1,nbslice)+1;
     
    22452276    Field{1}=calc_field(InputField,Field{1});
    22462277end
    2247 if length(Field)==2 && isequal(FileType_1,'netcdf') && ~isequal(FieldName_1,'get_field...')
     2278if length(Field)==2 && ~test_keepdata_1 && isequal(FileType_1,'netcdf') && ~isequal(FieldName_1,'get_field...')
    22482279    Field{2}=calc_field(InputField_1,Field{2});
    22492280end
     
    22512282% combine the two input fields (e.g. substract velocity fields)
    22522283if numel(Field)==2
    2253     if ~(isequal(get(handles.movie_pair,'Value'),1) && isequal(FieldName,'image') && isequal(FieldName_1,'image')) %combine fields if not viewing image pairs
    2254         UvData.Field=sub_field(Field{1},Field{2}); %TO UPDATE FOR MORE GENERAL INPUT
    2255     end
     2284   UvData.Field=sub_field(Field{1},Field{2}); %TO UPDATE FOR MORE GENERAL INPUT 
    22562285else
    22572286   UvData.Field=Field{1};
    22582287end
     2288
    22592289UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback)
    22602290% test 3D , default projection menuplane and typical mesh (needed to menuopen set_object)
     
    22662296[UvData.Field,errormsg]=check_field_structure(UvData.Field);
    22672297if ~isempty(errormsg)
    2268     msgbox_uvmat('ERROR',['error in uvmat/run0_Callback/check_field_structure: ' errormsg])
     2298    errormsg=['error in uvmat/run0_Callback/check_field_structure: ' errormsg];
    22692299    return
    22702300end
     
    25112541                    get_field([],ObjectData)% the projected field cannot be automatically plotted: use get_field to specify the variablesdelete(hget_field)
    25122542                else
    2513                     msgbox_uvmat('ERROR','The field defined by get_field cannot be plotted')
     2543                    errormsg='The field defined by get_field cannot be plotted';
     2544                    return
    25142545                end
    25152546            end 
    25162547            UvData.Object{iobj}.PlotParam=ScalOut; %record the plotting parameters
    2517         end
    2518        
     2548        end       
    25192549    end
    25202550end
     
    25592589    set(handles.histo1_menu,'Value',1)
    25602590    set(handles.histo1_menu,'String',menu_histo)
    2561     histo1_menu_Callback(hObject, eventdata, handles)
     2591    histo1_menu_Callback(handles.histo1_menu, [], handles)
    25622592    if nb_histo > 1
    25632593        test_v=1;
     
    25662596        set(handles.histo2_menu,'String',menu_histo)
    25672597        set(handles.histo2_menu,'Value',2)
    2568         histo2_menu_Callback(hObject, eventdata, handles)
     2598        histo2_menu_Callback(handles.histo2_menu,[], handles)
    25692599    end
    25702600end
     
    29022932function Fields_Callback(hObject, eventdata, handles)
    29032933%-------------------------------------------------
    2904 huvmat=get(handles.Fields,'parent');
     2934
    29052935list_fields=get(handles.Fields,'String');% list menu fields
    29062936index_fields=get(handles.Fields,'Value');% selected string index
     
    29202950index_fields=get(handles.Fields_1,'Value');% selected string index
    29212951field_1= list_fields{index_fields(1)}; % selected string
    2922 UvData=get(huvmat,'UserData');
     2952UvData=get(handles.uvmat,'UserData');
    29232953
    29242954%read the rootfile input display
     
    29863016    set(handles.fix_pair,'Value',1)
    29873017end
    2988 % if isequal(field,'velocity')|isequal(field_1,'velocity');
    2989 %     state_vect='on';
    2990 % else
    2991 %     state_vect='off';
    2992 % end
    2993 % if ~isequal(field,'velocity')|(~isequal(field_1,'velocity'));
    2994 %     state_scal='on';
    2995 % else
    2996 %     state_scal='off';
    2997 % end
    29983018setfield(handles);% update the field structure ('civ1'....)
    29993019
     
    30063026function Fields_1_Callback(hObject, eventdata, handles)
    30073027%-------------------------------------------------
    3008 huvmat=get(handles.Fields_1,'parent');
    30093028list_fields=get(handles.Fields,'String');% list menu fields
    30103029index_fields=get(handles.Fields,'Value');% selected string index
     
    30183037    return
    30193038end
    3020 UvData=get(huvmat,'UserData');
     3039UvData=get(handles.uvmat,'UserData');
    30213040
    30223041%read the rootfile input display
     
    31783197    state_scal='off';
    31793198end
    3180 set(huvmat,'UserData',UvData)
     3199set(handles.uvmat,'UserData',UvData)
    31813200setfield(handles);% update the field structure ('civ1'....)
    31823201if ~isfield(UvData,'NewSeries')|isequal(UvData.NewSeries,0)
Note: See TracChangeset for help on using the changeset viewer.