- Timestamp:
- Apr 13, 2010, 10:37:08 AM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r73 r81 631 631 632 632 % no image documentation file found: look for a series of existing images or .nc files 633 if isempty(time) && ~isequal(ext,'.nc') 633 if isempty(time) && ~isequal(ext,'.nc') && ~strcmp(nom_type_ima,'none') && ~strcmp(nom_type_ima,'') && ~strcmp(nom_type_ima,'*') 634 634 subdir=get(handles.subdir_civ1,'String'); 635 635 incr_pair=[0 0];%default … … 637 637 incr_pair=browse.incr_pair; 638 638 end 639 nbdetect=0;%test of detected images639 % nbdetect=0;%test of detected images 640 640 field_i=field_count; 641 641 idetect=1; 642 while idetect==1 %look for the maximum file number in the series 642 while idetect==1 %look for the maximum file number in the series 643 imagename=name_generator(filebase,field_i+1,1,ext_ima,nom_type_ima); 644 idetect=(exist(imagename,'file')==2); 645 if idetect 643 646 field_i=field_i+1; 644 imagename=name_generator(filebase,field_i,1,ext_ima,nom_type_ima); 645 if strcmp(nom_type_ima,'none')||strcmp(nom_type_ima,'') 646 idetect=0; %stop if the same image is repeated (if nom_type='none') 647 nbdetect=1; 648 else 649 idetect=(exist(imagename,'file')==2); 650 end 647 end 651 648 %SEE CASE OF NETCDF FILES 652 nbdetect=nbdetect+(exist(imagename,'file')==2);649 % nbdetect=nbdetect+(exist(imagename,'file')==2); 653 650 end 654 651 nb_field=field_i;% last detected field number … … 656 653 idetect=1; 657 654 while idetect==1 658 field_i=field_i-1; 659 imagename=name_generator(filebase,field_i,1,ext_ima,nom_type_ima); 660 if isequal(nom_type_ima,'none')||strcmp(nom_type_ima,'') 661 idetect=0; %stop if the same image is repeated (if nom_type='none') 662 nbdetect=1; 663 else 664 idetect=(exist(imagename,'file')==2); 665 end 666 nbdetect=nbdetect+idetect; 667 end 668 first_i=max(field_i+1,1); 655 imagename=name_generator(filebase,field_i-1,1,ext_ima,nom_type_ima); 656 idetect=(exist(imagename,'file')==2); 657 if idetect 658 field_i=field_i-1; 659 end 660 end 661 first_i=max(field_i,1); 669 662 %determine the set of times and possible intervals for CIV 670 663 % dt=(1/1000)*str2num(get(handles.dt,'String')); … … 672 665 set(handles.mode,'String',{'series(Di)'}) 673 666 end 674 if isequal(nom_type_ima,'none')% no file numbering used675 first_i=1;676 last_i=1;677 first_j=1;678 last_j=1;679 end667 % if isequal(nom_type_ima,'none')% no file numbering used 668 % first_i=1; 669 % last_i=1; 670 % first_j=1; 671 % last_j=1; 672 % end 680 673 if exist('time','var') 681 674 if size(time,1)+size(time,2)>=3 % if there are at least two time values to define dt -
trunk/src/imadoc2struct.m
r71 r81 21 21 s.TimeUnit=[]; %default 22 22 s.GeometryCalib=[]; 23 % nom_type_ima=[];%default24 % ext_ima=[];%default25 % abs_time=[];%initiation26 % GeometryCalib.CoordUnit='cm';%default27 % mode=[]; %default28 % NbSlice=1;%default29 % npx=[];%default30 % npy=[];%default31 % GeometryCalib.Pxcmx=1;32 % GeometryCalib.Pxcmy=1;33 % GeometryCalib=[];34 % NbDtj=1;35 23 tsai=[];%default 36 % if ~exist('testime','var')37 % testime=1;%default38 24 39 25 if exist(ImaDoc,'file')~=2, errormsg=[ ImaDoc ' does not exist']; return;end;%input file does not exist … … 121 107 end 122 108 end 123 if size(s.Time,1)==1124 s.Time=(s.Time)'; %change vector into column125 end109 % if size(s.Time,1)==1 110 % s.Time=(s.Time)'; %change vector into column 111 % end 126 112 end 127 113 -
trunk/src/mouse_up.m
r78 r81 262 262 263 263 % editing calibration point 264 if ~zoomstate strcmp(MouseAction,'calib')264 if ~zoomstate && strcmp(MouseAction,'calib') 265 265 h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI 266 266 hh_geometry_calib=guidata(h_geometry_calib); -
trunk/src/read_get_field.m
r80 r81 201 201 SubVarAttribute{nbvar}.Role='coord_y';%abcissa with unstructured coordinates 202 202 end 203 if isequal(dimname_y,dimname_x)204 errormsg='identical x and y coordinates selected in get_field';205 return206 end203 % if isequal(dimname_y,dimname_x) 204 % errormsg='identical x and y coordinates selected in get_field'; 205 % return 206 % end 207 207 end 208 208 … … 465 465 end 466 466 ind_single=find(npxy==1); 467 SingleCellA=[SingleCellA DimCellA(ind_single)]; 467 if ~isempty(ind_single) 468 %SingleCellA=[SingleCellA DimCellA(ind_single)];TO CHECK 469 end 468 470 ind_select=find(npxy~=1);%look for non singleton dimensions 469 471 DimCellA=DimCellA(ind_select); … … 515 517 dimextra(dimA)=[]; %list of unselected dimension indices 516 518 DimCellA=DimCellA([dimA dimextra]); 517 eval(['SubField.' VarNameA '=permute(squeeze(SubField.' VarNameA '),[dimA dimextra]);'])519 % eval(['SubField.' VarNameA '=permute(squeeze(SubField.' VarNameA '),[dimA dimextra]);'])TO CHECK 518 520 SubField.VarDimName{VarSubIndexA}=DimCellA; 519 521 %add default coord_x and/or coord_y if empty -
trunk/src/set_object.m
r79 r81 76 76 % Choose default command line output for set_object 77 77 handles.output = hObject; 78 78 'TESTsetobj' 79 data 79 80 % Update handles structure 80 81 guidata(hObject, handles); … … 138 139 CoordCell=data.Coord; 139 140 data.Coord=zeros(numel(CoordCell),3); 141 data.Coord(:,3)=zeros(numel(CoordCell),1); % z component set to 0 by default 140 142 for iline=1:numel(CoordCell) 141 data.Coord(iline,:)=str2num(CoordCell{iline}); 143 line_vec=str2num(CoordCell{iline}); 144 if numel(line_vec)==2 145 data.Coord(iline,1:2)=str2num(CoordCell{iline}); 146 else 147 data.Coord(iline,:)=str2num(CoordCell{iline}); 148 end 142 149 end 143 150 end -
trunk/src/uvmat.m
r77 r81 628 628 update_rootinfo(hObject,eventdata,handles) 629 629 630 631 632 633 630 %------------------------------------------------------------------- 631 %-- called by action in FileIndex edit box 632 %------------------------------------------------------------------- 633 function FileIndex_Callback(hObject, eventdata, handles) 634 FileIndices=get(handles.FileIndex,'String'); 635 if isempty(str2num(FileIndices)) 636 [pp,ff,str1,str2,str_a,str_b]=name2display(FileIndices); 637 else 638 str1=FileIndices; 639 str2=''; 640 str_a=''; 641 str_b=''; 642 end 643 set(handles.i1,'String',str1); 644 set(handles.i2,'String',str2); 645 set(handles.j1,'String',str_a); 646 set(handles.j2,'String',str_b); 647 run0_Callback(hObject, eventdata, handles) 648 649 %------------------------------------------------------------------- 650 %-- called by action in FileIndex_1 edit box 651 %------------------------------------------------------------------- 652 function FileIndex_1_Callback(hObject, eventdata, handles) 653 % FileIndices=get(handles.FileIndex_1,'String'); 654 % if isempty(str2num(FileIndices)) 655 % [pp,ff,str1,str2,str_a,str_b]=name2display(FileIndices) 656 % else 657 % str1=FileIndices; 658 % str2=''; 659 % str_a=''; 660 % str_b=''; 661 % end 662 % set(handles.i1,'String',str1); 663 % set(handles.i2,'String',str2); 664 % set(handles.j1,'String',str_a); 665 % set(handles.j2,'String',str_b); 666 run0_Callback(hObject, eventdata, handles) 634 667 635 668 %------------------------------------------------------------------- … … 644 677 UvData.NewSeries=1; %flag for run0: begin a new series 645 678 UvData.TestInputFile=1; 646 set(handles.fix_pair,'Value', 0) % desactivate by default the comp_input '-'input window679 set(handles.fix_pair,'Value',1) % activate by default the comp_input '-'input window 647 680 %FileIndex_Callback(hObject, eventdata, handles)% update field counters 648 681 … … 860 893 function set_scan_options(hObject, eventdata, handles) 861 894 862 % set the corresponding index navigation options (TO CHECK WITH THE SECOND FIELD)863 NomType=get(handles.FileIndex,'UserData'); 895 % set the corresponding index navigation options 896 NomType=get(handles.FileIndex,'UserData'); 864 897 NomType_1=get(handles.FileIndex_1,'UserData'); 898 last_i_str=get(handles.last_i,'String'); 899 nbfield=str2num(last_i_str{1}); 900 if numel(last_i_str)==2 901 nbfield=min(nbfield,str2num(last_i_str{2})); 902 end 865 903 state_j='off'; %default 866 scan_option='i'; 904 scan_option='i';%default 867 905 switch NomType 868 906 case {'_i_j','_i_j1-j2','_i1-i2_j','#_ab'},% two navigation indices 869 907 state_j='on'; 870 if exist('nbfield','var') && isequal(nbfield,1) 871 scan_option='j'; 872 else 873 scan_option='i'; 908 if isequal(nbfield,1) 909 scan_option='j'; 874 910 end 875 911 end … … 878 914 case {'_i_j','_i_j1-j2','_i1-i2_j','#_ab'},% two navigation indices 879 915 state_j='on'; 880 if exist('nbfield','var') && isequal(nbfield,1) 881 scan_option='j'; 882 else 883 scan_option='i'; 884 end 916 if isequal(nbfield,1) 917 scan_option='j'; 918 end 885 919 end 886 920 end … … 1073 1107 end 1074 1108 end 1075 set(handles.FileIndex ,'UserData',NomType_1);1109 set(handles.FileIndex_1,'UserData',NomType_1); 1076 1110 1077 1111 % make visible and fill the second raw of edit boxes … … 1290 1324 set(handles.scan_i,'BackgroundColor',[1 1 0]) 1291 1325 set(handles.scan_j,'Value',0) 1292 set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784])1326 % set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784]) 1293 1327 else 1294 1328 set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784]) 1295 1329 set(handles.scan_j,'Value',1) 1296 set(handles.scan_j,'BackgroundColor',[1 1 0]) 1297 end 1330 % set(handles.scan_j,'BackgroundColor',[1 1 0]) 1331 end 1332 scan_j_Callback(hObject, eventdata, handles) 1298 1333 1299 1334 %------------------------------------------------------------------- … … 1305 1340 set(handles.scan_i,'Value',0) 1306 1341 set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784]) 1342 NomType=get(handles.FileIndex,'UserData'); 1343 switch NomType 1344 case {'_i_j1-j2','#_ab','%3dab'},% pair with j index 1345 set(handles.fix_pair,'Visible','on')% option fixed pair on/off made visible (choice of avaible pair with buttons + and - if ='off') 1346 otherwise 1347 set(handles.fix_pair,'Visible','off') 1348 end 1307 1349 else 1308 1350 set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784]) 1309 1351 set(handles.scan_i,'Value',1) 1310 1352 set(handles.scan_i,'BackgroundColor',[1 1 0]) 1353 set(handles.fix_pair,'Visible','off') 1311 1354 end 1312 1355 … … 1588 1631 1589 1632 %------------------------------------------------------------------- 1590 %Executes on button press in runmin: make one step backward and call 1591 %run0. The step backward is along the fields series 1 or 2 depending on 1592 %the scan_i and scan_j check box (exclusive each other) 1593 %------------------------------------------------------------------- 1594 function RunMovie_Callback(hObject, eventdata, handles) 1633 % -- Executes on button press in Movie: make a series of +> steps 1634 function Movie_Callback(hObject, eventdata, handles) 1595 1635 %------------------------------------------------------------------ 1596 set(handles. RunMovie,'BackgroundColor',[1 1 0])%paint the command button in yellow1636 set(handles.Movie,'BackgroundColor',[1 1 0])%paint the command button in yellow 1597 1637 drawnow 1598 1638 increment=str2num(get(handles.increment_scan,'String')); %get the field increment d … … 1600 1640 set(handles.speed,'Visible','on') 1601 1641 set(handles.speed_txt,'Visible','on') 1602 set(handles. RunMovie,'BusyAction','queue')1642 set(handles.Movie,'BusyAction','queue') 1603 1643 testavi=0; 1604 1644 UvData=get(handles.uvmat,'UserData'); 1605 1645 1606 while get(handles.speed,'Value')~=0 & isequal(get(handles. RunMovie,'BusyAction'),'queue') % enable STOP command1646 while get(handles.speed,'Value')~=0 & isequal(get(handles.Movie,'BusyAction'),'queue') % enable STOP command 1607 1647 errormsg=runpm(hObject,eventdata,handles,increment); 1608 1648 if ~isempty(errormsg) … … 1615 1655 set(handles.uvmat,'UserData',UvData); 1616 1656 end 1617 set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red 1657 set(handles.Movie,'BackgroundColor',[1 0 0])%paint the command buttonback to red 1658 1659 %------------------------------------------------------------------- 1660 % -- Executes on button press in Movie: make a series of <- steps 1661 function MovieBackward_Callback(hObject, eventdata, handles) 1662 %------------------------------------------------------------------ 1663 set(handles.MovieBackward,'BackgroundColor',[1 1 0])%paint the command button in yellow 1664 drawnow 1665 increment=-str2num(get(handles.increment_scan,'String')); %get the field increment d 1666 set(handles.STOP,'Visible','on') 1667 set(handles.speed,'Visible','on') 1668 set(handles.speed_txt,'Visible','on') 1669 set(handles.MovieBackward,'BusyAction','queue') 1670 testavi=0; 1671 UvData=get(handles.uvmat,'UserData'); 1672 1673 while get(handles.speed,'Value')~=0 & isequal(get(handles.MovieBackward,'BusyAction'),'queue') % enable STOP command 1674 errormsg=runpm(hObject,eventdata,handles,increment); 1675 if ~isempty(errormsg) 1676 return 1677 end 1678 pause(1.02-get(handles.speed,'Value'))% wait for next image 1679 end 1680 if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj), 1681 UvData.aviobj=close(UvData.aviobj); 1682 set(handles.uvmat,'UserData',UvData); 1683 end 1684 set(handles.MovieBackward,'BackgroundColor',[1 0 0])%paint the command buttonback to red 1618 1685 1619 1686 %------------------------------------------------------------------- … … 1622 1689 set(handles.movie_pair,'BusyAction','Cancel') 1623 1690 set(handles.movie_pair,'value',0) 1624 set(handles.RunMovie,'BusyAction','Cancel') 1691 set(handles.Movie,'BusyAction','Cancel') 1692 set(handles.MovieBackward,'BusyAction','Cancel') 1625 1693 set(handles.MenuExportMovie,'BusyAction','Cancel') 1626 1694 … … 1658 1726 1659 1727 comp_input=get(handles.fix_pair,'Value'); 1660 if isequal(NomType,'_i1-i2')||isequal(NomType,'_i1-i2_j')1661 comp_input=1; %impose a fixed pair1662 set(handles.fix_pair,'Value',1)1663 end1728 % if isequal(NomType,'_i1-i2')||isequal(NomType,'_i1-i2_j') 1729 % comp_input=1; %impose a fixed pair 1730 % set(handles.fix_pair,'Value',1) 1731 % end 1664 1732 1665 1733 %case of scanning along the first direction (rootfile numbers) … … 1709 1777 [indices]=name_generator('',num1,num_a,'',NomType,1,num2,num_b,''); 1710 1778 set(handles.FileIndex,'String',indices); 1711 if sub_value1779 if ~isempty(filename_1) 1712 1780 indices_1=name_generator('',num1_1,num_a_1,'',NomType_1,1,num2_1,num_b_1,''); 1713 1781 set(handles.FileIndex_1,'String',indices_1); … … 1897 1965 function errormsg=refresh_field(handles,filename,filename_1,num_i1,num_i2,num_j1,num_j2,Field) 1898 1966 %------------------------------------------------------------------------ 1967 1899 1968 %initialisation 1900 1969 set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow … … 1926 1995 FileType=[];%default 1927 1996 if ~isempty(filename) 1928 % [filename,RootPath,filebase,xx,Ext]=read_file_boxes(handles);1929 1997 if ~exist(filename,'file') 1930 1998 errormsg=['input file ' filename ' does not exist']; … … 2421 2489 if NbDim==3 2422 2490 nbpoints=UvData.Field.DimValue(DimIndex(1)); 2423 %Zvar=DimVarIndex(DimIndex(1));2424 %Zvar=DimVarIndex(1);2425 % Zvar=VarType{imax}.coord_3;2426 2491 if isfield(VarType{imax},'coord_3')&& ~isequal(VarType{imax}.coord_3,0) % z is a dimension variable 2427 ZName=UvData.Field.ListVarName{VarType{imax}.coord_3} 2492 ZName=UvData.Field.ListVarName{VarType{imax}.coord_3}; 2428 2493 eval(['UvData.ZMax=max(UvData.Field.' ZName ');']) 2429 2494 eval(['UvData.ZMin=min(UvData.Field.' ZName ');']) … … 3075 3140 set(handles.npx,'Visible','on') 3076 3141 set(handles.npy,'Visible','on') 3077 set(handles.fix_pair,'Value',0)3142 % set(handles.fix_pair,'Value',0) 3078 3143 else 3079 3144 set(handles.npx_title,'Visible','off')% visible npx,pxcm... buttons … … 3081 3146 set(handles.npx,'Visible','off') 3082 3147 set(handles.npy,'Visible','off') 3083 set(handles.fix_pair,'Value',1)3148 % set(handles.fix_pair,'Value',1) 3084 3149 end 3085 3150 setfield(handles);% update the field structure ('civ1'....) … … 3246 3311 set(handles.npx,'Visible','on') 3247 3312 set(handles.npy,'Visible','on') 3248 set(handles.fix_pair,'Value',0)3313 % set(handles.fix_pair,'Value',0) 3249 3314 else 3250 3315 set(handles.npx_title,'Visible','off')% visible npx,pxcm... buttons … … 3252 3317 set(handles.npx,'Visible','off') 3253 3318 set(handles.npy,'Visible','off') 3254 set(handles.fix_pair,'Value',1)3319 % set(handles.fix_pair,'Value',1) 3255 3320 end 3256 3321 if isequal(field,'velocity')|isequal(field_1,'velocity'); … … 4415 4480 set(handles.speed,'Visible','on') 4416 4481 set(handles.speed_txt,'Visible','on') 4417 set(handles. RunMovie,'BusyAction','queue')4482 set(handles.Movie,'BusyAction','queue') 4418 4483 4419 4484 imin=str2num(get(handles.i1,'String')); … … 4759 4824 end 4760 4825 UvData=get(handles.uvmat,'UserData'); 4761 %[hset_object,UvData.sethandles]=set_object(data);% call the set_object interface4826 [hset_object,UvData.sethandles]=set_object(data);% call the set_object interface 4762 4827 % %position the set_object GUI with respect to uvmat 4763 4828 % pos_uvmat=get(handles.uvmat,'Position'); … … 4866 4931 4867 4932 4933 4934 4935 4936
Note: See TracChangeset
for help on using the changeset viewer.