Changeset 225
- Timestamp:
- Mar 20, 2011, 3:27:44 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r224 r225 1565 1565 1566 1566 % start status callback to visualise results 1567 if isfield(handles,'status') 1568 set(handles.status,'Value',1);%suppress status display1569 status_Callback(hObject, eventdata, handles)1567 if isfield(handles,'status') && ~isequal(get(handles.CivAll,'Value'),3) 1568 set(handles.status,'Value',1);%suppress status display 1569 status_Callback(hObject, eventdata, handles) 1570 1570 end 1571 1571 … … 1654 1654 nbslice=numel(num_a_civ1); 1655 1655 1656 %% choice of batch priority 1657 ind_answer=2; 1656 1657 %% read names of the .exe files for PIV and patch 1658 path_UVMAT=fileparts(which('uvmat')); %path to the source directory of uvmat 1659 xmlfile='PARAM.xml'; 1660 if exist(xmlfile,'file')% search parameter xml file in the whole matlab path 1661 t=xmltree(xmlfile); 1662 s=convert(t); 1663 end 1664 test_interp=0; 1658 1665 if batch 1666 if isfield(s,'BatchParam') 1667 sparam=s.BatchParam; 1668 if ~ismember(sparam.BatchMode,{'sge'}) 1669 msgbox_uvmat('ERROR',['batch mode ' sparam.BatchMode ' not supported by UVMAT']) 1670 end 1671 else 1672 msgbox_uvmat('ERROR','no batch civ binaries defined in PARAM.xml') 1673 return 1674 end 1675 if isfield(sparam,'BatchMode') 1676 batch_mode=sparam.BatchMode; 1677 end 1678 % choice of batch priority: 1679 ind_answer=2; 1659 1680 [s,w]=unix('qstat -q civ.q|grep job_| wc -l'); %check the waiting list (command unix) 1660 1681 if isequal(s,0) … … 1669 1690 end 1670 1691 else 1671 msgbox_uvmat('ERROR','batch system not available') 1672 return 1673 end 1674 % else 1675 % if isunix 1676 % [xx,w]=unix('ps faux |grep civ|wc -l'); 1677 % w(end)=[]; 1678 % if str2double(w)+numel(num1_civ1)> 50 1679 % msgbox_uvmat('ERROR',{['There are already ' w ' civ processes running locally'];'Use BATCH or submit RUN later'}) 1680 % return 1681 % end 1682 % end 1683 end 1684 1685 1686 %% read names of the .exe files for PIV and patch 1687 path_UVMAT=fileparts(which('uvmat')); %path to the source directory of uvmat 1688 xmlfile='PARAM.xml'; 1689 if exist(xmlfile,'file')% search parameter xml file in the whole matlab path 1690 t=xmltree(xmlfile); 1691 s=convert(t); 1692 end 1693 test_interp=0; 1694 if batch 1695 if isfield(s,'BatchParam') 1696 sparam=s.BatchParam; 1697 if ~ismember(sparam.BatchMode,{'sge'}) 1698 msgbox_uvmat('ERROR',['batch mode ' sparam.BatchMode ' not supported by UVMAT']) 1699 end 1700 else 1701 msgbox_uvmat('ERROR','no batch mode defined in PARAM.xml') 1692 msgbox_uvmat('ERROR','sge batch system not available') 1702 1693 return 1703 1694 end … … 1706 1697 sparam=s.RunParam; 1707 1698 else 1708 msgbox_uvmat('ERROR','no civ binaries defined in PARAM.xml')1699 msgbox_uvmat('ERROR','no run civ binaries defined in PARAM.xml') 1709 1700 return 1710 1701 end 1711 if isfield(sparam,'CivBin') 1712 if ~exist(sparam.CivBin,'file')||~isequal(which(sparam.CivBin),sparam.CivBin)% if path defined as relative to uvmat 1713 CivBin=sparam.CivBin; 1714 sparam.CivBin=fullfile(path_UVMAT,sparam.CivBin); 1715 if ~exist(sparam.CivBin,'file') 1716 msgbox_uvmat('ERROR',['CIVx binary ' CivBin ' defined in PARAM.xm does not exist']) 1717 return 1718 end 1719 end 1720 end 1721 if isfield(sparam,'Civ1Bin') 1722 if ~exist(sparam.Civ1Bin,'file')||~isequal(which(sparam.Civ1Bin),sparam.Civ1Bin)% if path defined as relative to uvmat 1723 % CivBin=sparam.Civ1Bin; 1724 sparam.Civ1Bin=fullfile(path_UVMAT,sparam.Civ1Bin); 1725 if ~exist(sparam.Civ1Bin,'file') 1726 msgbox_uvmat('ERROR',['civ1 binary ' sparam.Civ1Bin ' defined in PARAM.xm does not exist']) 1727 return 1728 end 1729 end 1730 end 1731 if isfield(sparam,'Civ2Bin') 1732 % CivBin=sparam.Civ2Bin; 1733 if ~exist(sparam.Civ2Bin,'file')||~isequal(which(sparam.Civ2Bin),sparam.Civ2Bin)% if path defined as relative to uvmat 1734 sparam.Civ2Bin=fullfile(path_UVMAT,sparam.Civ2Bin); 1735 if ~exist(sparam.Civ2Bin,'file') 1736 msgbox_uvmat('ERROR',['civ2 binary ' sparam.Civ2Bin ' defined in PARAM.xm does not exist']) 1737 return 1738 end 1739 end 1740 end 1741 if isfield(sparam,'PatchBin') 1742 if ~exist(sparam.PatchBin,'file')||~isequal(which(sparam.PatchBin),sparam.PatchBin)% if path defined as relative to uvmat 1743 sparam.PatchBin=fullfile(path_UVMAT,sparam.PatchBin); 1744 end 1745 end 1746 if isfield(sparam,'FixBin') 1747 if ~exist(sparam.FixBin,'file')||~isequal(which(sparam.FixBin),sparam.FixBin)% if path defined as relative to uvmat 1748 sparam.FixBin=fullfile(path_UVMAT,sparam.FixBin); 1749 end 1750 end 1751 end 1752 if batch 1753 if isfield(sparam,'BatchMode') 1754 batch_mode=sparam.BatchMode; 1755 end 1756 end 1702 end 1703 civAll=isequal(get(handles.CivAll,'Value'),2); % Boolean for new civ programs 1704 if civAll && isfield(sparam,'CivBin') 1705 CivBin=sparam.CivBin; 1706 if ~exist(CivBin,'file') || ~isempty(which(CivBin))% if path defined as relative to uvmat 1707 sparam.CivBin=fullfile(path_UVMAT,CivBin); 1708 if ~exist(sparam.CivBin,'file') 1709 msgbox_uvmat('ERROR',['CIVx binary ' CivBin ' defined in PARAM.xm does not exist']) 1710 return 1711 end 1712 end 1713 end 1714 if isfield(sparam,'Civ1Bin') 1715 Civ1Bin=sparam.Civ1Bin; 1716 which(Civ1Bin) 1717 if ~exist(Civ1Bin,'file')||~isempty(which(Civ1Bin))% if path defined as relative to uvmat 1718 sparam.Civ1Bin=fullfile(path_UVMAT,Civ1Bin); 1719 if ~exist(sparam.Civ1Bin,'file') 1720 msgbox_uvmat('ERROR',['civ1 binary ' Civ1Bin ' defined in PARAM.xm does not exist']) 1721 return 1722 end 1723 end 1724 end 1725 if isfield(sparam,'Civ2Bin') 1726 Civ2Bin=sparam.Civ2Bin; 1727 if ~exist(Civ2Bin,'file')||~isempty(which(Civ2Bin))% if path defined as relative to uvmat 1728 sparam.Civ2Bin=fullfile(path_UVMAT,Civ2Bin); 1729 if ~exist(sparam.Civ2Bin,'file') 1730 msgbox_uvmat('ERROR',['civ2 binary ' Civ2Bin ' defined in PARAM.xm does not exist']) 1731 return 1732 end 1733 end 1734 end 1735 if isfield(sparam,'PatchBin') 1736 if ~exist(sparam.PatchBin,'file')||~isempty(which(sparam.PatchBin))% if path defined as relative to uvmat 1737 sparam.PatchBin=fullfile(path_UVMAT,sparam.PatchBin); 1738 end 1739 end 1740 if isfield(sparam,'FixBin') 1741 if ~exist(sparam.FixBin,'file')||~isempty(which(sparam.FixBin))% if path defined as relative to uvmat 1742 sparam.FixBin=fullfile(path_UVMAT,sparam.FixBin); 1743 end 1744 end 1745 1757 1746 1758 1747 … … 1857 1846 %% MAIN LOOP 1858 1847 time=get(handles.RootName,'UserData'); %get the set of times 1859 civAll=get(handles.CivAll,'Value'); % Boolean for new civ excution method1860 1848 super_cmd=[]; 1861 1849 … … 2232 2220 if isequal(civAll,1) 2233 2221 save(civAllxml,[flname '.xml']); 2234 'TEST' 2235 cmd=[cmd sparam.CivBin ' -f ' flname '.xml ' civAllCmd ' >' flname '.log' '\n'] 2236 'fincmd' 2222 cmd=[cmd sparam.CivBin ' -f ' flname '.xml ' civAllCmd ' >' flname '.log' '\n']; 2237 2223 end 2238 2224 % create the .bat file: … … 2251 2237 eval( ['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]); 2252 2238 end 2253 else 2239 elseif ~isequal(get(handles.CivAll,'Value'),3) 2254 2240 %% to lauch the jobs locally : 2255 2241 if(isunix) … … 2260 2246 super_cmd=[super_cmd cmd_str '\n']; 2261 2247 disp(cmd_str); 2262 end 2263 end 2264 end 2265 2266 if ~batch 2248 else %run PIVlab if selected 2249 image1=imread(par_civ1.filename_ima_a); 2250 image2=imread(par_civ1.filename_ima_b); 2251 [xtable ytable utable vtable ctable typevector] = pivlab (image1,image2,str2num(par_civ1.ibx), str2num(par_civ1.dx), 1, [], []); 2252 Data.ListGlobalAttribute={'title','Time','Dt'}; 2253 Data.title='PIVlab'; 2254 Data.Time=str2double(par_civ1.T0); 2255 Data.Dt=str2double(par_civ1.Dt); 2256 Data.ListVarName={'X','Y','U','V','C','FF'};% cell array containing the names of the fields to record 2257 Data.VarDimName={'nbvec','nbvec','nbvec','nbvec','nbvec','nbvec'}; 2258 Data.VarAttribute{1}.Role='coord_x'; 2259 Data.VarAttribute{2}.Role='coord_y'; 2260 Data.VarAttribute{3}.Role='vector_x'; 2261 Data.VarAttribute{4}.Role='vector_y'; 2262 Data.VarAttribute{5}.Role='errorflag'; 2263 Data.X=reshape(xtable,[],1); 2264 Data.Y=reshape(ytable,[],1); 2265 Data.U=reshape(utable,[],1); 2266 Data.V=reshape(vtable,[],1); 2267 Data.C=reshape(ctable,[],1); 2268 Data.FF=reshape(~typevector,[],1); 2269 errormsg=struct2nc(filecell.nc.civ1{ifile,j},Data); 2270 if isempty(errormsg) 2271 display([filecell.nc.civ1{ifile,j} ' written']) 2272 else 2273 msgbox_uvmat('ERROR',errormsg) 2274 end 2275 end 2276 end 2277 end 2278 2279 if ~batch && ~isequal(get(handles.CivAll,'Value'),3) 2267 2280 [Rootbat,Filebat,extbat]=fileparts(filename_bat); 2268 2281 filename_superbat=fullfile(Rootbat,['job_list.bat']); … … 2274 2287 end 2275 2288 system([filename_superbat ' &'])% execute main commmand 2276 % else2277 % eval(['!' filename_superbat ' &']);2278 % end2279 2289 end 2280 2290 … … 3730 3740 set(handles.rho_patch1,'Visible','on') 3731 3741 set(handles.rho_text1,'Visible','on') 3732 if get(handles.CivAll,'Value') 3742 if get(handles.CivAll,'Value')==2 3733 3743 set(handles.thresh_patch1,'Visible','on') 3734 3744 set(handles.thresh_text1,'Visible','on') … … 4581 4591 4582 4592 %------------------------------------------------------------------------ 4583 % --- Executes on button press in TestCiv1 .4593 % --- Executes on button press in TestCiv1: display image correlation function 4584 4594 function TestCiv1_Callback(hObject, eventdata, handles) 4585 4595 %------------------------------------------------------------------------ … … 4773 4783 % --- Executes on button press in CivAll. 4774 4784 function CivAll_Callback(hObject, eventdata, handles) 4775 if get(handles.CivAll,'Value') 4785 if get(handles.CivAll,'Value')==2 4776 4786 if get(handles.PATCH1,'Value') 4777 4787 set(handles.thresh_patch1,'Visible','on') -
trunk/src/mouse_motion.m
r224 r225 241 241 Asub=reshape(Asub,[],1);%first sub-image reshaped as matlab vector 242 242 rangx(1)=-(isx2-ibx2)+shiftx; 243 rangx(2)=isx2-ibx2+shiftx 243 rangx(2)=isx2-ibx2+shiftx; 244 244 rangy(1)=-(isy2-iby2)-shifty; 245 245 rangy(2)=(isy2-iby2)-shifty -
trunk/src/test_netcdf.m
r142 r225 29 29 Data.VarAttribute{6}.longname='interpolated ordinate'; 30 30 Data.VarAttribute{7}.longname='stream function'; 31 Data.VarAttribute{1}.Role='coord_x'; 32 Data.VarAttribute{2}.Role='coord_y'; 33 Data.VarAttribute{3}.Role='vector_x'; 34 Data.VarAttribute{4}.Role='vector_y'; 31 35 32 36 nbvec=200;
Note: See TracChangeset
for help on using the changeset viewer.