- Timestamp:
- Jun 16, 2015, 8:15:10 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r908 r912 1010 1010 end 1011 1011 1012 %% interpolation range 1013 thresh2=[]; 1014 if isfield(ObjectData,'RangeInterp') 1015 thresh2=ObjectData.RangeInterp*ObjectData.RangeInterp;%square of interpolation range (do not interpolate beyond this range) 1016 end 1017 1012 1018 %% initiate Matlab structure for physical field 1013 1019 [ProjData,errormsg]=proj_heading(FieldData,ObjectData); … … 1303 1309 Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point 1304 1310 Dist=Distx.*Distx+Disty.*Disty; 1305 for ivar=1:numel(VarVal) 1306 VarVal{ivar}(Dist>16*ProjData.CoordMesh)=NaN;% % put to NaN interpolated positions further than 4 meshes from initial data 1307 end 1308 1311 if ~isempty(thresh2) 1312 for ivar=1:numel(VarVal) 1313 VarVal{ivar}(Dist>thresh2)=NaN;% % put to NaN interpolated positions further than 4 meshes from initial data 1314 end 1315 end 1309 1316 if isfield(CellInfo{icell},'CheckSub') && CellInfo{icell}.CheckSub && ~isempty(vector_x_proj) 1310 1317 ProjData.(FieldData.ListVarName{vector_x_proj})=ProjData.(FieldData.ListVarName{vector_x_proj})-VarVal{1}; … … 1358 1365 for ilist=1:numel(ListVarName)% reshape data, excluding coordinates (ilist=1-2), TODO: rationalise 1359 1366 VarName=ListVarName{ilist}; 1367 VarDimName{ilist}={'coord_y','coord_x'}; 1360 1368 ProjData.(VarName)=DataOut.(VarName); 1361 ProjData.(VarName)(Dist>16*ProjData.CoordMesh)=NaN;% put to NaN interpolated positions further than 4 meshes from initial data 1362 VarDimName{ilist}={'coord_y','coord_x'}; 1369 if ~isempty(thresh2) 1370 ProjData.(VarName)(Dist>thresh2)=NaN;% put to NaN interpolated positions further than RangeInterp from initial data 1371 end 1363 1372 end 1364 1373 end -
trunk/src/series.m
r911 r912 1929 1929 end 1930 1930 end 1931 filename_joblist=fullfile(DirOAR,' 0_job_list.txt');%create name of the global executable file1931 filename_joblist=fullfile(DirOAR,'job_list.txt');%create name of the global executable file 1932 1932 filename_log=fullfile(DirLog,'job_list.stdout');%file for output messages of the master oar process 1933 1933 filename_errors=fullfile(DirLog,'job_list.stderr');%file for error messages of the master oar process … … 1947 1947 % shorter than the wall time: in the time interval 'checkpoint' (WallTimeOneJob) before the end of the allowed duration, 1948 1948 % the oar job restarts when an individual job ends. 1949 JobTime=CPUTime*BlockLength*nbfield_j % estimated time for one individual job (in minutes)1949 JobTime=CPUTime*BlockLength*nbfield_j;% estimated time for one individual job (in minutes) 1950 1950 % wall time (in hours ) for each oar job, allowing 10 individual jobs, but limited to 23 h: 1951 1951 WallTimeTotal=min(23,4*JobTime/60); 1952 disp(['WallTimeTotal: ' num2str(WallTimeTotal) ' hours'])1952 %disp(['WallTimeTotal: ' num2str(WallTimeTotal) ' hours']) 1953 1953 % estimated time of an individual job (in min), with a margin of error 1954 1954 WallTimeOneJob=min(4*JobTime+10,WallTimeTotal*60/2);% estimated max time of an individual job for checkpoint … … 3396 3396 elseif isequal(Civ,4) || isequal(Civ,5) 3397 3397 imax=3; 3398 else if isequal(Civ,6) %patch23398 else%if isequal(Civ,6) %patch2 3399 3399 imax=4; 3400 3400 end -
trunk/src/series/check_data_files.m
r908 r912 154 154 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 155 155 if isfield(FileInfo,'CivStage') 156 liststage={'civ1','fix1','patch1','civ2','fix2','patch2'}; 157 lastfield=liststage{FileInfo.CivStage}; 156 liststage={'civ','fix','patch'}; 157 stagechoice=1+mod(FileInfo.CivStage-1,3); 158 iter=1+floor((FileInfo.CivStage-1)/3); 159 lastfield=[liststage{stagechoice} num2str(iter)]; 160 %liststage={'civ1','fix1','patch1','civ2','fix2','patch2'}; 161 %lastfield=liststage{FileInfo.CivStage}; 158 162 end 159 163 end -
trunk/src/series/civ_series.m
r911 r912 356 356 end 357 357 end 358 if ~CheckOverwrite && exist(ncfile,'file') 359 continue% skip iteration if the mode overwrite is desactivated and the result file already exists 358 ncfile_out=ncfile;% by default 359 if isfield (Param.ActionInput,'Civ2') 360 i1_civ2=i1_series_Civ2(ifield); 361 i2_civ2=i1_civ2; 362 if ~isempty(i2_series_Civ2) 363 i2_civ2=i2_series_Civ2(ifield); 364 end 365 j1_civ2=1; 366 if ~isempty(j1_series_Civ2) 367 j1_civ2=j1_series_Civ2(ifield); 368 end 369 j2_civ2=i1_civ2; 370 if ~isempty(j2_series_Civ2) 371 j2_civ2=j2_series_Civ2(ifield); 372 end 373 if strcmp(Param.ActionInput.ListCompareMode,'PIV') 374 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1_civ2,i2_civ2,j1_civ2,j2_civ2); 375 else % displacement 376 ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2_civ2,[],j2_civ2); 377 end 378 end 379 if ~CheckOverwrite && exist(ncfile_out,'file') 380 disp(['existing output file ' ncfile_out ' already exists, skip to next field']) 381 continue% skip iteration if the mode overwrite is desactivated and the result file already exists 360 382 end 361 383 end … … 582 604 par_civ2.ImageA=[]; 583 605 par_civ2.ImageB=[]; 584 i1=i1_series_Civ2(ifield);585 i2=i1;586 if ~isempty(i2_series_Civ2)587 i2=i2_series_Civ2(ifield);588 end589 j1=1;590 if ~isempty(j1_series_Civ2)591 j1=j1_series_Civ2(ifield);592 end593 j2=j1;594 if ~isempty(j2_series_Civ2)595 j2=j2_series_Civ2(ifield);596 end597 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1 ,[],j1);606 % i1_civ2=i1_series_Civ2(ifield); 607 % i2_civ2=i1_civ2; 608 % if ~isempty(i2_series_Civ2) 609 % i2_civ2=i2_series_Civ2(ifield); 610 % end 611 % j1_civ2=1; 612 % if ~isempty(j1_series_Civ2) 613 % j1_civ2=j1_series_Civ2(ifield); 614 % end 615 % j2_civ2=i1_civ2; 616 % if ~isempty(j2_series_Civ2) 617 % j2_civ2=j2_series_Civ2(ifield); 618 % end 619 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_civ2,[],j1_civ2); 598 620 599 621 if strcmp(ImageName_A_Civ2,ImageName_A) && isequal(FrameIndex_A_Civ1(ifield),FrameIndex_A_Civ2(ifield)) … … 602 624 [par_civ2.ImageA,VideoObject_A] = read_image(ImageName_A_Civ2,FileType_A,VideoObject_A,FrameIndex_A_Civ2(ifield)); 603 625 end 604 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2 ,[],j2);626 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_civ2,[],j2_civ2); 605 627 if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_Civ1(ifield),FrameIndex_B_Civ2) 606 628 par_civ2.ImageB=par_civ1.ImageB; … … 608 630 [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield)); 609 631 end 610 if strcmp(Param.ActionInput.ListCompareMode,'PIV')611 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2);612 else % displacement613 ncfile=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2);614 end632 % if strcmp(Param.ActionInput.ListCompareMode,'PIV') 633 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2); 634 % else % displacement 635 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2); 636 % end 615 637 par_civ2.ImageWidth=FileInfo_A.Width; 616 638 par_civ2.ImageHeight=FileInfo_A.Height; … … 712 734 Civ2_Dt=1; 713 735 else 714 Civ2_Dt=time(i2 +1,j2+1)-time(i1+1,j1+1);736 Civ2_Dt=time(i2_civ2+1,j2_civ2+1)-time(i1_civ2+1,j1_civ2+1); 715 737 end 716 738 end … … 737 759 Data.Civ2_ImageB=ImageName_B; 738 760 if strcmp(Param.ActionInput.ListCompareMode,'displacement') 739 Data.Civ2_Time=time(i2 +1,j2+1);% the time is the time of the secodn image761 Data.Civ2_Time=time(i2_civ2+1,j2_civ2+1);% the time is the time of the secodn image 740 762 Data.Civ2_Dt=1;% time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading 741 763 else 742 Data.Civ2_Time=(time(i2 +1,j2+1)+time(i1+1,j1+1))/2;764 Data.Civ2_Time=(time(i2_civ2+1,j2_civ2+1)+time(i1_civ2+1,j1_civ2+1))/2; 743 765 Data.Civ2_Dt=Civ2_Dt; 744 766 end … … 863 885 %% write result in a netcdf file if requested 864 886 if CheckOutputFile 865 errormsg=struct2nc(ncfile ,Data);887 errormsg=struct2nc(ncfile_out,Data); 866 888 if isempty(errormsg) 867 disp([ncfile ' written'])889 disp([ncfile_out ' written']) 868 890 else 869 891 disp(errormsg) -
trunk/src/set_object.m
r911 r912 38 38 function varargout = set_object(varargin) 39 39 40 % Last Modified by GUIDE v2.5 1 5-Jun-2015 19:51:1540 % Last Modified by GUIDE v2.5 16-Jun-2015 00:33:59 41 41 42 42 % Begin initialization code - DO NOT REFRESH … … 307 307 set(handles.num_DY,'Visible','off') 308 308 set(handles.num_DZ,'Visible','off') 309 set(handles.num_RangeInterp,'Visible','off') 309 310 310 311 switch ObjectStyle … … 322 323 set(handles.num_DX,'Visible','on') 323 324 set(handles.num_DX,'TooltipString','num_DX: mesh for the interpolated field along the line') 325 set(handles.num_RangeInterp,'Visible','on') 324 326 end 325 327 case {'rectangle','ellipse'} … … 341 343 set(handles.num_DX,'Visible','on') 342 344 set(handles.num_DY,'Visible','on') 345 set(handles.num_RangeInterp,'Visible','on') 343 346 else 344 347 set(handles.num_DX,'Visible','off') 345 348 set(handles.num_DY,'Visible','off') 346 349 end 347 if isequal(ProjMode,'interp_lin')348 set(handles.num_DZ,'Visible','on')349 end350 % if isequal(ProjMode,'interp_lin') 351 % set(handles.num_DZ,'Visible','on') 352 % end 350 353 case {'volume'} 351 354 set(handles.num_RangeX_1,'Visible','on') … … 372 375 % set default values read in the plot of uvmat to initiate the mesh 373 376 if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') 377 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle 378 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface 374 379 if isempty(str2num(get(handles.num_DX,'String')))||isempty(str2num(get(handles.num_DY,'String'))); 375 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle 376 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface 377 Field=UvData.Field; 380 % Field=UvData.Field; 378 381 if isfield(UvData.Field,'CoordMesh')&&~isempty(UvData.Field.CoordMesh) 379 382 set(handles.num_DX,'String',num2str(UvData.Field.CoordMesh)) … … 387 390 set(handles.CoordUnit,'String',Field.CoordUnit) 388 391 end 392 end 393 if isempty(str2num(get(handles.num_RangeInterp,'String'))) 394 set(handles.num_RangeInterp,'String',num2str(3*UvData.Field.CoordMesh))% default interpolationlength= 3 meshes 389 395 end 390 396 end … … 416 422 huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle 417 423 UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface 418 if isfield(UvData,'X') & isfield(UvData,'Y')& isfield(UvData,'Z')424 if isfield(UvData,'X') && isfield(UvData,'Y') && isfield(UvData,'Z') 419 425 Z=norm_plane(1)*(UvData.X)+norm_plane(2)*(UvData.Y)+norm_plane(3)*(UvData.Z); 420 426 set(handles.z_slider,'Min',min(Z)) … … 691 697 t=struct2xml(Object); 692 698 t=set(t,1,'name','ProjObject'); 693 save(t,FullName) 694 msgbox_uvmat('CONFIRMATION',[FullName ' saved']) 699 try 700 save(t,FullName) 701 msgbox_uvmat('CONFIRMATION',[FullName ' saved']) 702 catch ME 703 msgbox_uvmat('ERROR',ME.message) 704 end 695 705 end 696 706 end … … 801 811 802 812 function num_RangeInterp_Callback(hObject, eventdata, handles) 803 % hObject handle to num_RangeInterp (see GCBO)804 % eventdata reserved - to be defined in a future version of MATLAB805 % handles structure with handles and user data (see GUIDATA)806 807 % Hints: get(hObject,'String') returns contents of num_RangeInterp as text808 % str2double(get(hObject,'String')) returns contents of num_RangeInterp as a double809 810 811 % --- Executes during object creation, after setting all properties.812 function num_RangeInterp_CreateFcn(hObject, eventdata, handles)813 % hObject handle to num_RangeInterp (see GCBO)814 % eventdata reserved - to be defined in a future version of MATLAB815 % handles empty - handles not created until after all CreateFcns called816 817 % Hint: edit controls usually have a white background on Windows.818 % See ISPC and COMPUTER.819 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))820 set(hObject,'BackgroundColor','white');821 end
Note: See TracChangeset
for help on using the changeset viewer.