Changeset 517 for trunk/src/uvmat.m
- Timestamp:
- Aug 17, 2012, 11:47:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r516 r517 180 180 UvData.OpenParam.PosColorbar=[0.805 0.022 0.019 0.445]; 181 181 UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object 182 UvData.OpenParam.PosGeometryCali c=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)182 UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE) 183 183 % UvData.OpenParam.CalSize=[0.28 1]; 184 184 % UvData.PlotAxes=[];%initiate the record of plotted field … … 990 990 991 991 %% set default options in menu 'Fields' 992 if ~testima 993 testcivx=0; 994 if isfield(UvData,'FieldsString') && isequal(UvData.FieldsString,{'get_field...'})% field menu defined as input (from get_field) 992 switch FileType 993 case {'civx','civdata'} 994 [FieldList,ColorList]=calc_field; 995 set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data 996 set(handles_Fields,'Value',2) % set menu to 'velocity 997 % col_vec=FieldList; 998 % col_vec(1)=[];%remove 'velocity' option for vector color (must be a scalar) 999 set(handles.ColorScalar,'Value',1) 1000 set(handles.ColorScalar,'String',ColorList) 1001 set(handles.Coord_x,'Value',1); 1002 set(handles.Coord_x,'String',{'X'}); 1003 set(handles.Coord_y,'Value',1); 1004 set(handles.Coord_y,'String',{'Y'}); 1005 case 'netcdf' 995 1006 set(handles_Fields,'Value',1) 996 1007 set(handles_Fields,'String',{'get_field...'}) 997 UvData=rmfield(UvData,'FieldsString'); 998 else 999 Data=nc2struct(FileName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ'); 1000 if strcmp(Data.Conventions,'uvmat/civdata') ||( ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0))%if the new input is Civx 1001 FieldList=calc_field; 1002 set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data 1003 set(handles_Fields,'Value',2) % set menu to 'velocity' 1004 col_vec=FieldList; 1005 col_vec(1)=[];%remove 'velocity' option for vector color (must be a scalar) 1006 testcivx=1; 1007 end 1008 if ~testcivx 1009 set(handles_Fields,'Value',1) % set menu to 'get_field... 1010 set(handles_Fields,'String',{'get_field...'}) 1011 col_vec={'get_field...'}; 1012 end 1013 set(handles.ColorScalar,'String',col_vec) 1014 end 1008 hget_field=get_field(FileName); 1009 hhget_field=guidata(hget_field); 1010 get_field('RUN_Callback',hhget_field.RUN,[],hhget_field); 1011 % set(handles_Fields,'Value',1) % set menu to 'get_field... 1012 % set(handles_Fields,'String',{'get_field...'}) 1013 % col_vec={'get_field...'}; 1014 % 1015 % set(handles.ColorScalar,'String',col_vec) 1016 otherwise 1017 set(handles_Fields,'Value',1) % set menu to 'image' 1018 set(handles_Fields,'String',{'image'}) 1019 set(handles.Coord_x,'Value',1); 1020 set(handles.Coord_x,'String',{'AX'}); 1021 set(handles.Coord_y,'Value',1); 1022 set(handles.Coord_y,'String',{'AY'}); 1015 1023 end 1016 1024 set(handles.uvmat,'UserData',UvData) … … 2038 2046 end 2039 2047 end 2040 if strcmp(FieldName,'velocity')2048 if ~isempty(regexp(FieldName,'^vec(')) 2041 2049 list_code=get(handles.ColorCode,'String');% list menu fields 2042 2050 index_code=get(handles.ColorCode,'Value');% selected string index … … 2070 2078 end 2071 2079 if isstruct (ParamIn) 2072 ParamIn.FieldName=FieldName; 2073 ParamIn.VelType=VelType; 2074 ParamIn.GUIName='get_field'; 2075 end 2076 check_tps=0; 2080 ParamIn.FieldName=FieldName; 2081 ParamIn.VelType=VelType; 2082 XNameMenu=get(handles.Coord_x,'String'); 2083 ParamIn.CoordName=XNameMenu{get(handles.Coord_x,'Value')}; 2084 YNameMenu=get(handles.Coord_y,'String'); 2085 ParamIn.CoordName={ParamIn.CoordName, YNameMenu{get(handles.Coord_y,'Value')}}; 2086 end 2087 check_tps = 0; 2077 2088 if strcmp(UvData.FileType{1},'civdata')&&~strcmp(ParamIn.FieldName,'velocity')&&~strcmp(ParamIn.FieldName,'get_field...') 2078 2089 check_tps=1;%tps needed to get the requested field … … 2215 2226 end 2216 2227 % display the Fields menu from the input file and pick the selected one: 2217 if isstruct(ParamOut)2218 field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList);2219 set(handles.Fields,'String',ParamOut.FieldList); %update the field menu2220 set(handles.Fields,'Value',find(field_index,1))2221 end2228 % if isstruct(ParamOut) 2229 % field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList); 2230 % set(handles.Fields,'String',ParamOut.FieldList); %update the field menu 2231 % set(handles.Fields,'Value',find(field_index,1)) 2232 % end 2222 2233 2223 2234 %% update the display menu for the second velocity type (second menuline) 2224 2235 test_veltype_1=0; 2225 2236 if isempty(FileName_1) 2226 set(handles.Fields_1,'Value',1); %update the field menu2227 if isstruct(ParamOut)2228 set(handles.Fields_1,'String',[{''};ParamOut.FieldList]); %update the field menu2229 end2237 % set(handles.Fields_1,'Value',1); %update the field menu 2238 % if isstruct(ParamOut) 2239 % set(handles.Fields_1,'String',[{''};ParamOut.FieldList]); %update the field menu 2240 % end 2230 2241 elseif ~test_keepdata_1 2231 2242 if (~strcmp(UvData.FileType{2},'netcdf')&&~strcmp(UvData.FileType{2},'civdata')&&~strcmp(UvData.FileType{2},'civx'))|| isequal(FieldName_1,'get_field...') … … 2625 2636 PlotParam{1}.Vectors.ColCode1=0.33; 2626 2637 PlotParam{1}.Vectors.ColCode2=0.66; 2627 PlotParam{1}.Vectors.ColorScalar={' ima_cor'};2638 PlotParam{1}.Vectors.ColorScalar={''}; 2628 2639 PlotParam{1}.Vectors.ColorCode= {'rgb'}; 2629 2640 end … … 3082 3093 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 3083 3094 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 3084 %FileName=read_file_boxes(handles);3085 3095 hget_field=findobj(allchild(0),'name','get_field'); 3086 3096 if ~isempty(hget_field) … … 3088 3098 end 3089 3099 hget_field=get_field(FileName); 3090 set(hget_field,'Name','get_field')3091 hhget_field=guidata(hget_field);3092 set(hhget_field.list_fig,'Value',1)3093 set(hhget_field.list_fig,'String',{'uvmat'})3100 % set(hget_field,'Name','get_field') 3101 % hhget_field=guidata(hget_field); 3102 % set(hhget_field.list_fig,'Value',1) 3103 % set(hhget_field.list_fig,'String',{'uvmat'}) 3094 3104 % set(handles.transform_fct,'Value',1)% no transform by default 3095 3105 % set(handles.path_transform,'String','') 3096 return %no action 3097 end 3098 list_fields=get(handles.Fields_1,'String');% list menu fields 3099 index_fields=get(handles.Fields_1,'Value');% selected string index 3100 field_1= list_fields{index_fields(1)}; % selected string 3106 return %no further action 3107 end 3108 3101 3109 UvData=get(handles.uvmat,'UserData'); 3102 3110 … … 3148 3156 3149 3157 %common to Fields_1_Callback 3158 list_fields_1=get(handles.Fields_1,'String');% list menu fields 3159 field_1=''; 3160 if ~isempty(list_fields_1) 3161 field_1= list_fields_1{get(handles.Fields_1,'Value')}; % selected string 3162 end 3150 3163 if isequal(field,'image')||isequal(field_1,'image') 3151 3164 set(handles.TitleNpx,'Visible','on')% visible npx,pxcm... buttons … … 4669 4682 data.CoordType=UvData.CoordType; 4670 4683 end 4671 pos=get(handles.uvmat,'Position');4672 pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen)4673 pos(2)=pos(2)-0.02;4684 % pos=get(handles.uvmat,'Position'); 4685 % pos(1)=pos(1)+pos(3)-0.311+0.04; %0.311= width of the geometry_calib interface (units relative to the srcreen) 4686 % pos(2)=pos(2)-0.02; 4674 4687 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(handles); 4675 4688 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt]; 4676 4689 set(handles.view_xml,'Backgroundcolor',[1 1 0])%indicate the reading of the current xml file by geometry_calib 4677 if isfield(UvData.OpenParam,'CalOrigin') 4678 pos_uvmat=get(handles.uvmat,'Position'); 4679 pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3); 4680 pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4); 4681 pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4); 4682 end 4690 pos_uvmat=get(handles.uvmat,'Position'); 4691 pos_cal(1)=pos_uvmat(1)+UvData.OpenParam.PosGeometryCalib(1)*pos_uvmat(3); 4692 pos_cal(2)=pos_uvmat(2)+UvData.OpenParam.PosGeometryCalib(2)*pos_uvmat(4); 4693 pos_cal(3:4)=UvData.OpenParam.PosGeometryCalib(3:4).* pos_uvmat(3:4); 4683 4694 geometry_calib(FileName,pos_cal);% call the geometry_calib interface 4684 4695 set(handles.view_xml,'Backgroundcolor',[1 1 1])%indicate the end of reading of the current xml file by geometry_calib … … 4902 4913 ProjectDir = uigetdir(fileparts(fileparts(RootPath)), 'select the project directory'); 4903 4914 datatree_browser(ProjectDir) 4915 4916 4917 % --- Executes on selection change in Coord_y. 4918 function Coord_y_Callback(hObject, eventdata, handles) 4919 4920 % --- Executes on selection change in Coord_x. 4921 function Coord_x_Callback(hObject, eventdata, handles)
Note: See TracChangeset
for help on using the changeset viewer.