Changeset 301
- Timestamp:
- Nov 25, 2011, 11:24:06 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r300 r301 65 65 catch 66 66 errormsg={' Unable to read the file PARAM.xml defining the civx binaries:'; lasterr}; 67 return68 67 end 69 68 else 70 69 errormsg=[xmlfile ' not found: path to civx binaries undefined']; 71 return72 70 end 73 71 if ~isempty(errormsg) 74 msgbox_uvmat(' ERROR',errormsg);72 msgbox_uvmat('WARNING',errormsg); 75 73 end 76 74 test_batch=0;%default: ,no batch mode available … … 229 227 varargout{1} = handles.output; 230 228 231 % ------------------------------------------------------------------------232 % --- function activated by the Open/Browse... option in the upper menu bar.233 function MenuBrowse_Callback(hObject, eventdata, handles)234 % ------------------------------------------------------------------------235 % get the current input root file name to initiate the browser236 filebase=get(handles.RootName,'String');237 oldfile=''; %default238 if isempty(filebase)|| isequal(filebase,'')%loads the previously stored root file name239 dir_perso=prefdir;240 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');241 if exist(profil_perso,'file')242 h=load (profil_perso);243 if isfield(h,'filebase')&& ischar(h.filebase)244 oldfile=h.filebase;245 end246 if isfield(h,'RootPath') && ischar(h.RootPath)247 oldfile=h.RootPath;248 end249 end250 else251 oldfile=filebase;252 end253 ind_opening=1;%default254 browse.incr_pair=[0 0]; %default255 menu={'*.xml;*.civ;*.png;*.jpg;*.tif;*.avi;*.AVI;*.nc;', ' (*.xml,*.civ,*.png,*.jpg ,.tif, *.avi,*.nc)';256 '*.xml', '.xml files '; ...257 '*.civ', '.civ files '; ...258 '*.png','.png image files'; ...259 '*.jpg',' jpeg image files'; ...260 '*.tif','.tif image files'; ...261 '*.avi;*.AVI','.avi movie files'; ...262 '*.nc','.netcdf files'; ...263 '*.*', 'All Files (*.*)'};264 [FileName, PathName, filtindex] = uigetfile( menu, 'Pick a file',oldfile);265 fileinput=[PathName FileName];%complete file name266 sizf=size(fileinput);267 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string268 269 % % prepare the GUI with parameters from the input file if opened from uvmat270 errormsg=display_file_name(handles,fileinput);271 if ~isempty(errormsg)272 msgbox_uvmat('ERROR',erromsg)273 end229 % %------------------------------------------------------------------------ 230 % % --- function activated by the Open/Browse... option in the upper menu bar. 231 % function MenuBrowse_Callback(hObject, eventdata, handles) 232 % %------------------------------------------------------------------------ 233 % %get the current input root file name to initiate the browser 234 % filebase=get(handles.RootName,'String'); 235 % oldfile=''; %default 236 % if isempty(filebase)|| isequal(filebase,'')%loads the previously stored root file name 237 % dir_perso=prefdir; 238 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat'); 239 % if exist(profil_perso,'file') 240 % h=load (profil_perso); 241 % if isfield(h,'filebase')&& ischar(h.filebase) 242 % oldfile=h.filebase; 243 % end 244 % if isfield(h,'RootPath') && ischar(h.RootPath) 245 % oldfile=h.RootPath; 246 % end 247 % end 248 % else 249 % oldfile=filebase; 250 % end 251 % ind_opening=1;%default 252 % browse.incr_pair=[0 0]; %default 253 % menu={'*.xml;*.civ;*.png;*.jpg;*.tif;*.avi;*.AVI;*.nc;', ' (*.xml,*.civ,*.png,*.jpg ,.tif, *.avi,*.nc)'; 254 % '*.xml', '.xml files '; ... 255 % '*.civ', '.civ files '; ... 256 % '*.png','.png image files'; ... 257 % '*.jpg',' jpeg image files'; ... 258 % '*.tif','.tif image files'; ... 259 % '*.avi;*.AVI','.avi movie files'; ... 260 % '*.nc','.netcdf files'; ... 261 % '*.*', 'All Files (*.*)'}; 262 % [FileName, PathName, filtindex] = uigetfile( menu, 'Pick a file',oldfile); 263 % fileinput=[PathName FileName];%complete file name 264 % sizf=size(fileinput); 265 % if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string 266 % 267 % %% prepare the GUI with parameters from the input file if opened from uvmat 268 % errormsg=display_file_name(handles,fileinput); 269 % if ~isempty(errormsg) 270 % msgbox_uvmat('ERROR',erromsg) 271 % end 274 272 275 273 % … … 374 372 msgbox_uvmat('ERROR',erromsg) 375 373 end 376 % ------------------------------------------------------------------------377 function ImaDoc_Callback(hObject, eventdata, handles)378 % ------------------------------------------------------------------------379 RootName_Callback(hObject, eventdata, handles)374 % %------------------------------------------------------------------------ 375 % function ImaDoc_Callback(hObject, eventdata, handles) 376 % %------------------------------------------------------------------------ 377 % RootName_Callback(hObject, eventdata, handles) 380 378 381 379 %------------------------------------------------------------------------ … … 414 412 num_i2=str2double(i2_str); 415 413 num_j1=str2double(j1_str); 416 num_j2=str2double( i2_str);417 ref_i=num_i1;%efaulmt ref index418 ref_j=num_j1;414 num_j2=str2double(j2_str); 415 num_ref_i=num_i1;%efaulmt ref index 416 num_ref_j=num_j1; 419 417 browse.incr_pair=[0 0];%default 420 if ~isempty(imformats(ext_input(2:end)))||strcmp (lower(ext_input),'.avi')% if the extension corresponds to an image or movie format recognized by Matlab418 if ~isempty(imformats(ext_input(2:end)))||strcmpi(ext_input,'.avi')% if the extension corresponds to an image or movie format recognized by Matlab 421 419 ext_ima=ext_input; 422 420 nom_type_ima=nom_type_input; … … 424 422 nom_type_nc=nom_type_input; 425 423 if ~isempty(num_i2) 426 ref_i=floor((ref_i+num_i2)/2);% reference image number corresponding to the file424 num_ref_i=floor((num_ref_i+num_i2)/2);% reference image number corresponding to the file 427 425 browse.incr_pair(1)=num_i2-num_i1; 428 426 browse.incr_pair(2)=0; 429 427 end 430 428 %TODO: read the image name in the netcdf file (if documented) 431 dirima='';%default432 429 %look for double image series '_i_j' 433 430 dirima=dir([RootName '_' i1_str '_' j1_str '.*']); … … 544 541 %transform .Time to a column vector if it is a line vector thenomenclature uses a single index: correct possible bug in xml 545 542 if isequal(nbfield,1) && ~isequal(nbfield2,1)% .Time is a line vector 546 if numel(nom_type_read)>=2 && isempty(regexp(nom_type_read(2:end),'\D' ))543 if numel(nom_type_read)>=2 && isempty(regexp(nom_type_read(2:end),'\D','once')) 547 544 time=time'; 548 545 nbfield=nbfield2; … … 682 679 ValueCiv1=1; 683 680 end 684 set(handles.ListSubdirCiv1,'Value',ValueCiv1)685 681 set(handles.txt_SubdirCiv1,'String',listdir{ValueCiv1}) 686 682 ValueCiv2=get(handles.ListSubdirCiv2,'Value'); … … 688 684 ValueCiv2=1; 689 685 end 690 set(handles.ListSubdirCiv2,'Value',ValueCiv2)691 686 set(handles.txt_SubdirCiv2,'String',listdir{ValueCiv2}) 692 687 else 688 ValueCiv1=Value; 689 ValueCiv2=Value; 693 690 set(handles.txt_SubdirCiv1,'String',listdir{Value}) 694 691 set(handles.txt_SubdirCiv2,'String',listdir{Value}) 695 692 end 696 set(handles.ListSubdirCiv1,'Value',Value )697 set(handles.ListSubdirCiv2,'Value',Value )693 set(handles.ListSubdirCiv1,'Value',ValueCiv1) 694 set(handles.ListSubdirCiv2,'Value',ValueCiv2) 698 695 set(handles.ListSubdirCiv1,'String',[listdir;'new...']) 699 696 set(handles.ListSubdirCiv2,'String',[listdir;'new...']) … … 711 708 712 709 %% store the root input filename for future opening 713 dir_perso=prefdir;714 710 profil_perso=fullfile(prefdir,'uvmat_perso.mat'); 715 711 % RootPath=fileparts(RootName); … … 731 727 function ListPairMode_Callback(hObject, eventdata, handles) 732 728 %------------------------------------------------------------------------ 733 browse=get(handles.RootName,'UserData');729 % browse=get(handles.RootName,'UserData'); 734 730 compare_list=get(handles.ListCompareMode,'String'); 735 731 val=get(handles.ListCompareMode,'Value'); … … 753 749 nbfield2=siztime(2); 754 750 indchosen=1; %%first pair selected by default 751 %displ_num used to define the indices of the civ pairs 752 % displ_num(1,:)=indices j1 753 % displ_num(2,:)=indices j2 754 % displ_num(3,:)=indices i1 755 % displ_num(4,:)=indices i2 756 % in mode 'pair j1-j2', j1 and j2 are the file indices, else the indices 757 % are relative to the reference indices ref_i and ref_j respectively. 755 758 if isequal(mode,'pair j1-j2')%| isequal(mode,'st_pair j1-j2') 756 759 dt=1; … … 789 792 set(handles.ref_j,'Visible','Off') 790 793 elseif isequal(mode,'series(Dj)') %| isequal(mode,'st_series(Dj)') 791 for index=1:min(nbfield2-1,200) 792 displ_num(1,index)=-floor(index/2); 793 displ_num(2,index)=ceil(index/2); 794 displ_num(3,index)=0; 795 displ_num(4,index)=0; 796 end 794 index=1:200; 795 displ_num(1,index)=-floor(index/2); 796 displ_num(2,index)=ceil(index/2); 797 displ_num(3:4,index)=zeros(2,200); 798 % for index=1:min(nbfield2-1,200) 799 % displ_num(1,index)=-floor(index/2); 800 % displ_num(2,index)=ceil(index/2); 801 % displ_num(3,index)=0; 802 % displ_num(4,index)=0; 803 % end 797 804 set(handles.jtext,'Visible','On') 798 805 set(handles.first_j,'Visible','On') … … 817 824 end 818 825 elseif isequal(mode,'series(Di)') %| isequal(mode,'st_series(Di)') 819 for index=1:200%min(nbfield-1,200) 820 displ_num(1,index)=0; 821 displ_num(2,index)=0; 822 displ_num(3,index)=-floor(index/2); 823 displ_num(4,index)=ceil(index/2); 824 end 826 index=1:200; 827 displ_num(1:2,index)=zeros(2,200); 828 displ_num(3,index)=-floor(index/2); 829 displ_num(4,index)=ceil(index/2); 830 % for index=1:200%min(nbfield-1,200) 831 % displ_num(1,index)=0; 832 % displ_num(2,index)=0; 833 % displ_num(3,index)=-floor(index/2); 834 % displ_num(4,index)=ceil(index/2); 835 % end 825 836 set(handles.itext,'Visible','On') 826 837 set(handles.first_i,'Visible','On') … … 958 969 select=ones(size(1:nbpair))%flag for displayed pairs =1 for display 959 970 testpair=0; 960 % case with no checkciv1 operation, netcdf files need to exist for reading 971 972 %% case with no Civ1 operation, netcdf files need to exist for reading 961 973 if ~get(handles.CheckCiv1,'Value') % 962 974 if ~exist(fullfile(filepath,subdir_civ1,ext_dir),'dir') … … 992 1004 end 993 1005 end 994 if isequal(mode,'series(Di)') %| isequal(mode,'st_series(Di)') 1006 1007 %% determine the menu display in .ListPairCiv1 1008 % the menu depends on the mode defined in ListPairMode_callback through the array displ_num: 1009 % displ_num(1,:)=indices j1 1010 % displ_num(2,:)=indices j2 1011 % displ_num(3,:)=indices i1 1012 % displ_num(4,:)=indices i2 1013 % in mode 'pair j1-j2', j1 and j2 are the file indices, else the indices 1014 % are relative to the reference indices ref_i and ref_j respectively. 1015 if isequal(mode,'series(Di)') 995 1016 if testpair 996 1017 displ_pair{1}=['Di= ' num2str(-floor(browse.incr_pair(1)/2)) '|' num2str(ceil(browse.incr_pair(1)/2))]; … … 998 1019 for ipair=1:nbpair 999 1020 if select(ipair) 1021 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))]; 1000 1022 if size(time,1)>=ref_i+displ_num(4,ipair) && size(time,2)>=ref_j+displ_num(2,ipair) 1001 1023 dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt 1002 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ' :dt= ' num2str(dt*1000)]; 1003 else 1004 displ_pair{ipair}='...'; %pair not displayed in the menu 1024 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1005 1025 end 1006 end 1007 end 1008 end 1009 elseif isequal(mode,'series(Dj)')%|isequal(mode,'st_series(Dj)')% series on the j index 1026 else 1027 displ_pair{ipair}='...'; %pair not displayed in the menu 1028 end 1029 end 1030 end 1031 elseif isequal(mode,'series(Dj)') 1010 1032 if testpair 1011 1033 displ_pair{1}=['Dj= ' num2str(-floor(browse.incr_pair(1)/2)) '|' num2str(ceil(browse.incr_pair(1)/2))]; … … 1013 1035 for ipair=1:nbpair 1014 1036 if select(ipair) 1037 displ_pair{ipair}=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))]; 1015 1038 if size(time,1)>=ref_i+displ_num(4,ipair) && size(time,2)>=ref_j+displ_num(2,ipair) 1016 1039 dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt 1017 displ_pair{ipair}=[ 'Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))' :dt= ' num2str(dt*1000)];1040 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1018 1041 end 1019 elseif testpair1020 displ_pair{1}=['Dj= ' num2str(-floor(browse.incr_pair(2)/2)) '|' num2str(ceil(browse.incr_pair(2)/2))];1021 1042 else 1022 1043 displ_pair{ipair}='...'; %pair not displayed in the menu … … 1024 1045 end 1025 1046 end 1026 elseif isequal(mode,'pair j1-j2')% |isequal(mode,'st_pair j1-j2')%case of pairs1047 elseif isequal(mode,'pair j1-j2')%case of pairs 1027 1048 for ipair=1:nbpair 1028 1049 if select(ipair) … … 1046 1067 set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu 1047 1068 end 1048 % if numel(select)>=initial && ~isequal(select(initial),1)1049 % set(handles.ListPairCiv1,'Value',ichoice);% first valid pair proposed by default in the menu1050 % end1051 1052 %set(handles.ListPairCiv2,'String',displ_pair');1053 1069 initial=get(handles.ListPairCiv2,'Value'); 1054 1070 if initial>length(displ_pair')%|~isequal(select(initial),1) … … 1140 1156 nbpair=min(200,nbpair);%limit the number of displayed pairs to 200 1141 1157 1142 % look for existing processed pairs involving the field at the middle of the series if checkciv1 will not1158 %% look for existing processed pairs at the reference indices if Civ1 will not 1143 1159 % be performed, while the result is needed for next steps. 1144 1160 displ_pair={''}; %default … … 1176 1192 end 1177 1193 end 1178 if isequal(mode,'series(Di)') % | isequal(mode,'st_series(Di)')1194 if isequal(mode,'series(Di)') 1179 1195 for ipair=1:nbpair 1180 1196 if select(ipair) 1197 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]; 1181 1198 if size(time,1)>=ref_i+displ_num(4,ipair) && size(time,2)>=ref_j+displ_num(2,ipair) 1182 1199 dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt 1183 displ_pair{ipair}=[ 'Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))' :dt= ' num2str(dt*1000)];1200 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1184 1201 end 1185 1202 else … … 1190 1207 for ipair=1:nbpair 1191 1208 if select(ipair) 1209 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]; 1192 1210 if size(time,1)>=ref_i+displ_num(4,ipair) && size(time,2)>=ref_j+displ_num(2,ipair) 1193 1211 dt=time(ref_i+displ_num(4,ipair),ref_j+displ_num(2,ipair))-time(ref_i+displ_num(3,ipair),ref_j+displ_num(1,ipair));%time interval dt 1194 displ_pair{ipair}=[ 'Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))' :dt= ' num2str(dt*1000)];1212 displ_pair{ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)]; 1195 1213 end 1196 1214 else … … 1563 1581 Param.Civ1.filename_ima_a=filecell.ima1.civ1{ifile,j}; 1564 1582 Param.Civ1.filename_ima_b=filecell.ima2.civ1{ifile,j}; 1565 Param.Civ1.Dt=(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j))); 1566 Param.Civ1.T0=((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2); 1583 if size(time,1)>=num2_civ1(ifile) && size(time,1)>=num_b_civ1(ifile) 1584 Param.Civ1.Dt=(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j))); 1585 Param.Civ1.T0=((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2); 1586 else 1587 Param.Civ1.Dt=1; 1588 Param.Civ1.T0=0; 1589 end 1567 1590 Param.Civ1.term_a=num2stra(num_a_civ1(j),nom_type_nc);%UTILITE? 1568 1591 Param.Civ1.term_b=num2stra(num_b_civ1(j),nom_type_nc);% … … 1713 1736 if Param.CheckCiv2==1 1714 1737 Param.Civ2.filename_ima_a=filecell.ima1.civ2{ifile,j}; 1715 Param.Civ2.filename_ima_b=filecell.ima2.civ2{ifile,j}; 1716 Param.Civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j))); 1717 Param.Civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2); 1738 Param.Civ2.filename_ima_b=filecell.ima2.civ2{ifile,j}; 1739 if size(time,1)>=num2_civ1(ifile) && size(time,1)>=num_b_civ1(ifile) 1740 Param.Civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j))); 1741 Param.Civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2); 1742 else 1743 Param.Civ2.Dt=1; 1744 Param.Civ2.T0=0; 1745 end 1718 1746 Param.Civ2.term_a=num2stra(num_a_civ2(j),nom_type_nc); 1719 1747 Param.Civ2.term_b=num2stra(num_b_civ2(j),nom_type_nc); … … 3198 3226 %------------------------------------------------------------------------ 3199 3227 subdir=get(handles.txt_SubdirCiv1,'String'); 3200 set(handles.txt_SubdirCiv2,'String',subdir);% set civ2 directory the same as civ1 by default3201 3228 menu_str=get(handles.ListSubdirCiv1,'String');% read the list of subdirectories for update 3202 3229 ichoice=find(strcmp(subdir,menu_str),1); … … 3207 3234 end 3208 3235 set(handles.ListSubdirCiv1,'Value',ilist)% select the selected subdir in the menu 3209 if get(handles.CheckCiv1,'Value')==0 3210 find_netcpair_civ1(hObject, eventdata, handles); %update the list of available pairs from netcdf files in the new directory 3236 if get(handles.CheckCiv1,'Value')% if Civ1 is performed 3237 set(handles.txt_SubdirCiv2,'String',subdir);% set by default civ2 directory the same as civ1 3238 set(handles.ListSubdirCiv2,'Value',ilist) 3239 else % if Civ1 data already exist 3240 find_netcpair_civ1(handles); %update the list of available pairs from netcdf files in the new directory 3211 3241 end 3212 3242 … … 3226 3256 %update the list of available pairs from netcdf files in the new directory 3227 3257 if ~get(handles.CheckCiv2,'Value') && ~get(handles.CheckCiv1,'Value') && ~get(handles.CheckFix1,'Value') && ~get(handles.CheckPatch1,'Value') 3228 find_netcpair_civ2(h Object, eventdata, handles);3258 find_netcpair_civ2(handles); 3229 3259 end 3230 3260 … … 3502 3532 subdir=list_subdir_civ1{val}; 3503 3533 if strcmp(subdir,'new...') 3504 subdir='CIV'; %default subdirectory 3534 if get(handles.CheckCiv1,'Value') 3535 subdir='CIV'; %default subdirectory 3536 else 3537 msgbox_uvmat('ERROR','select CheckCiv1 to perform a new Civ operation') 3538 return 3539 end 3505 3540 end 3506 3541 set(handles.txt_SubdirCiv1,'String',subdir); 3507 find_netcpair_civ1(hObject, eventdata, handles) 3508 % end 3542 find_netcpair_civ1(handles) 3509 3543 3510 3544 %------------------------------------------------------------------------ … … 3516 3550 subdir=list_subdir_civ2{val}; 3517 3551 if strcmp(subdir,'new...') 3518 subdir='CIV'; %default subdirectory 3552 if get(handles.CheckCiv2,'Value') 3553 subdir='CIV'; %default subdirectory 3554 else 3555 msgbox_uvmat('ERROR','select CheckCiv2 to perform a new Civ operation') 3556 return 3557 end 3519 3558 end 3520 3559 set(handles.txt_SubdirCiv2,'String',subdir); 3521 % set(handles.ListSubdirCiv2,'Value',1);3522 3523 3560 3524 3561 %------------------------------------------------------------------------ … … 3871 3908 % %set(handles.get_gridpatch1,'Visible','off') 3872 3909 % %set(handles.grid_patch1,'Visible','off') 3873 3874 % ------------------------------------------------------------------------3875 function enable_civ2(handles,state)3876 % ------------------------------------------------------------------------3877 if state3878 RootName=get(handles.RootName,'String');3879 if isempty(RootName)3880 msgbox_uvmat('ERROR','No input file')3881 return3882 end3883 set(handles.Civ2,'Visible','on')3884 set(handles.ListSubdirCiv2,'Visible','on')3885 set(handles.SubdirCiv2,'Visible','on')3886 set(handles.TitleSubdirCiv2,'Visible','on')3887 else3888 set(handles.Civ2,'Visible','off')3889 end3910 % 3911 % %------------------------------------------------------------------------ 3912 % function enable_civ2(handles,state) 3913 % %------------------------------------------------------------------------ 3914 % if state 3915 % RootName=get(handles.RootName,'String'); 3916 % if isempty(RootName) 3917 % msgbox_uvmat('ERROR','No input file') 3918 % return 3919 % end 3920 % set(handles.Civ2,'Visible','on') 3921 % set(handles.ListSubdirCiv2,'Visible','on') 3922 % set(handles.SubdirCiv2,'Visible','on') 3923 % set(handles.TitleSubdirCiv2,'Visible','on') 3924 % else 3925 % set(handles.Civ2,'Visible','off') 3926 % end 3890 3927 3891 3928 % … … 4060 4097 % end 4061 4098 % set(handles.CheckStereo,'Visible','off') 4062 % ------------------------------------------------------------------------4063 function enable_pair1(handles,state)4064 % ------------------------------------------------------------------------4065 set(handles.txt_SubdirCiv1,'Visible',state)4066 set(handles.ListSubdirCiv1,'Visible',state)4067 set(handles.TitleSubdirCiv1,'Visible',state)4068 % set(handles.frame_subdirciv1,'Visible',state)4069 set(handles.ListPairCiv1,'Visible',state)4070 set(handles.TitlePairCiv1,'Visible',state)4071 % set(handles.dt_unit,'Visible',state)4072 % set(handles.PAIR_frame,'Visible',state)4099 % %------------------------------------------------------------------------ 4100 % function enable_pair1(handles,state) 4101 % %------------------------------------------------------------------------ 4102 % set(handles.txt_SubdirCiv1,'Visible',state) 4103 % set(handles.ListSubdirCiv1,'Visible',state) 4104 % set(handles.TitleSubdirCiv1,'Visible',state) 4105 % %set(handles.frame_subdirciv1,'Visible',state) 4106 % set(handles.ListPairCiv1,'Visible',state) 4107 % set(handles.TitlePairCiv1,'Visible',state) 4108 % %set(handles.dt_unit,'Visible',state) 4109 % %set(handles.PAIR_frame,'Visible',state) 4073 4110 4074 4111 %------------------------------------------------------------------------ … … 4194 4231 end 4195 4232 4196 function cmd_CIV1=CIV1_CMD(filename,param)4197 % TODO : include filename in par_civ14198 % ------------------------------------------------------------------------4199 % pixels per cm and matrix of the image times, read from the .civ file by uvmat4200 4201 % changes : filename_cmx -> filename ( no extension )4202 4203 filename=regexprep(filename,'.nc','');4204 4205 if isequal(Param.Civ1.Dt,'0')4206 Param.Civ1.Dt='1' ;%case of 'displacement' mode4207 end4208 Param.Civ1.filename_ima_a=regexprep(Param.Civ1.filename_ima_a,'.png','');4209 Param.Civ1.filename_ima_b=regexprep(Param.Civ1.filename_ima_b,'.png','');4210 fid=fopen([filename '.civ1.cmx'],'w');4211 fprintf(fid,['############## CMX file' '\n' ]);4212 fprintf(fid, ['FirstImage ' regexprep(Param.Civ1.filename_ima_a,'\\','\\\\') '\n' ]);% for windows compatibility4213 fprintf(fid, ['LastImage ' regexprep(Param.Civ1.filename_ima_b,'\\','\\\\') '\n' ]);% for windows compatibility4214 fprintf(fid, ['XX' '\n' ]);4215 fprintf(fid, ['Mask ' Param.Civ1.maskflag '\n' ]);4216 fprintf(fid, ['MaskName ' regexprep(Param.Civ1.maskname,'\\','\\\\') '\n' ]);4217 fprintf(fid, ['ImageSize ' Param.Civ1.npx ' ' Param.Civ1.npy '\n' ]); %VERIFIER CAS GENERAL ?4218 fprintf(fid, ['CorrelationBoxesSize ' Param.Civ1.ibx ' ' Param.Civ1.iby '\n' ]);4219 fprintf(fid, ['SearchBoxeSize ' Param.Civ1.isx ' ' Param.Civ1.isy '\n' ]);4220 fprintf(fid, ['RO ' Param.Civ1.rho '\n' ]);4221 fprintf(fid, ['GridSpacing ' Param.Civ1.dx ' ' Param.Civ1.dy '\n' ]);4222 fprintf(fid, ['XX 1.0' '\n' ]);4223 fprintf(fid, ['Dt_TO ' Param.Civ1.Dt ' ' Param.Civ1.T0 '\n' ]);4224 fprintf(fid, ['PixCmXY ' Param.Civ1.pxcmx ' ' Param.Civ1.pxcmy '\n' ]);4225 fprintf(fid, ['XX 1' '\n' ]);4226 fprintf(fid, ['ShiftXY ' Param.Civ1.shiftx ' ' Param.Civ1.shifty '\n' ]);4227 fprintf(fid, ['Grid ' Param.Civ1.gridflag '\n' ]);4228 fprintf(fid, ['GridName ' regexprep(Param.Civ1.gridname,'\\','\\\\') '\n' ]);4229 fprintf(fid, ['XX 85' '\n' ]);4230 fprintf(fid, ['XX 1.0' '\n' ]);4231 fprintf(fid, ['XX 1.0' '\n' ]);4232 fprintf(fid, ['Hart 1' '\n' ]);4233 fprintf(fid, [ 'DecimalShift 0' '\n' ]);4234 fprintf(fid, ['Deformation 0' '\n' ]);4235 fprintf(fid, ['CorrelationMin 0' '\n' ]);4236 fprintf(fid, ['IntensityMin 0' '\n' ]);4237 fprintf(fid, ['SeuilImage n' '\n' ]);4238 fprintf(fid, ['SeuilImageValues 0 4096' '\n' ]);4239 fprintf(fid, ['ImageToUse ' Param.Civ1.term_a ' ' Param.Civ1.term_b '\n' ]); % VERIFIER ?4240 fprintf(fid, ['ImageUsedBefore null null' '\n' ]);4241 fclose(fid);4242 4243 % cmd_CIV1=[sparam.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file4244 % cmd_CIV1=regexprep(cmd_CIV1,'\\','\\\\');4245 % namelog=regexprep(namelog,'\\','\\\\');4246 if(isunix)4247 cmd_CIV1=['cp -f ' filename '.civ1.cmx ' filename '.cmx'];4248 cmd_CIV1=[cmd_CIV1 '\n'...4249 Param.xml.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx4250 cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.log' ' ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.nc'];%rename .log as .civ1.log and set the netcdf result file for group user writting4251 % cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.checkciv1.cmx' '\n'];%rename .cmx as .checkciv1.cmx4252 else %Windows system4253 % flname=regexprep(flname,'\\','\\\\');4254 % cmd=[cmd 'copy /Y "' flname '.checkciv1.cmx" "' flname '.cmx"\n'];4255 % filename=regexprep(filename,'\\','\\\\');4256 cmd_CIV1=['copy /Y "' filename '.civ1.cmx" "' filename '.cmx"'];% copy the .civ1.cmx parameter file to .cmx4257 cmd_CIV1=[cmd_CIV1 '\n "' regexprep(Param.xml.Civ1Bin,'\\','\\\\') '" -f "' filename '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file4258 % namelog=regexprep(namelog,'\\','\\\\');4259 cmd_CIV1=[cmd_CIV1 '\n ' 'copy /Y "' filename '.log' '" "' filename '.civ1.log"']; %preserve the log file as .civ1.log4260 4261 % cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.checkciv1.cmx"'];4262 end4233 % function cmd_CIV1=CIV1_CMD(filename,param) 4234 % %TODO : include filename in par_civ1 4235 % %------------------------------------------------------------------------ 4236 % %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4237 % 4238 % %changes : filename_cmx -> filename ( no extension ) 4239 % 4240 % filename=regexprep(filename,'.nc',''); 4241 % 4242 % if isequal(Param.Civ1.Dt,'0') 4243 % Param.Civ1.Dt='1' ;%case of 'displacement' mode 4244 % end 4245 % Param.Civ1.filename_ima_a=regexprep(Param.Civ1.filename_ima_a,'.png',''); 4246 % Param.Civ1.filename_ima_b=regexprep(Param.Civ1.filename_ima_b,'.png',''); 4247 % fid=fopen([filename '.civ1.cmx'],'w'); 4248 % fprintf(fid,['############## CMX file' '\n' ]); 4249 % fprintf(fid, ['FirstImage ' regexprep(Param.Civ1.filename_ima_a,'\\','\\\\') '\n' ]);% for windows compatibility 4250 % fprintf(fid, ['LastImage ' regexprep(Param.Civ1.filename_ima_b,'\\','\\\\') '\n' ]);% for windows compatibility 4251 % fprintf(fid, ['XX' '\n' ]); 4252 % fprintf(fid, ['Mask ' Param.Civ1.maskflag '\n' ]); 4253 % fprintf(fid, ['MaskName ' regexprep(Param.Civ1.maskname,'\\','\\\\') '\n' ]); 4254 % fprintf(fid, ['ImageSize ' Param.Civ1.npx ' ' Param.Civ1.npy '\n' ]); %VERIFIER CAS GENERAL ? 4255 % fprintf(fid, ['CorrelationBoxesSize ' Param.Civ1.ibx ' ' Param.Civ1.iby '\n' ]); 4256 % fprintf(fid, ['SearchBoxeSize ' Param.Civ1.isx ' ' Param.Civ1.isy '\n' ]); 4257 % fprintf(fid, ['RO ' Param.Civ1.rho '\n' ]); 4258 % fprintf(fid, ['GridSpacing ' Param.Civ1.dx ' ' Param.Civ1.dy '\n' ]); 4259 % fprintf(fid, ['XX 1.0' '\n' ]); 4260 % fprintf(fid, ['Dt_TO ' Param.Civ1.Dt ' ' Param.Civ1.T0 '\n' ]); 4261 % fprintf(fid, ['PixCmXY ' Param.Civ1.pxcmx ' ' Param.Civ1.pxcmy '\n' ]); 4262 % fprintf(fid, ['XX 1' '\n' ]); 4263 % fprintf(fid, ['ShiftXY ' Param.Civ1.shiftx ' ' Param.Civ1.shifty '\n' ]); 4264 % fprintf(fid, ['Grid ' Param.Civ1.gridflag '\n' ]); 4265 % fprintf(fid, ['GridName ' regexprep(Param.Civ1.gridname,'\\','\\\\') '\n' ]); 4266 % fprintf(fid, ['XX 85' '\n' ]); 4267 % fprintf(fid, ['XX 1.0' '\n' ]); 4268 % fprintf(fid, ['XX 1.0' '\n' ]); 4269 % fprintf(fid, ['Hart 1' '\n' ]); 4270 % fprintf(fid, [ 'DecimalShift 0' '\n' ]); 4271 % fprintf(fid, ['Deformation 0' '\n' ]); 4272 % fprintf(fid, ['CorrelationMin 0' '\n' ]); 4273 % fprintf(fid, ['IntensityMin 0' '\n' ]); 4274 % fprintf(fid, ['SeuilImage n' '\n' ]); 4275 % fprintf(fid, ['SeuilImageValues 0 4096' '\n' ]); 4276 % fprintf(fid, ['ImageToUse ' Param.Civ1.term_a ' ' Param.Civ1.term_b '\n' ]); % VERIFIER ? 4277 % fprintf(fid, ['ImageUsedBefore null null' '\n' ]); 4278 % fclose(fid); 4279 % 4280 % % cmd_CIV1=[sparam.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file 4281 % % cmd_CIV1=regexprep(cmd_CIV1,'\\','\\\\'); 4282 % % namelog=regexprep(namelog,'\\','\\\\'); 4283 % if(isunix) 4284 % cmd_CIV1=['cp -f ' filename '.civ1.cmx ' filename '.cmx']; 4285 % cmd_CIV1=[cmd_CIV1 '\n'... 4286 % Param.xml.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx 4287 % cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.log' ' ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.nc'];%rename .log as .civ1.log and set the netcdf result file for group user writting 4288 % % cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.checkciv1.cmx' '\n'];%rename .cmx as .checkciv1.cmx 4289 % else %Windows system 4290 % % flname=regexprep(flname,'\\','\\\\'); 4291 % % cmd=[cmd 'copy /Y "' flname '.checkciv1.cmx" "' flname '.cmx"\n']; 4292 % % filename=regexprep(filename,'\\','\\\\'); 4293 % cmd_CIV1=['copy /Y "' filename '.civ1.cmx" "' filename '.cmx"'];% copy the .civ1.cmx parameter file to .cmx 4294 % cmd_CIV1=[cmd_CIV1 '\n "' regexprep(Param.xml.Civ1Bin,'\\','\\\\') '" -f "' filename '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file 4295 % % namelog=regexprep(namelog,'\\','\\\\'); 4296 % cmd_CIV1=[cmd_CIV1 '\n ' 'copy /Y "' filename '.log' '" "' filename '.civ1.log"']; %preserve the log file as .civ1.log 4297 % 4298 % % cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.checkciv1.cmx"']; 4299 % end 4263 4300 4264 4301 %------------------------------------------------------------------------ … … 4355 4392 civ2.convectFlow='n'; 4356 4393 4357 % ------------------------------------------------------------------------4358 % --- CheckCiv2 CheckCiv2 CheckCiv2 CheckCiv24359 function cmd_CIV2=CIV2_CMD(filename,param)4360 % ------------------------------------------------------------------------4361 % pixels per cm and matrix of the image times, read from the .civ file by uvmat4362 % global civ2Bin sge%name of the executable for checkciv1 calculation4363 filename=regexprep(filename,'.nc','');4364 if isequal(Param.Civ2.Dt,'0')4365 Param.Civ2.Dt='1' ;%case of 'displacement' mode4366 end4367 Param.Civ2.filename_ima_a=regexprep(Param.Civ2.filename_ima_a,'.png','');4368 Param.Civ2.filename_ima_b=regexprep(Param.Civ2.filename_ima_b,'.png','');% bug : .png appears two times ?4369 [fid,errormsg]=fopen([filename '.civ2.cmx'],'w');4370 if isequal(fid,-1)4371 msgbox_uvmat('ERROR',errormsg)4372 cmd_CIV2='';4373 return4374 end4375 fprintf(fid,['############## CMX file' '\n' ]);4376 fprintf(fid, ['FirstImage ' regexprep(Param.Civ2.filename_ima_a,'\\','\\\\') '\n' ]);% for windows compatibility4377 fprintf(fid, ['LastImage ' regexprep(Param.Civ2.filename_ima_b,'\\','\\\\') '\n' ]);% for windows compatibility4378 fprintf(fid, ['XX' '\n' ]);4379 fprintf(fid, ['Mask ' Param.Civ2.MaskFlag '\n' ]);4380 fprintf(fid, ['MaskName ' regexprep(Param.Civ2.MaskName,'\\','\\\\') '\n' ]);% for windows compatibility4381 fprintf(fid, ['ImageSize ' Param.Civ2.npx ' ' Param.Civ2.npy '\n' ]); %VERIFIER CAS GENERAL ?4382 fprintf(fid, ['CorrelationBoxesSize ' Param.Civ2.ibx ' ' Param.Civ2.iby '\n' ]);4383 fprintf(fid, ['SearchBoxeSize ' Param.Civ2.ibx ' ' Param.Civ2.iby '\n']);4384 fprintf(fid, ['RO ' Param.Civ2.rho '\n']);4385 fprintf(fid, ['GridSpacing ' Param.Civ2.dx ' ' Param.Civ2.dy '\n']);4386 fprintf(fid, ['XX 1.0' '\n' ]);4387 fprintf(fid, ['Dt_TO ' Param.Civ2.Dt ' ' Param.Civ2.T0 '\n' ]);4388 fprintf(fid, ['PixCmXY ' Param.Civ2.pxcmx ' ' Param.Civ2.pxcmy '\n' ]);4389 fprintf(fid, ['XX 1' '\n' ]);4390 fprintf(fid, 'ShiftXY 0 0\n');4391 fprintf(fid, ['Grid ' Param.Civ2.GridFlag '\n' ]);4392 fprintf(fid, ['GridName ' regexprep(Param.Civ2.GridName,'\\','\\\\') '\n']);4393 fprintf(fid, ['XX 85' '\n' ]);4394 fprintf(fid, ['XX 1.0' '\n' ]);4395 fprintf(fid, ['XX 1.0' '\n' ]);4396 fprintf(fid, ['Hart 1' '\n' ]);4397 fprintf(fid, ['DecimalShift ' Param.Civ2.decimal '\n']);4398 fprintf(fid, ['Deformation ' Param.Civ2.deformation '\n']);4399 fprintf(fid, ['CorrelationMin 0' '\n' ]);4400 fprintf(fid, ['IntensityMin 0' '\n' ]);4401 fprintf(fid, ['SeuilImage n' '\n' ]);4402 fprintf(fid, ['SeuilImageValues 0 4096' '\n' ]);4403 fprintf(fid, ['ImageToUse ' Param.Civ2.term_a ' ' Param.Civ2.term_b '\n' ]); % VERIFIER ?4404 fprintf(fid, ['ImageUsedBefore ' regexprep(Param.Civ2.filename_nc1,'\\','\\\\') '\n']);4405 fclose(fid);4406 4407 if(isunix)4408 cmd_CIV2=['cp -f ' filename '.civ2.cmx ' filename '.cmx\n'];4409 cmd_CIV2=[cmd_CIV2 Param.xml.Civ2Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx4410 cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.log' ' ' filename '.civ2.log' '\n' 'chmod g+w ' filename '.nc'];%preserve the log file as .civ2.log4411 % cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.cmx' ' ' filename '.checkciv2.cmx' '\n'];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx4412 4413 else4414 filename=regexprep(filename,'\\','\\\\');4415 cmd_CIV2=['copy /Y "' filename '.civ2.cmx" "' filename '.cmx"'];4416 cmd_CIV2=[cmd_CIV2 '\n "' regexprep(Param.xml.Civ2Bin,'\\','\\\\') '" -f "' filename '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file4417 cmd_CIV2=[cmd_CIV2 '\n ' 'copy /Y "' filename '.log' '" "' filename '.civ2.log"'];4418 % cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.checkciv2.cmx"'];4419 end4394 % %------------------------------------------------------------------------ 4395 % % --- CheckCiv2 CheckCiv2 CheckCiv2 CheckCiv2 4396 % function cmd_CIV2=CIV2_CMD(filename,param) 4397 % %------------------------------------------------------------------------ 4398 % %pixels per cm and matrix of the image times, read from the .civ file by uvmat 4399 % % global civ2Bin sge%name of the executable for checkciv1 calculation 4400 % filename=regexprep(filename,'.nc',''); 4401 % if isequal(Param.Civ2.Dt,'0') 4402 % Param.Civ2.Dt='1' ;%case of 'displacement' mode 4403 % end 4404 % Param.Civ2.filename_ima_a=regexprep(Param.Civ2.filename_ima_a,'.png',''); 4405 % Param.Civ2.filename_ima_b=regexprep(Param.Civ2.filename_ima_b,'.png','');% bug : .png appears two times ? 4406 % [fid,errormsg]=fopen([filename '.civ2.cmx'],'w'); 4407 % if isequal(fid,-1) 4408 % msgbox_uvmat('ERROR',errormsg) 4409 % cmd_CIV2=''; 4410 % return 4411 % end 4412 % fprintf(fid,['############## CMX file' '\n' ]); 4413 % fprintf(fid, ['FirstImage ' regexprep(Param.Civ2.filename_ima_a,'\\','\\\\') '\n' ]);% for windows compatibility 4414 % fprintf(fid, ['LastImage ' regexprep(Param.Civ2.filename_ima_b,'\\','\\\\') '\n' ]);% for windows compatibility 4415 % fprintf(fid, ['XX' '\n' ]); 4416 % fprintf(fid, ['Mask ' Param.Civ2.MaskFlag '\n' ]); 4417 % fprintf(fid, ['MaskName ' regexprep(Param.Civ2.MaskName,'\\','\\\\') '\n' ]);% for windows compatibility 4418 % fprintf(fid, ['ImageSize ' Param.Civ2.npx ' ' Param.Civ2.npy '\n' ]); %VERIFIER CAS GENERAL ? 4419 % fprintf(fid, ['CorrelationBoxesSize ' Param.Civ2.ibx ' ' Param.Civ2.iby '\n' ]); 4420 % fprintf(fid, ['SearchBoxeSize ' Param.Civ2.ibx ' ' Param.Civ2.iby '\n']); 4421 % fprintf(fid, ['RO ' Param.Civ2.rho '\n']); 4422 % fprintf(fid, ['GridSpacing ' Param.Civ2.dx ' ' Param.Civ2.dy '\n']); 4423 % fprintf(fid, ['XX 1.0' '\n' ]); 4424 % fprintf(fid, ['Dt_TO ' Param.Civ2.Dt ' ' Param.Civ2.T0 '\n' ]); 4425 % fprintf(fid, ['PixCmXY ' Param.Civ2.pxcmx ' ' Param.Civ2.pxcmy '\n' ]); 4426 % fprintf(fid, ['XX 1' '\n' ]); 4427 % fprintf(fid, 'ShiftXY 0 0\n'); 4428 % fprintf(fid, ['Grid ' Param.Civ2.GridFlag '\n' ]); 4429 % fprintf(fid, ['GridName ' regexprep(Param.Civ2.GridName,'\\','\\\\') '\n']); 4430 % fprintf(fid, ['XX 85' '\n' ]); 4431 % fprintf(fid, ['XX 1.0' '\n' ]); 4432 % fprintf(fid, ['XX 1.0' '\n' ]); 4433 % fprintf(fid, ['Hart 1' '\n' ]); 4434 % fprintf(fid, ['DecimalShift ' Param.Civ2.decimal '\n']); 4435 % fprintf(fid, ['Deformation ' Param.Civ2.deformation '\n']); 4436 % fprintf(fid, ['CorrelationMin 0' '\n' ]); 4437 % fprintf(fid, ['IntensityMin 0' '\n' ]); 4438 % fprintf(fid, ['SeuilImage n' '\n' ]); 4439 % fprintf(fid, ['SeuilImageValues 0 4096' '\n' ]); 4440 % fprintf(fid, ['ImageToUse ' Param.Civ2.term_a ' ' Param.Civ2.term_b '\n' ]); % VERIFIER ? 4441 % fprintf(fid, ['ImageUsedBefore ' regexprep(Param.Civ2.filename_nc1,'\\','\\\\') '\n']); 4442 % fclose(fid); 4443 % 4444 % if(isunix) 4445 % cmd_CIV2=['cp -f ' filename '.civ2.cmx ' filename '.cmx\n']; 4446 % cmd_CIV2=[cmd_CIV2 Param.xml.Civ2Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx 4447 % cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.log' ' ' filename '.civ2.log' '\n' 'chmod g+w ' filename '.nc'];%preserve the log file as .civ2.log 4448 % % cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.cmx' ' ' filename '.checkciv2.cmx' '\n'];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx 4449 % 4450 % else 4451 % filename=regexprep(filename,'\\','\\\\'); 4452 % cmd_CIV2=['copy /Y "' filename '.civ2.cmx" "' filename '.cmx"']; 4453 % cmd_CIV2=[cmd_CIV2 '\n "' regexprep(Param.xml.Civ2Bin,'\\','\\\\') '" -f "' filename '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file 4454 % cmd_CIV2=[cmd_CIV2 '\n ' 'copy /Y "' filename '.log' '" "' filename '.civ2.log"']; 4455 % % cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.checkciv2.cmx"']; 4456 % end 4420 4457 4421 4458 … … 4448 4485 mode_value=get(handles.ListPairMode,'Value'); 4449 4486 mode=mode_list{mode_value}; 4450 find_netcpair_civ1(h Object, eventdata, handles);% update the menu of pairs depending on the available netcdf files4487 find_netcpair_civ1(handles);% update the menu of pairs depending on the available netcdf files 4451 4488 if isequal(mode,'series(Di)') || ...% we do patch2 only 4452 4489 (get(handles.CheckCiv2,'Value')==0 && get(handles.CheckCiv1,'Value')==0 && get(handles.CheckFix1,'Value')==0 && get(handles.CheckPatch1,'Value')==0) 4453 find_netcpair_civ2( hObject, eventdata,handles);4490 find_netcpair_civ2( handles); 4454 4491 end 4455 4492 … … 4461 4498 mode=mode_list{mode_value}; 4462 4499 if isequal(get(handles.CheckCiv1,'Value'),0)|| isequal(mode,'series(Dj)') 4463 find_netcpair_civ1(h Object, eventdata, handles);% update the menu of pairs depending on the available netcdf files4500 find_netcpair_civ1(handles);% update the menu of pairs depending on the available netcdf files 4464 4501 end 4465 4502 if isequal(mode,'series(Dj)') || ... 4466 4503 (get(handles.CheckCiv2,'Value')==0 && get(handles.CheckCiv1,'Value')==0 && get(handles.CheckFix1,'Value')==0 && get(handles.CheckPatch1,'Value')==0) 4467 find_netcpair_civ2(h Object, eventdata, handles);4468 end 4469 4470 % ------------------------------------------------------------------------4471 function ref_i_civ2_Callback(hObject, eventdata, handles)4472 % ------------------------------------------------------------------------4473 mode_list=get(handles.ListPairMode,'String');4474 mode_value=get(handles.ListPairMode,'Value');4475 mode=mode_list{mode_value};4476 find_netcpair_civ2(hObject, eventdata,handles);% update the menu of pairs depending on the available netcdf files4477 4478 % ------------------------------------------------------------------------4479 function ref_j_civ2_Callback(hObject, eventdata, handles)4480 % ------------------------------------------------------------------------4481 mode_list=get(handles.ListPairMode,'String');4482 mode_value=get(handles.ListPairMode,'Value');4483 mode=mode_list{mode_value};4484 if isequal(mode,'series(Dj)')4485 find_netcpair_civ2(hObject, eventdata,handles);% update the menu of pairs depending on the available netcdf files4486 end4504 find_netcpair_civ2(handles); 4505 end 4506 % 4507 % %------------------------------------------------------------------------ 4508 % function ref_i_civ2_Callback(hObject, eventdata, handles) 4509 % %------------------------------------------------------------------------ 4510 % % mode_list=get(handles.ListPairMode,'String'); 4511 % % mode_value=get(handles.ListPairMode,'Value'); 4512 % % mode=mode_list{mode_value}; 4513 % find_netcpair_civ2(handles);% update the menu of pairs depending on the available netcdf files 4514 % 4515 % %------------------------------------------------------------------------ 4516 % function ref_j_civ2_Callback(hObject, eventdata, handles) 4517 % %------------------------------------------------------------------------ 4518 % % mode_list=get(handles.ListPairMode,'String'); 4519 % % mode_value=get(handles.ListPairMode,'Value'); 4520 % % mode=mode_list{mode_value}; 4521 % if isequal(mode,'series(Dj)') 4522 % find_netcpair_civ2(handles);% update the menu of pairs depending on the available netcdf files 4523 % end 4487 4524 4488 4525 %------------------------------------------------------------------------ … … 4658 4695 menu_field{1}='civ1'; 4659 4696 Data=nc2struct(fileinput,[]); 4660 if isfield(Data,'patch') & isequal(Data.patch,1)4697 if isfield(Data,'patch') && isequal(Data.patch,1) 4661 4698 menu_field{2}='filter1'; 4662 4699 end 4663 if isfield(Data,'civ2') & isequal(Data.civ2,1)4700 if isfield(Data,'civ2') && isequal(Data.civ2,1) 4664 4701 menu_field{3}='civ2'; 4665 4702 end 4666 if isfield(Data,'patch2') & isequal(Data.patch2,1)4703 if isfield(Data,'patch2') && isequal(Data.patch2,1) 4667 4704 menu_field{4}='filter2'; 4668 4705 end
Note: See TracChangeset
for help on using the changeset viewer.