- Timestamp:
- Dec 4, 2011, 5:54:17 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r315 r316 23 23 %TODO: search range 24 24 25 % Last Modified by GUIDE v2.5 0 3-Dec-2011 16:08:2525 % Last Modified by GUIDE v2.5 04-Dec-2011 08:42:47 26 26 % Begin initialization code - DO NOT EDIT 27 27 gui_Singleton = 1; … … 268 268 %set(handles.thresh_patch1,'Visible','off') 269 269 % set(handles.thresh_text1,'Visible','off') 270 %set(handles.num_MaxDiff,'Visible','off')271 % set(handles.thresh_text2,'Visible','off')270 set(handles.num_MaxDiff,'Visible','off') 271 set(handles.title_MaxDiff,'Visible','off') 272 272 set(handles.num_Rho,'Style','edit') 273 273 set(handles.num_Rho,'String','1') … … 281 281 set(handles.MenuMatlab,'checked','on') 282 282 set(handles.MenuCivX,'checked','off') 283 if get(handles.CheckPatch1,'Value') 284 set(handles.thresh_patch1,'Visible','on') 285 set(handles.thresh_text1,'Visible','on') 286 end 287 if get(handles.CheckPatch2,'Value') 288 set(handles.num_MaxDiff,'Visible','on') 289 set(handles.thresh_text2,'Visible','on') 290 end 283 % if get(handles.CheckPatch1,'Value') 284 set(handles.num_MaxDiff,'Visible','on') 285 set(handles.title_MaxDiff,'Visible','on') 286 287 % end 291 288 set(handles.num_Rho,'Style','popupmenu') 292 289 set(handles.num_Rho,'Value',1) … … 868 865 lastfield=''; 869 866 % check the content netcdf file 870 Data=nc2struct(civ_files{ifile},'ListGlobalAttribute','patch2','fix2','civ2','patch','fix'); 871 if ~isempty(Data.patch2) && isequal(Data.patch2,1) 872 option=6; 873 option_str='patch2'; 874 elseif ~isempty(Data.fix2) && isequal(Data.fix2,1) 875 option=5; 876 option_str='fix2'; 877 elseif ~isempty(Data.civ2) && isequal(Data.civ2,1); 878 option=4; 879 option_str='civ2'; 880 elseif ~isempty(Data.patch) && isequal(Data.patch,1); 881 option=3; 882 option_str='patch1'; 883 elseif ~isempty(Data.fix) && isequal(Data.fix,1); 884 option=2; 885 option_str='fix1'; 867 Data=nc2struct(civ_files{ifile},'ListGlobalAttribute','CivStage','patch2','fix2','civ2','patch','fix'); 868 option_list={'civ1','fix1','patch1','civ2','fix2','patch2'}; 869 if ~isempty(Data.CivStage) 870 option=Data.CivStage; 886 871 else 887 option=1; 888 option_str='civ1'; 889 end 872 if ~isempty(Data.patch2) && isequal(Data.patch2,1) 873 option=6; 874 % option_str='patch2'; 875 elseif ~isempty(Data.fix2) && isequal(Data.fix2,1) 876 option=5; 877 % option_str='fix2'; 878 elseif ~isempty(Data.civ2) && isequal(Data.civ2,1); 879 option=4; 880 % option_str='civ2'; 881 elseif ~isempty(Data.patch) && isequal(Data.patch,1); 882 option=3; 883 % option_str='patch1'; 884 elseif ~isempty(Data.fix) && isequal(Data.fix,1); 885 option=2; 886 % option_str='fix1'; 887 else 888 option=1; 889 % option_str='civ1'; 890 end 891 end 892 option_str=option_list{option}; 890 893 end 891 894 if option >= option_civ … … 3717 3720 end 3718 3721 if testmask 3719 stage=1;%default 3720 switch parent_tag 3721 % case 'Fix1' 3722 % stage=2; 3723 case 'Civ2' 3724 stage=3; 3725 % case 'Fix2' 3726 % stage=4; 3727 end 3728 set(handles.txt_Mask(stage:end),'Visible','on') 3729 set(handles.txt_Mask(stage:end),'String',filemask) 3730 set(handles.CheckMask(stage:end),'Value',1) 3722 % stage=4;%default 3723 if strcmp(parent_tag,'Civ1') 3724 set(handles.txt_Mask,'Visible','on') 3725 set(handles.txt_Mask,'String',filemask) 3726 set(handles.CheckMask,'Value',1) 3727 end 3728 % switch parent_tag 3729 % % case 'Fix1' 3730 % % stage=2; 3731 % case 'Civ2' 3732 % stage=3; 3733 % % case 'Fix2' 3734 % % stage=4; 3735 % end 3736 % set(handles.txt_Mask(stage:end),'Visible','on') 3737 % set(handles.txt_Mask(stage:end),'String',filemask) 3738 % set(handles.CheckMask(stage:end),'Value',1) 3731 3739 else 3732 3740 set(hObject,'Value',0); … … 4009 4017 % set(handles.thresh_text1,'Visible','off') 4010 4018 % set(handles.num_MaxDiff,'Visible','off') 4011 % set(handles.t hresh_text2,'Visible','off')4019 % set(handles.title_MaxDiff,'Visible','off') 4012 4020 % set(handles.num_Rho,'Style','edit') 4013 4021 % set(handles.num_Rho,'String','1') … … 4114 4122 filename=regexprep(filename,'.nc',''); 4115 4123 MaskName_string='';%default 4116 if Param.(fixname).CheckMask4117 MaskName_string=[' -maskName "' Param.(fixname).MaskName'"'];4118 end4124 % if Param.(fixname).CheckMask 4125 % MaskName_string=[' -maskName "' Param.(fixname).Mask '"']; 4126 % end 4119 4127 MaxVel_string='';%default 4120 4128 if ~isempty(Param.(fixname).MaxVel) -
trunk/src/civ_matlab.m
r315 r316 105 105 eval(['Data.' ListName '=Param.Fix1.' ParamName ';']) 106 106 end 107 % Data.ListGlobalAttribute=[Data.ListGlobalAttribute {'Fix1_WarnFlags','Fix1_TreshCorr','Fix1_TreshVel','Fix1_UpperBoundTest'}];108 % Data.Fix1_WarnFlags=Param.Fix1.WarnFlags;109 % Data.Fix1_ThreshCorr=Param.Fix1.ThreshCorr;110 % Data.Fix1_ThreshVel=Param.Fix1.ThreshVel;111 % Data.Fix1_UpperBoundTest=Param.Fix1.UpperBoundTest;112 113 107 if check_civx 114 108 if ~isfield(Data,'fix') … … 131 125 if isfield (Param,'Patch1') 132 126 check_patch1=1; 127 Param.Patch1 133 128 Data.ListGlobalAttribute=[Data.ListGlobalAttribute {'Patch1_Rho','Patch1_Threshold','Patch1_SubDomain'}]; 134 Data.Patch1_Rho= str2double(Param.Patch1.Rho);135 Data.Patch1_Threshold= str2double(Param.Patch1.Threshold);136 Data.Patch1_SubDomain= str2double(Param.Patch1.SubDomain);129 Data.Patch1_Rho=Param.Patch1.SmoothingParam; 130 Data.Patch1_Threshold=Param.Patch1.MaxDiff; 131 Data.Patch1_SubDomain=Param.Patch1.SubdomainSize; 137 132 Data.ListVarName=[Data.ListVarName {'Civ1_U_Diff','Civ1_V_Diff','Civ1_X_SubRange','Civ1_Y_SubRange','Civ1_NbSites','Civ1_X_tps','Civ1_Y_tps','Civ1_U_tps','Civ1_V_tps'}]; 138 133 Data.VarDimName=[Data.VarDimName {'NbVec1','NbVec1',{'NbSubDomain1','Two'},{'NbSubDomain1','Two'},'NbSubDomain1',... … … 146 141 ind_good=find(Data.Civ1_FF==0); 147 142 else 143 148 144 ind_good=1:numel(Data.Civ1_X); 149 145 end … … 171 167 isx2=ibx2+2; 172 168 isy2=iby2+2; 169 173 170 %get the previous guess for displacement 171 174 172 if ~check_patch1 175 [Guess,VelType]=read_civdata(ObjectName,InputField,ParamIn.VelType);%TO DEVELOP 176 else 177 Data.Civ1_U_Diff=zeros(size(Data.Civ1_X)); 178 Data.Civ1_V_Diff=zeros(size(Data.Civ1_X)); 179 if isfield(Data,'Civ1_FF') 180 ind_good=find(Data.Civ1_FF==0); 181 else 182 ind_good=1:numel(Data.Civ1_X); 183 end 184 [Data.Civ1_X_SubRange,Data.Civ1_Y_SubRange,Data.Civ1_NbSites,FFres,Ures, Vres,Data.Civ1_X_tps,Data.Civ1_Y_tps,Data.Civ1_U_tps,Data.Civ1_V_tps]=... 185 patch(Data.Civ1_X(ind_good)',Data.Civ1_Y(ind_good)',Data.Civ1_U(ind_good)',Data.Civ1_V(ind_good)',Data.Patch1_Rho,Data.Patch1_Threshold,Data.Patch1_SubDomain); 186 end 173 [Data,VelType]=read_civdata(ObjectName,InputField,ParamIn.VelType);%TO DEVELOP 174 end 175 176 Guess =interp_tps(Data,X,Y) 177 % Data.Civ1_U_Diff=zeros(size(Data.Civ1_X)); 178 % Data.Civ1_V_Diff=zeros(size(Data.Civ1_X)); 179 % if isfield(Data,'Civ1_FF') 180 % ind_good=find(Data.Civ1_FF==0); 181 % else 182 % ind_good=1:numel(Data.Civ1_X); 183 % end 184 % [Data.Civ1_X_SubRange,Data.Civ1_Y_SubRange,Data.Civ1_NbSites,FFres,Ures, Vres,Data.Civ1_X_tps,Data.Civ1_Y_tps,Data.Civ1_U_tps,Data.Civ1_V_tps]=... 185 % patch(Data.Civ1_X(ind_good)',Data.Civ1_Y(ind_good)',Data.Civ1_U(ind_good)',Data.Civ1_V(ind_good)',Data.Patch1_Rho,Data.Patch1_Threshold,Data.Patch1_SubDomain); 186 % end 187 187 % shiftx=str2num(par_civ1.shiftx); 188 188 % shifty=str2num(par_civ1.shifty); … … 597 597 FF=FF==1 | C<Param.MinCorr; 598 598 end 599 if isfield (Param,'MinVel')||(isfield (Param,'MaxVel')&&~isempty(Param.MaxVel))599 if (isfield(Param,'MinVel')&&~isempty(Param.MinVel))||(isfield (Param,'MaxVel')&&~isempty(Param.MaxVel)) 600 600 Umod= U.*U+V.*V; 601 if isfield (Param,'MinVel') 601 if isfield (Param,'MinVel')&&~isempty(Param.MinVel) 602 602 FF=FF==1 | Umod<(Param.MinVel*Param.MinVel); 603 603 end … … 722 722 CentreY=linspace(MinY+SizY/2,MaxY-SizY/2,NbSubDomainY); 723 723 [CentreX,CentreY]=meshgrid(CentreX,CentreY); 724 CentreY=reshape(CentreY,1,[]); 725 CentreX=reshape(CentreX,1,[]); 724 CentreY=reshape(CentreY,1,[]);% Y positions of subdomain centres 725 CentreX=reshape(CentreX,1,[]);% X positions of subdomain centres 726 726 rho=SizX*SizY*Rho/1000000;%optimum rho increase as the area of the subdomain (division by 10^6 to reach good values with the default GUI input) 727 727 U_tps_sub=zeros(length(X),NbSubDomain);%default spline -
trunk/src/read_civdata.m
r246 r316 76 76 end 77 77 var_ind=find(vardetect); 78 for ivar=1: length(var_ind)78 for ivar=1:min(numel(var_ind),numel(Field.VarAttribute)) 79 79 Field.VarAttribute{ivar}.Role=role{var_ind(ivar)}; 80 80 Field.VarAttribute{ivar}.Unit=units{var_ind(ivar)}; -
trunk/src/uvmat.m
r315 r316 2552 2552 %PlotParam{1}=read_plot_param(handles);%read plotting parameters on the uvmat interfac 2553 2553 PlotParam{1}=read_GUI(handles.uvmat); 2554 if ~isfield(PlotParam{1},'Vectors') 2555 PlotParam{1}.Vectors.MaxVec=1; 2556 PlotParam{1}.Vectors.MinVec=0; 2557 PlotParam{1}.Vectors.CheckFixVecColor=1; 2558 PlotParam{1}.Vectors.ColCode1=0.33; 2559 PlotParam{1}.Vectors.ColCode2=0.66; 2560 PlotParam{1}.Vectors.ListColorScalar={'ima_cor'}; 2561 PlotParam{1}.Vectors.ListColorCode= {'rgb'}; 2562 end 2554 2563 keeplim(1)=get(handles.CheckFixLimits,'Value');% test for fixed graph limits 2555 2564 PosColorbar{1}=UvData.OpenParam.PosColorbar;%prescribe the colorbar position on the uvmat interface … … 2572 2581 iobj=IndexObj(imap); 2573 2582 [ObjectData,errormsg]=proj_field(UvData.Field,UvData.Object{iobj});% project field on the object 2574 if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates') 2575 PlotParam{imap}.Coordinates=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field) 2576 end 2583 2577 2584 if ~isempty(errormsg) 2578 2585 return 2586 end 2587 % if testnewseries && isfield(ObjectData,'CoordUnit')&& isfield(PlotParam{imap},'Coordinates') 2588 % PlotParam{imap}.Coordinates=rmfield(PlotParam{imap}.Coordinates,'CheckFixEqual'); %set FixEqual to depend on the field (=1 if Data.CoordUnit=1 in plot_field) 2589 % end 2590 if testnewseries && isfield(ObjectData,'CoordUnit') 2591 PlotParam{imap}.Coordinates.CheckFixEqual=1; 2579 2592 end 2580 2593 %use of mask (TODO: check) … … 3870 3883 Amax=double(max(max(max(FieldHisto))));%max of image 3871 3884 if isequal(Amin,Amax) 3872 msgbox_uvmat('WARNING',['uniform field =' num2str(Amin)]); 3885 %msgbox_uvmat('WARNING',['uniform field =' num2str(Amin)]); 3886 cla(haxes) 3873 3887 else 3874 3888 Histo.ListVarName={FieldName,'histo'}; … … 4077 4091 %------------------------------------------------------------------------ 4078 4092 set(handles.CheckFixVecColor,'Value',1) 4079 AutoVecColor_Callback(hObject, eventdata, handles)4093 CheckFixVecColor_Callback(hObject, eventdata, handles) 4080 4094 min_val=str2num(get(handles.num_MinVec,'String')); 4081 4095 max_val=str2num(get(handles.num_MaxVec,'String'));
Note: See TracChangeset
for help on using the changeset viewer.