- Timestamp:
- Mar 21, 2010, 2:34:24 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r56 r59 171 171 set(handles.scalar,'Value',1) 172 172 set(handles.scalar,'String', Txt ) 173 'TESTget'174 Field175 173 [CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(Field); 176 174 if ~isempty(errormsg) -
trunk/src/nomtype2pair.m
r29 r59 1 %'nomtype2pair': creates nomencalture for index pairs .1 %'nomtype2pair': creates nomencalture for index pairs knowing the image nomenclature 2 2 %--------------------------------------------------------------------- 3 % [nom_type_ nc]=nomtype2pair(nom_type);3 % [nom_type_pair]=nomtype2pair(nom_type,Dti,Dtj); 4 4 %--------------------------------------------------------------------- 5 % This function detects the existence the constructed file name and it can 6 % find indices according to file existence if they are not specified 7 %%rmq: this function is related to the reverse functions display2name and name2diplay 8 %--------------------------------------------------------------------- 5 9 6 % OUTPUT: 10 7 %nom_type_nc -
trunk/src/uvmat.m
r57 r59 316 316 elseif ischar(input)% file name introduced as input 317 317 inputfile=input; 318 elseif isnumeric(input) 318 elseif isnumeric(input)%simple matrix introduced as input 319 319 sizinput=size(input); 320 320 if sizinput(1)<=1 || sizinput(2)<=1 … … 322 322 return 323 323 end 324 Field.ListVarName={'A','coord_y','coord_x'}; 325 Field.VarDimName={{'coord_y','coord_x'},'cord_y','coord_x'}; 324 326 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]; 327 329 end 328 330 if ~isempty(inputfile) … … 335 337 set(handles.Fields,'Value',1) 336 338 set(handles.Fields,'String',{'get_field...'}) 337 set(handles.Fields,'UserData',Field)339 % set(handles.Fields,'UserData',Field) 338 340 testinputfield=1; 339 341 … … 364 366 end 365 367 if isempty(inputfile) 366 run0_Callback(hObject, eventdata, handles)368 errormsg=refresh_field(handles,[],[],[],[],[],[],{Field}); 367 369 set(handles.MenuTools,'Enable','on') 368 370 set(handles.OBJECT_txt,'Visible','on') … … 636 638 drawnow 637 639 set(handles.Fields,'UserData',[])% reinialize data from uvmat opening 638 huvmat=get(handles.RootPath,'parent');639 UvData=get(h uvmat,'UserData');%huvmat=handles of the uvmat interface640 %huvmat=get(handles.RootPath,'parent'); 641 UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface 640 642 UvData.NewSeries=1; %flag for run0: begin a new series 641 643 UvData.TestInputFile=1; … … 662 664 nburst=1; 663 665 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)'; 665 667 TimeUnit='s'; 666 668 set(handles.npx,'String',num2str(info.Width));%fills nbre of pixels x box … … 810 812 UvData.XmlData=XmlData; 811 813 UvData.NewSeries=1; 812 set(h uvmat,'UserData',UvData)814 set(handles.uvmat,'UserData',UvData) 813 815 814 816 %display warning message … … 824 826 Data=nc2struct(FileName,'ListGlobalAttribute','absolut_time_T0','civ'); 825 827 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) 827 829 set(handles.Fields,'String',{'image';'get_field...';'velocity';'vort';'div';'more...'}) 828 830 set(handles.Fields,'Value',3) % set menu to 'velocity' … … 899 901 mask_test_Callback(hObject, eventdata, handles) 900 902 end 903 901 904 %------------------------------------------------------------------- 902 905 function MenuBrowse_1_Callback(hObject, eventdata, handles) … … 1613 1616 movie_status=get(handles.movie_pair,'Value'); 1614 1617 if isequal(movie_status,1) 1615 STOP_Callback(hObject, eventdata, handles) 1618 STOP_Callback(hObject, eventdata, handles)%interrupt movie pair if active 1616 1619 end 1617 1620 %read the data on the current input rootfile(s) … … 1626 1629 1627 1630 sub_value= get(handles.SubField,'Value'); 1628 if sub_value ==11631 if sub_value % a second input file has been entered 1629 1632 [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'); 1639 else 1640 filename_1=[]; 1630 1641 end 1631 1642 1632 1643 comp_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 interval1644 if isequal(NomType,'_i1-i2')||isequal(NomType,'_i1-i2_j') 1645 comp_input=1; %impose a fixed pair 1635 1646 set(handles.fix_pair,'Value',1) 1636 1647 end 1637 1648 1638 1649 %case of scanning along the first direction (rootfile numbers) 1639 if get(handles.scan_i,'Value')==1% case of scanning along field numbers1650 if get(handles.scan_i,'Value')==1% case of scanning along index i 1640 1651 num1=num1+increment; 1641 1652 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 1659 else % case of scanning along index j (burst numbers) 1657 1660 num_a=num_a+increment; 1658 1661 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); 1675 end 1676 1687 1677 % refresh plots 1688 run0_Callback(hObject, eventdata, handles); %run 1689 end 1678 errormsg=refresh_field(handles,filename,filename_1,num1,num2,num_a,num_b); 1679 1680 if 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 1703 else 1704 msgbox_uvmat('ERROR',errormsg); 1705 end 1706 1690 1707 1691 1708 … … 1696 1713 status=get(handles.movie_pair,'value'); 1697 1714 if 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','') 1699 1718 return 1700 1719 else … … 1708 1727 FieldName=list_fields{index_fields}; % selected field 1709 1728 if isequal(FieldName,'image') 1710 run0_Callback(hObject, eventdata, handles)%display the first image1729 % run0_Callback(hObject, eventdata, handles)%display the first image 1711 1730 UvData=get(handles.uvmat,'UserData'); 1712 1731 else … … 1806 1825 set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command button in red 1807 1826 1808 %------------------------------------------------------- 1827 %------------------------------------------------------------------------ 1809 1828 % --- Executes on button press in run0. 1810 %-------------------------------------------------1811 1829 function run0_Callback(hObject, eventdata, handles) 1812 1830 %------------------------------------------------------------------------ 1831 filename=read_file_boxes(handles); 1832 1833 filename_1=[];%default 1834 if get(handles.SubField,'Value') 1835 filename_1=read_file_boxes_1(handles); 1836 end 1837 num_i1=stra2num(get(handles.i1,'String')); 1838 num_i2=stra2num(get(handles.i2,'String')); 1839 num_j1=stra2num(get(handles.j1,'String')); 1840 num_j2=stra2num(get(handles.j2,'String')); 1841 errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2); 1842 if ~isempty(errormsg) 1843 msgbox_uvmat('ERROR',errormsg); 1844 end 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 1856 function errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,Field) 1857 %------------------------------------------------------------------------ 1813 1858 %initialisation 1814 1859 set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow 1815 1860 drawnow 1861 errormsg=[]; % default error message 1816 1862 abstime=[]; 1817 1863 abstime_1=[]; 1818 1864 dt=[]; 1819 Field={}; 1865 if ~exist('Field','var') 1866 Field={}; 1867 end 1820 1868 UvData=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 1825 1872 if ishandle(handles.UVMAT_title) %remove title panel on uvmat 1826 1873 delete(handles.UVMAT_title) … … 1828 1875 1829 1876 % determine the main input file information for action 1830 TestInputFile=1;%default1831 if isfield(UvData,'TestInputFile')&& isequal(UvData.TestInputFile,0),1832 TestInputFile=0;1833 end1834 num_i1=[];%default1835 1877 FileType=[];%default 1836 if TestInputFile1837 [filename,RootPath,filebase,xx,Ext]=read_file_boxes(handles);1878 if ~isempty(filename) 1879 % [filename,RootPath,filebase,xx,Ext]=read_file_boxes(handles); 1838 1880 if ~exist(filename,'file') 1839 msgbox_uvmat('ERROR',['input file ' filename ' does not exist'])1881 errormsg=['input file ' filename ' does not exist']; 1840 1882 return 1841 1883 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'); 1846 1885 NomType=get(handles.FileIndex,'UserData'); 1847 1886 %update the z position index … … 1880 1919 end 1881 1920 else 1882 filename=[];1883 1921 FileType='netcdf'; 1884 1922 FieldName='get_field...'; … … 1889 1927 index_fields=get(handles.Fields,'Value');% selected string index 1890 1928 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... 1895 1930 VelType=setfield(handles); 1896 1931 end … … 1898 1933 1899 1934 % choose a second field if Subfield option is 'on' 1900 filename_1=[];1901 1935 FieldName_1=[]; 1902 1936 scal_color=[]; … … 1904 1938 sub_value=get(handles.SubField,'Value'); 1905 1939 FileType_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 1941 if ~isempty(filename_1) 1942 % test for a constant second field (comparison with a fixed field) 1912 1943 NomType_1=get(handles.FileIndex_1,'UserData'); 1913 1944 Ext_1=get(handles.FileExt_1,'String'); … … 1949 1980 end 1950 1981 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) 1958 1984 if isfield(UvData,'filename_1')&& isfield(UvData,'VelType_1') && isfield(UvData,'FieldName_1') 1959 1985 test_keepdata_1= isequal(filename_1,UvData.filename_1)&&... 1960 1986 isequal(VelType_1,UvData.filename_1) && isequal(FieldName_1,UvData.FieldName_1); 1961 1962 1987 end 1963 1988 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 1964 1995 end 1965 1996 1966 1997 %read the input field(s) 1967 1968 1998 %read images 1969 1999 if ~isempty(filename) && isequal(FieldName,'image') … … 2001 2031 2002 2032 %read a second image 2003 if ~isfield(UvData,'Txt')&& ~isempty(filename_1)&& isequal(FieldName_1,'image')2033 if ~isempty(filename_1) && ~test_keepdata_1 && isequal(FieldName_1,'image') 2004 2034 switch FileType_1 2005 2035 case 'movie' … … 2039 2069 InputField={FieldName}; 2040 2070 InputField_1={FieldName_1}; 2041 if ~isfield(UvData,'Txt') && ((~isempty(filename)&& isequal(FileType,'netcdf')) || (~isempty(filename_1)&& isequal(FileType,'netcdf'))) ;2071 if (~isempty(filename)&& isequal(FileType,'netcdf')) || (~isempty(filename_1)&& isequal(FileType_1,'netcdf')) ; 2042 2072 %read the velocity field(s) from netcdf rootfile(s) 2043 2073 list_code=get(handles.col_vec,'String');% list menu fields … … 2052 2082 if isequal(FileType,'netcdf') %read the first nc field 2053 2083 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'); 2055 2085 hget_field=findobj(allchild(0),'Name','get_field');%find the get_field... GUI 2056 2086 if isempty(hget_field) … … 2063 2093 [Field{1},errormsg]=read_get_field(hget_field); %read the names of the variables to plot in the get_field GUI 2064 2094 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]; 2066 2096 return 2067 2097 end … … 2071 2101 [Field{1},VelType_out]=read_civxdata(filename,InputField,VelType); 2072 2102 if isfield(Field{1},'Txt') 2073 msgbox_uvmat('ERROR',Field{1}.Txt)2103 errormsg=Field{1}.Txt; 2074 2104 return 2075 2105 end … … 2078 2108 end 2079 2109 end 2080 if ~isempty(filename_1) && isequal(FileType_1,'netcdf') %read the second file2110 if ~isempty(filename_1) && ~test_keepdata_1 && isequal(FileType_1,'netcdf') %read the second file 2081 2111 if isequal(FieldName_1,'get_field...')% read the field names on the interface get_field. 2082 2112 hget_field=findobj(allchild(0),'Name','get_field_1');%find the get_field... GUI … … 2123 2153 end 2124 2154 2155 %store the second field for possible latter use 2156 if numel(Field)==2 2157 UvData.Field_1=Field{2}; 2158 end 2159 2125 2160 %update the display buttons for the first velocity type (first menuline) 2126 2161 veltype_handles=[handles.civ1 handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2]; 2127 2162 if ~isequal(FileType,'netcdf') 2128 2163 reset_vel_type(veltype_handles) 2129 elseif isempty(VelType) 2164 elseif isempty(VelType) && ~isequal(FieldName,'get_field...') 2130 2165 set_veltype_display(veltype_handles,CivStage)%update the display of available velocity types for the first field 2131 2166 if isempty(VelType_out) … … 2141 2176 if ~isequal(FileType_1,'netcdf') 2142 2177 reset_vel_type(veltype_handles_1) 2143 elseif isempty(VelType_1) 2178 elseif isempty(VelType_1) && ~isequal(FieldName_1,'get_field...') 2144 2179 set_veltype_display(veltype_handles_1,CivStage_1)%update the display of available velocity types for the first field 2145 2180 if isempty(VelType_out_1) … … 2180 2215 2181 2216 %multislice case 2182 if TestInputFile&&(~isfield(UvData,'NbDim') || isequal(UvData.NbDim,2))&&...%2D case2217 if ~isempty(filename) &&(~isfield(UvData,'NbDim') || isequal(UvData.NbDim,2))&&...%2D case 2183 2218 isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')&& isfield(UvData.XmlData.GeometryCalib,'SliceCoord') 2184 % nbfield2=str2num(get(handles.last_j,'String'));2185 2219 siz=size(UvData.XmlData.GeometryCalib.SliceCoord); 2186 2220 if siz(1)>1 … … 2192 2226 end 2193 2227 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) 2198 2229 end 2199 2230 … … 2220 2251 menu_transform=get(handles.transform_fct,'String'); 2221 2252 choice_value=get(handles.transform_fct,'Value'); 2222 %transform=menu_transform{choice_value};%name of the transform fct given by the menu 'transform_fct'2223 2253 transform_list=get(handles.transform_fct,'UserData'); 2224 2254 transform=transform_list{choice_value};%selected function handles 2225 2255 2226 2256 % z index 2227 if TestInputFile2257 if ~isempty(filename) 2228 2258 Field{1}.ZIndex=mod(num_i1-1,nbslice)+1; 2229 2259 end 2260 2230 2261 %px to phys or other transform on field 2231 if 2262 if ~isempty(transform) 2232 2263 if length(Field)>=2 2233 2264 Field{2}.ZIndex=mod(num_i1-1,nbslice)+1; … … 2245 2276 Field{1}=calc_field(InputField,Field{1}); 2246 2277 end 2247 if length(Field)==2 && isequal(FileType_1,'netcdf') && ~isequal(FieldName_1,'get_field...')2278 if length(Field)==2 && ~test_keepdata_1 && isequal(FileType_1,'netcdf') && ~isequal(FieldName_1,'get_field...') 2248 2279 Field{2}=calc_field(InputField_1,Field{2}); 2249 2280 end … … 2251 2282 % combine the two input fields (e.g. substract velocity fields) 2252 2283 if 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 2256 2285 else 2257 2286 UvData.Field=Field{1}; 2258 2287 end 2288 2259 2289 UvData.NewSeries=0;% put to 0 the test for a new field series (set by RootPath_callback) 2260 2290 % test 3D , default projection menuplane and typical mesh (needed to menuopen set_object) … … 2266 2296 [UvData.Field,errormsg]=check_field_structure(UvData.Field); 2267 2297 if ~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]; 2269 2299 return 2270 2300 end … … 2511 2541 get_field([],ObjectData)% the projected field cannot be automatically plotted: use get_field to specify the variablesdelete(hget_field) 2512 2542 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 2514 2545 end 2515 2546 end 2516 2547 UvData.Object{iobj}.PlotParam=ScalOut; %record the plotting parameters 2517 end 2518 2548 end 2519 2549 end 2520 2550 end … … 2559 2589 set(handles.histo1_menu,'Value',1) 2560 2590 set(handles.histo1_menu,'String',menu_histo) 2561 histo1_menu_Callback(h Object, eventdata, handles)2591 histo1_menu_Callback(handles.histo1_menu, [], handles) 2562 2592 if nb_histo > 1 2563 2593 test_v=1; … … 2566 2596 set(handles.histo2_menu,'String',menu_histo) 2567 2597 set(handles.histo2_menu,'Value',2) 2568 histo2_menu_Callback(h Object, eventdata, handles)2598 histo2_menu_Callback(handles.histo2_menu,[], handles) 2569 2599 end 2570 2600 end … … 2902 2932 function Fields_Callback(hObject, eventdata, handles) 2903 2933 %------------------------------------------------- 2904 huvmat=get(handles.Fields,'parent'); 2934 2905 2935 list_fields=get(handles.Fields,'String');% list menu fields 2906 2936 index_fields=get(handles.Fields,'Value');% selected string index … … 2920 2950 index_fields=get(handles.Fields_1,'Value');% selected string index 2921 2951 field_1= list_fields{index_fields(1)}; % selected string 2922 UvData=get(h uvmat,'UserData');2952 UvData=get(handles.uvmat,'UserData'); 2923 2953 2924 2954 %read the rootfile input display … … 2986 3016 set(handles.fix_pair,'Value',1) 2987 3017 end 2988 % if isequal(field,'velocity')|isequal(field_1,'velocity');2989 % state_vect='on';2990 % else2991 % state_vect='off';2992 % end2993 % if ~isequal(field,'velocity')|(~isequal(field_1,'velocity'));2994 % state_scal='on';2995 % else2996 % state_scal='off';2997 % end2998 3018 setfield(handles);% update the field structure ('civ1'....) 2999 3019 … … 3006 3026 function Fields_1_Callback(hObject, eventdata, handles) 3007 3027 %------------------------------------------------- 3008 huvmat=get(handles.Fields_1,'parent');3009 3028 list_fields=get(handles.Fields,'String');% list menu fields 3010 3029 index_fields=get(handles.Fields,'Value');% selected string index … … 3018 3037 return 3019 3038 end 3020 UvData=get(h uvmat,'UserData');3039 UvData=get(handles.uvmat,'UserData'); 3021 3040 3022 3041 %read the rootfile input display … … 3178 3197 state_scal='off'; 3179 3198 end 3180 set(h uvmat,'UserData',UvData)3199 set(handles.uvmat,'UserData',UvData) 3181 3200 setfield(handles);% update the field structure ('civ1'....) 3182 3201 if ~isfield(UvData,'NewSeries')|isequal(UvData.NewSeries,0)
Note: See TracChangeset
for help on using the changeset viewer.