Changeset 45 for trunk/src/civ.m
- Timestamp:
- Mar 15, 2010, 5:39:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r41 r45 65 65 %default initial parameters 66 66 filebase=''; % root file name ('filebase'.civ) 67 nom_type=[]; % nomenclature type67 %nom_type=[]; % nomenclature type 68 68 ext=[]; 69 69 testall=0; … … 111 111 path_uvmat=which('uvmat');% check the path detected for source file uvmat 112 112 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 113 errormsg=[];%default error message 113 114 if isunix 114 115 syst='LINUX'; 115 %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ binary names116 116 xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml'); 117 display(xmlfile)118 117 if exist(xmlfile,'file') 118 try 119 119 t=xmltree(xmlfile); 120 120 sparam=convert(t); 121 catch 122 errormsg={[' Problem for reading ' xmlfile]; lasterr}; 123 end 124 else 125 erromsg=[xmlfile ' not found: path to civx binaries undefined']; 121 126 end 122 127 else … … 124 129 xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml'); 125 130 if exist(xmlfile,'file') 131 try 126 132 t=xmltree(xmlfile); 127 133 sparam=convert(t); 128 end 129 end 130 display(syst) 134 catch 135 errormsg={[' Problem for reading ' xmlfile]; lasterr}; 136 end 137 else 138 erromsg=[xmlfile ' not found: path to civx binaries undefined']; 139 end 140 end 141 display(syst) 142 if ~isempty(errormsg) 143 msgbox_uvmat('ERROR',errormsg); 144 end 131 145 patch_new_exe=''; 132 146 % todo_patch=''; … … 143 157 end 144 158 name_todo=fullfile(todo_path,'TODO.txt'); 145 display(name_todo)146 159 test_batch=1; 147 160 if ~sge … … 296 309 t_browse=xmltree(fileinput); 297 310 head_element=get(t_browse,1); 298 if isfield(head_element,'name')& isequal(head_element.name,'ImaDoc')311 if isfield(head_element,'name')&& isequal(head_element.name,'ImaDoc') 299 312 testeditxml=0; 300 313 end 301 314 end 302 if testeditxml==1 | isequal(ext,'.xls')315 if testeditxml==1 || isequal(ext,'.xls') 303 316 heditxml=editxml({fileinput}); 304 317 set(heditxml,'Tag','browser') … … 314 327 end 315 328 end 316 [RootPath,RootFile, field_count,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput);329 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput) 317 330 filebase=fullfile(RootPath,RootFile); 331 if isequal(nom_type,'*')% all fields in a single file ( movie files) 332 num_i1=1;num_i2=1;num_j1=1;num_j2=1; 333 else 334 num_i1=str2double(str1); 335 num_i2=str2double(str2); 336 num_j1=str2double(str_a); 337 num_j2=str2double(str_b); 338 end 318 339 if isequal(get(handles.compare,'Value'),1) 319 340 browse=[];%initialisation … … 321 342 browse=get(handles.browse_root,'UserData'); 322 343 end 323 if length(ext)>1 & (~isempty(imformats(ext([2:end])))|...324 isequal(ext,'.avi')| isequal(ext,'.AVI'));%if an image file has been opened by uvmat344 if length(ext)>1 && (~isempty(imformats(ext([2:end])))||... 345 isequal(ext,'.avi')||isequal(ext,'.AVI'));%if an image file has been opened by uvmat 325 346 set(handles.ext_ima,'String',ext) 326 347 browse.nom_type_ima=nom_type; 327 browse.field_count= str2num(field_count);328 A=imread(fileinput);329 npxy=size(A);330 set(handles.ext_ima,'UserData',npxy)348 browse.field_count=num_i1; 349 % A=imread(fileinput); 350 % npxy=size(A); 351 % set(handles.ext_ima,'UserData',npxy) 331 352 end 332 353 set(handles.ImaDoc,'String',ext); … … 362 383 set(handles.displ_filebase,'String',filebase); 363 384 set(handles.ImaDoc,'String',ext); 364 if ~isempty( str2num(field_count))365 ref_i= str2num(field_count);366 if ~isempty( str2num(str2))367 ref_i=floor((ref_i+ str2num(str2))/2);% reference image number corresponding to the file368 browse.incr_pair(1)= str2num(str2)-str2num(field_count);385 if ~isempty(num_i1) 386 ref_i=num_i1; 387 if ~isempty(num_i2) 388 ref_i=floor((ref_i+num_i2)/2);% reference image number corresponding to the file 389 browse.incr_pair(1)=num_i2-num_i1; 369 390 browse.incr_pair(2)=0; 370 391 end … … 373 394 set(handles.ref_i,'String',num2str(ref_i)); 374 395 end 375 if isempty( str2num(str_a))396 if isempty(num_j1) 376 397 set(handles.ref_j,'String','1'); 377 398 else 378 ref_j= str2num(str_a);379 if ~isempty( str2num(str_b))380 ref_j=floor(( str2num(str_a)+str2num(str_b))/2);381 browse.incr_pair(2)= str2num(str_b)-str2num(str_a);399 ref_j=num_j1; 400 if ~isempty(num_j2) 401 ref_j=floor((num_j1+num_j2)/2); 402 browse.incr_pair(2)=num_j2-num_j1; 382 403 end 383 404 set(handles.first_j,'String',num2str(ref_j)); … … 448 469 field_count=1;%default 449 470 nom_type_nc=[]; 450 % npx=[];%default451 % npy=[];452 471 time=[]; 453 472 TimeUnit=[]; %default … … 555 574 [PP,FF,fc,str2,str_a,str_b,ext_ima_read,nom_type_read]=name2display(XmlData.Heading.ImageName); 556 575 fullname=fullfile(fileparts(filebase),XmlData.Heading.ImageName); %full name (including path) of the first image defined by the xmle file, 557 if exist(fullname,'file')558 testima_xml=1;559 else576 if ~exist(fullname,'file') 577 % testima_xml=1; 578 % else 560 579 msgbox_uvmat('WARNING',['FirstImage ' fullname ' defined in the xml file does not exist']) 561 580 end … … 569 588 if ~isempty(ImageSize)&& ~isempty(ImageSize) 570 589 xindex=findstr(ImageSize,'x'); 571 if length(xindex)>=2572 npx=str2num(ImageSize(1:xindex(1)-1));573 npy=str2num(ImageSize(xindex(1)+1:xindex(2)-1));574 end590 % if length(xindex)>=2 591 % npx=str2num(ImageSize(1:xindex(1)-1)); 592 % npy=str2num(ImageSize(xindex(1)+1:xindex(2)-1)); 593 % end 575 594 end 576 595 end … … 994 1013 %reads .nc subdirectoy and image numbers from the interface 995 1014 subdir_civ1=get(handles.subdir_civ1,'String');%subdirectory subdir_civ1 for the netcdf data 996 first_i=str2num(get(handles.first_i,'String'));997 last_i=str2num(get(handles.last_i,'String'));998 incr=str2num(get(handles.incr_i,'String'));999 num1=first_i:incr:last_i;1000 if isempty(num1)1001 set(handles.list_pair_civ1,'String',{''});1002 return1003 end1004 ref_i=str2 num(get(handles.ref_i,'String'));1015 % first_i=str2num(get(handles.first_i,'String')); 1016 % last_i=str2num(get(handles.last_i,'String')); 1017 % incr=str2num(get(handles.incr_i,'String')); 1018 % num1=first_i:incr:last_i; 1019 % if isempty(num1) 1020 % set(handles.list_pair_civ1,'String',{''}); 1021 % return 1022 % end 1023 ref_i=str2double(get(handles.ref_i,'String')); 1005 1024 if isequal(mode,'pair j1-j2')%|isequal(mode,'st_pair j1-j2') 1006 1025 ref_j=0; 1007 1026 else 1008 ref_j=str2 num(get(handles.ref_j,'String'));1027 ref_j=str2double(get(handles.ref_j,'String')); 1009 1028 end 1010 1029 time=get(handles.displ_filebase,'UserData');%get the set of times … … 1012 1031 time=[0 1]; 1013 1032 end 1014 dt_unit=str2 num(get(handles.dt,'String'));% used when there is no image documentation file1033 dt_unit=str2double(get(handles.dt,'String'));% used when there is no image documentation file 1015 1034 displ_num=get(handles.list_pair_civ1,'UserData'); 1016 1035 … … 1034 1053 testpair=0; 1035 1054 if get(handles.CIV1,'Value')==0 % 1036 dirname=fullfile(filepath,subdir_civ1,ext_dir);1037 1055 if ~exist(fullfile(filepath,subdir_civ1,ext_dir),'dir') 1038 1056 msgbox_uvmat('ERROR',['no civ1 file available: subdirectory ' subdir_civ1 ' does not exist']); … … 1121 1139 set(handles.list_pair_civ1,'String',displ_pair'); 1122 1140 ichoice=min(find(select)); 1123 if (isempty(ichoice) | ichoice < 1); ichoice=1; end; 1124 initial=get(handles.list_pair_civ1,'Value'); 1125 if initial>nbpair |~isequal(select(initial),1) 1141 if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 1142 initial=get(handles.list_pair_civ1,'Value');%initial choice of pair 1143 if initial>nbpair 1144 set(handles.list_pair_civ1,'Value',ichoice);% first valid pair proposed by default in the menu 1145 end 1146 if numel(select)>=initial && ~isequal(select(initial),1) 1126 1147 set(handles.list_pair_civ1,'Value',ichoice);% first valid pair proposed by default in the menu 1127 1148 end 1149 1128 1150 %set(handles.list_pair_civ2,'String',displ_pair'); 1129 1151 initial=get(handles.list_pair_civ2,'Value'); … … 1187 1209 subdir_civ1=get(handles.subdir_civ1,'String');%subdirectory subdir_civ1 for the netcdf data 1188 1210 subdir_civ2=get(handles.subdir_civ2,'String');%subdirectory subdir_civ2 for the netcdf data 1189 first_i=str2num(get(handles.first_i,'String'));1190 last_i=str2num(get(handles.last_i,'String'));1191 incr=str2num(get(handles.incr_i,'String'));1192 num1=first_i:incr:last_i;1193 if isempty(num1)1194 set(handles.list_pair_civ2,'Value',1);1195 set(handles.list_pair_civ2,'String',{''});1196 return1197 end1211 % first_i=str2num(get(handles.first_i,'String')); 1212 % last_i=str2num(get(handles.last_i,'String')); 1213 % incr=str2num(get(handles.incr_i,'String')); 1214 % num1=first_i:incr:last_i; 1215 % if isempty(num1) 1216 % set(handles.list_pair_civ2,'Value',1); 1217 % set(handles.list_pair_civ2,'String',{''}); 1218 % return 1219 % end 1198 1220 ref_i=str2num(get(handles.ref_i,'String')); 1199 1221 if isequal(mode,'pair j1-j2')%|isequal(mode,'st_pair j1-j2') … … 1319 1341 find_pair_indices(handles,mode) 1320 1342 %------------------------------------------------------------------------ 1321 first_i=str2 num(get(handles.first_i,'String'));%first index i1322 last_i=str2 num(get(handles.last_i,'String'));%last index i1323 incr=str2 num(get(handles.incr_i,'String'));% increment1343 first_i=str2double(get(handles.first_i,'String'));%first index i 1344 last_i=str2double(get(handles.last_i,'String'));%last index i 1345 incr=str2double(get(handles.incr_i,'String'));% increment 1324 1346 num_i=[first_i:incr:last_i];% list of i indices (reference values for each pair) 1325 1347 if isequal(get(handles.first_j,'Visible'),'on') 1326 first_j=str2 num(get(handles.first_j,'String'));%first index j1327 last_j=str2 num(get(handles.last_j,'String'));%last index j1328 incr_j=str2 num(get(handles.incr_j,'String'));% increment1348 first_j=str2double(get(handles.first_j,'String'));%first index j 1349 last_j=str2double(get(handles.last_j,'String'));%last index j 1350 incr_j=str2double(get(handles.incr_j,'String'));% increment 1329 1351 else 1330 1352 first_j=1; … … 1360 1382 str_raw=str_civ1(indsel); 1361 1383 indsepar=find(str_raw=='|'); %character index of the separator 1362 d1=str2 num(str_civ1([indsel(indsepar-1)+1:indsel(indsepar)-1]));1384 d1=str2double(str_civ1([indsel(indsepar-1)+1:indsel(indsepar)-1])); 1363 1385 if indsepar==length(str_raw) 1364 d2=str2 num(str_civ1([indsel(indsepar)+1:end]));1386 d2=str2double(str_civ1([indsel(indsepar)+1:end])); 1365 1387 else 1366 d2=str2 num(str_civ1([indsel(indsepar)+1:indsel(indsepar+1)-1]));1388 d2=str2double(str_civ1([indsel(indsepar)+1:indsel(indsepar+1)-1])); 1367 1389 end 1368 1390 num1_civ1=num_i-d1;% set of first image numbers … … 1609 1631 1610 1632 %read names of the .exe file 1611 if box_test(1)==1 | box_test(3)==1 | box_test(4)==1| box_test(6)==11633 if box_test(1)==1 || box_test(3)==1 || box_test(4)==1 || box_test(6)==1 1612 1634 path_uvmat=which('uvmat');% check the path detected for source file uvmat 1613 1635 path_UVMAT=fileparts(path_uvmat); %path to UVMAT … … 1629 1651 if isfield(sparam,'Civ1_exe') 1630 1652 civ1_exe=sparam.Civ1_exe; 1653 if isequal(civ1_exe(1:4),'civx')%the binary is defined in /civx, default setting 1654 civ1_exe=fullfile(path_UVMAT,civ1_exe); 1655 end 1631 1656 end 1632 1657 if isfield(sparam,'Civ2_exe') 1633 1658 civ2_exe=sparam.Civ2_exe; 1659 if isequal(civ2_exe(1:4),'civx')%the binary is defined in /civx, default setting 1660 civ2_exe=fullfile(path_UVMAT,civ2_exe); 1661 end 1634 1662 end 1635 1663 if isfield(sparam,'Patch_exe') 1636 1664 patch_exe=sparam.Patch_exe; 1665 if isequal(patch_exe(1:4),'civx')%the binary is defined in /civx, default setting 1666 patch_exe=fullfile(path_UVMAT,patch_exe); 1667 end 1637 1668 end 1638 1669 if isfield(sparam,'Stinterp_exe') … … 1640 1671 end 1641 1672 if isfield(sparam,'SGE') 1642 sge=str2 num(sparam.SGE);1673 sge=str2double(sparam.SGE); 1643 1674 end 1644 1675 if ~isunix % for windows system, check whether the Matlab working dir is a UBC name … … 1692 1723 field1.vel_type='civ1'; 1693 1724 field1.nb='nb_vectors'; 1694 field1.X='vec_X';1695 field1.Y='vec_Y';1696 field1.U='vec_U';1697 field1.V='vec_V';1725 % field1.X='vec_X'; 1726 % field1.Y='vec_Y'; 1727 % field1.U='vec_U'; 1728 % field1.V='vec_V'; 1698 1729 field1.fixflag='vec_FixFlag'; 1699 1730 flagindex(1)=get(handles.vec_Fmin2, 'Value'); 1700 1731 flagindex(2)=get(handles.vec_F3, 'Value'); 1701 1732 flagindex(3)=get(handles.vec_F2, 'Value'); 1702 thresh_vecC=str2 num(get(handles.thresh_vecC,'String'));%threshold on image correlation vec_C1703 thresh_vel=str2 num(get(handles.thresh_vel,'String'));%threshold on velocity modulus1733 thresh_vecC=str2double(get(handles.thresh_vecC,'String'));%threshold on image correlation vec_C 1734 thresh_vel=str2double(get(handles.thresh_vel,'String'));%threshold on velocity modulus 1704 1735 inf_sup=get(handles.inf_sup1,'Value'); 1705 1736 menu=get(handles.field_ref1,'String'); … … 1710 1741 fieldchoice=menu{index}; 1711 1742 end 1712 h = waitbar(0, ['removing velocity vectors, fix1']);% display a wait bar1743 h = waitbar(0,'removing velocity vectors, fix1');% display a wait bar 1713 1744 test_mask=get(handles.get_mask_fix1,'Value'); 1714 1745 if test_mask … … 1728 1759 maskflag=0; 1729 1760 elseif test_mask==1 1730 nbslice_mask=str2 num(maskdispl(1:end-4)); %1761 nbslice_mask=str2double(maskdispl(1:end-4)); % 1731 1762 num1_mask=mod(num1_civ1(ifile)-1,nbslice_mask)+1; 1732 1763 maskname=name_generator(maskbase,num1_mask,1,'.png','_i');% mask corresponding to the first image of the pair … … 3291 3322 3292 3323 %COPY IMAGES TO THE FORMAT .png IF NEEDED 3293 if isequal(nom_type_ima1,'*') 3294 nom_type_imanew ='_i';3324 if isequal(nom_type_ima1,'*')%case of movie files 3325 nom_type_imanew1='_i'; 3295 3326 else 3296 3327 nom_type_imanew1=nom_type_ima1; 3297 3328 end 3298 if isequal(nom_type_ima2,'*') 3299 nom_type_imanew ='_i';3329 if isequal(nom_type_ima2,'*')%case of movie files 3330 nom_type_imanew2='_i'; 3300 3331 else 3301 3332 nom_type_imanew2=nom_type_ima2; 3302 3333 end 3303 3334 if ~isequal(ext_ima,'.png') 3335 %%type of image file 3336 type_ima1='none';%default 3337 movieobject1=[];%default 3338 if isequal(lower(ext_ima),'.avi') 3339 hhh=which('mmreader'); 3340 if ~isequal(hhh,'')&& mmreader.isPlatformSupported()% if the mmreader function is found (recent version of matlab) 3341 type_ima1='movie'; 3342 movieobject1=mmreader([filebase_ima2 ext_ima]); 3343 else 3344 type_ima1='avi'; 3345 end 3346 else 3347 form=imformats(ext_ima(2:end)); 3348 if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab 3349 if isequal(nom_type_ima1,'*'); 3350 type_ima1='multimage';%image series in a single image file 3351 else 3352 type_ima1='image'; 3353 end 3354 end 3355 end 3356 type_ima2='none';%default 3357 movieobject2=[]; 3358 if isequal(lower(ext_ima),'.avi') 3359 hhh=which('mmreader'); 3360 if ~isequal(hhh,'')&& mmreader.isPlatformSupported()% if the mmreader function is found (recent version of matlab) 3361 type_ima2='movie'; 3362 movieobject2=mmreader([filebase_ima2 ext_ima]); 3363 else 3364 type_ima2='avi'; 3365 end 3366 else 3367 form=imformats(ext_ima(2:end)); 3368 if ~isempty(form)% if the extension corresponds to an image format recognized by Matlab 3369 if isequal(nom_type_ima1,'*'); 3370 type_ima2='multimage';%image series in a single image file 3371 else 3372 type_ima2='image'; 3373 end 3374 end 3375 end 3304 3376 %npxy=get(handles.ext_ima,'UserData'); 3305 3377 % % if numel(npxy)<2 … … 3318 3390 filename=name_generator(filebase_ima1,num1_civ1(ifile),num_a_civ1(j),'.png',nom_type_imanew1); 3319 3391 if ~exist(filename,'file') 3320 A=read_image(filecell.ima1.civ1{ifile,j}, nom_type_ima2,num1_civ1(ifile));3392 A=read_image(filecell.ima1.civ1{ifile,j},type_ima1,num1_civ1(ifile),movieobject1); 3321 3393 imwrite(A,filename,'BitDepth',16); 3322 3394 end … … 3324 3396 filename=name_generator(filebase_ima2, num2_civ1(ifile),num_b_civ1(j),'.png',nom_type_imanew2); 3325 3397 if ~exist(filename,'file') 3326 A=read_image(filecell.ima2.civ1{ifile,j}, nom_type_ima2,num2_civ1(ifile));3398 A=read_image(filecell.ima2.civ1{ifile,j},type_ima2,num2_civ1(ifile),movieobject2); 3327 3399 imwrite(A,filename,'BitDepth',16); 3328 3400 end … … 4970 5042 path_to_uvmat=which ('uvmat');% check the path of uvmat 4971 5043 pathelp=fileparts(path_to_uvmat); 4972 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html') ;5044 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html') 4973 5045 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 4974 5046 else … … 4979 5051 %------------------------------------------------------------------------ 4980 5052 %--read images and convert them to the uint16 format used for PIV 4981 function A=read_image(filename,nom_type,npx,npy,num); 4982 %------------------------------------------------------------------------ 4983 %npx, npy are the dimensions needed for the raw SMD images 5053 function A=read_image(filename,type_ima,num,movieobject) 5054 %------------------------------------------------------------------------ 4984 5055 %num is the view number needed for an avi movie 4985 if isequal(nom_type,'avi') 4986 mov=aviread(filename,num); 4987 A=frame2im(mov(1)); 5056 switch type_ima 5057 case 'movie' 5058 A=read(movieobject,num); 5059 case 'avi' 5060 mov=aviread(filename,num); 5061 A=frame2im(mov(1)); 5062 case 'multimage' 5063 A=imread(filename,num); 5064 case 'image' 5065 A=imread(filename); 5066 end 5067 siz=size(A); 5068 if length(siz)==3;%color images 4988 5069 A=sum(double(A),3); 4989 5070 A=uint16(A); 4990 elseif isequal(nom_type,'raw_SMD') 4991 [fid,message]=fopen(filename,'r'); 4992 B=fread(fid,Inf,'int16',0,'ieee-le');%read 16 bit binary file 4993 A=(reshape(B,npx,npy))'; %remplissage ligne par ligne avec une matrice colonne ? transposer(uB) pour avoir une matrice ligne 4994 A=uint16(A); 4995 fclose(fid); 4996 else 4997 A=imread(filename); 4998 siz=size(A); 4999 if length(siz)==3;%color images 5000 A=sum(double(A),3); 5001 end 5002 A=uint16(A); 5003 end 5004 5005 % %---------------------------------------------------------------- 5006 % %Executes on carriage return on the time interval dt 5007 % %---------------------------------------------------------------- 5008 % function dt_Callback(hObject, eventdata, handles) 5009 % %determine the set of times and possible intervals for CIV 5010 % % answer=inputdlg('time interval between images?'); 5011 % dt=(1/1000)*str2num(get(handles.dt,'String')); 5012 % nbfield=str2num(get(handles.nb_field,'String')); %last image number selected in the processing series 5013 % time=(dt*[0:nbfield-1])'; 5014 % % set(handles.incr_i,'UserData',dt);%store the time interval between successive images 5015 % set(handles.displ_filebase,'UserData',time); %store the set of times 5016 % for index=1:min(nbfield-1,200) 5017 % displ_num(1,index)=1; 5018 % displ_num(2,index)=1; 5019 % displ_num(3,index)=-floor(index/2); 5020 % displ_num(4,index)=ceil(index/2); 5021 % end 5022 % set(handles.list_pair_civ1,'Value',1); 5023 % set(handles.list_pair_civ1,'UserData',displ_num); 5024 % set(handles.list_pair_civ2,'Value',1); 5025 % %update the list of time intervals 5026 % find_netcpair_civ1(hObject, eventdata, handles) 5027 % find_netcpair_civ2(hObject, eventdata, handles) 5071 end 5028 5072 5029 5073 %------------------------------------------------------------------------ … … 5033 5077 mode_value=get(handles.mode,'Value'); 5034 5078 mode=mode_list{mode_value}; 5035 %if isequal(get(handles.CIV1,'Value'),0)|| isequal(mode,'series(Di)') 5036 find_netcpair_civ1(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 5037 %end 5079 find_netcpair_civ1(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 5038 5080 if isequal(mode,'series(Di)') || ...% we do patch2 only 5039 (get(handles.CIV2,'Value')==0 & get(handles.CIV1,'Value')==0 & get(handles.FIX1,'Value')==0& get(handles.PATCH1,'Value')==0)5081 (get(handles.CIV2,'Value')==0 && get(handles.CIV1,'Value')==0 && get(handles.FIX1,'Value')==0 && get(handles.PATCH1,'Value')==0) 5040 5082 find_netcpair_civ2(hObject, eventdata, handles); 5041 5083 end … … 5047 5089 mode_value=get(handles.mode,'Value'); 5048 5090 mode=mode_list{mode_value}; 5049 if isequal(get(handles.CIV1,'Value'),0)| isequal(mode,'series(Dj)')5091 if isequal(get(handles.CIV1,'Value'),0)|| isequal(mode,'series(Dj)') 5050 5092 find_netcpair_civ1(hObject, eventdata, handles);% update the menu of pairs depending on the available netcdf files 5051 5093 end 5052 if isequal(mode,'series(Dj)') | ...5053 (get(handles.CIV2,'Value')==0 & get(handles.CIV1,'Value')==0 & get(handles.FIX1,'Value')==0& get(handles.PATCH1,'Value')==0)5094 if isequal(mode,'series(Dj)') || ... 5095 (get(handles.CIV2,'Value')==0 && get(handles.CIV1,'Value')==0 && get(handles.FIX1,'Value')==0 && get(handles.PATCH1,'Value')==0) 5054 5096 find_netcpair_civ2(hObject, eventdata, handles); 5055 5097 end … … 5153 5195 menu_field{1}='civ1'; 5154 5196 Data=nc2struct(fileinput,[]); 5155 if isfield(Data,'patch') & isequal(Data.patch,1)5197 if isfield(Data,'patch') && isequal(Data.patch,1) 5156 5198 menu_field{2}='filter1'; 5157 5199 end 5158 if isfield(Data,'civ2') & isequal(Data.civ2,1)5200 if isfield(Data,'civ2') && isequal(Data.civ2,1) 5159 5201 menu_field{3}='civ2'; 5160 5202 end 5161 if isfield(Data,'patch2') & isequal(Data.patch2,1)5203 if isfield(Data,'patch2') && isequal(Data.patch2,1) 5162 5204 menu_field{4}='filter2'; 5163 5205 end … … 5181 5223 fileinput=[PathName FileName]; 5182 5224 sizf=size(fileinput); 5183 if (~ischar(fileinput)| ~isequal(sizf(1),1)),return;end %stop if fileinput not a character string5225 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string 5184 5226 [Path,File,field_count,str2,str_a,str_b,ref.ext,ref.nom_type,ref.subdir]=name2display(fileinput); 5185 5227 ref.filebase=fullfile(Path,File);
Note: See TracChangeset
for help on using the changeset viewer.