Changeset 1045 for trunk/src/uvmat.m
- Timestamp:
- May 21, 2018, 7:06:45 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r1041 r1045 1748 1748 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch' 1749 1749 drawnow 1750 % readthe current input file name:1750 % get the current input file name: 1751 1751 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 1752 1752 % detect the file type, get the movie object if relevant, and look for the corresponding file series: … … 2002 2002 UvData.NewSeries=1; %flag for REFRESH: begin a new series 2003 2003 UvData.FileName_1='';% name of the current second field (used to detect a constant field during file scanning) 2004 UvData.FileType{index}=FileInfo.FileType;2004 %UvData.FileType{index}=FileInfo.FileType; 2005 2005 UvData.FileInfo{index}=FileInfo; 2006 2006 UvData.MovieObject{index}=VideoObject; … … 2196 2196 UvData.XmlData{index}=XmlData; 2197 2197 UvData.NewSeries=1; 2198 set(handles.uvmat,'UserData',UvData) 2198 2199 2199 2200 %display warning message … … 2233 2234 set(handles.Coord_y,'String','Coord_y'); 2234 2235 end 2235 set(handles.uvmat,'UserData',UvData) 2236 2236 2237 2237 2238 %% set index navigation options … … 3157 3158 if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used 3158 3159 if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used 3159 % if strcmp(get(handles.NomType,'String'),'level')3160 % jindex=str2num(get(handles.j1,'String'));3161 % filename=[fullfile(RootPath,SubDir,['level' num2str(jindex)],RootFile) FileIndex FileExt];% build the input file name (first line)3162 % else3163 3160 if isempty(regexp(RootPath,'^http://')) 3164 filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)3161 filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line) 3165 3162 else 3166 3163 filename=[RootPath '/' SubDir '/' RootFile FileIndex FileExt];% … … 3250 3247 for iobj=1:numel(UvData.ProjObject) 3251 3248 if isfield(UvData.ProjObject{iobj},'ProjMode')&& strcmp(UvData.ProjObject{iobj}.ProjMode,'interp_tps') 3252 check_proj_tps=1; 3249 check_proj_tps=1;% tps projection proposed 3253 3250 break 3254 3251 end … … 3285 3282 end 3286 3283 end 3287 switch UvData.FileInfo{1}.Fi leType3288 case {'civ x','civdata','netcdf','pivdata_fluidimage'};3284 switch UvData.FileInfo{1}.FieldType 3285 case {'civdata','netcdf'}; 3289 3286 list_fields=get(handles.FieldName,'String');% list menu fields 3290 3287 FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field … … 3775 3772 set(handles.ListObject_1,'String',{'plane'}) 3776 3773 if UvData.Field.NbDim==3 %3D case 3777 % ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider3778 % ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider3779 3774 UvData.ProjObject{1}.NbDim=3;%test for 3D objects 3780 3775 UvData.ProjObject{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane 3781 3776 UvData.ProjObject{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 3782 3777 UvData.ProjObject{1}.Angle=[0 0]; 3778 if isfield(UvData.Field,'CoordUnit') 3779 UvData.ProjObject{1}.CoordUnit=CoordUnit; 3780 end 3783 3781 elseif isfield(UvData,'Z') 3784 3782 %multilevel case (single menuplane in a 3D space) … … 3846 3844 UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects 3847 3845 if ~isfield(UvData.ProjObject{iobj},'RangeZ') 3848 UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane3846 UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane 3849 3847 end 3850 3848 if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin) 3851 3849 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen 3852 3850 end 3853 3851 end … … 3979 3977 % display menus and plot histograms 3980 3978 test_v=0; 3981 if ~isempty(menu_histo) 3982 set(handles.HistoMenu,'Value',1) 3983 set(handles.HistoMenu,'String',menu_histo) 3984 set(handles.Histogram,'Visible','on') 3985 set(handles.HistoMenu,'Visible','on') 3986 set(handles.HistoAxes,'Visible','on') 3987 HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram 3988 end 3989 end 3990 3979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% A REMETTRE 3980 % if ~isempty(menu_histo) 3981 % set(handles.HistoMenu,'Value',1) 3982 % set(handles.HistoMenu,'String',menu_histo) 3983 % set(handles.Histogram,'Visible','on') 3984 % set(handles.HistoMenu,'Visible','on') 3985 % set(handles.HistoAxes,'Visible','on') 3986 % HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram 3987 % end 3988 end 3989 % open the set_object for interactive plane projection in 3D case 3991 3990 if UvData.Field.NbDim==3 3992 3991 set(handles.CheckEditObject,'Value',1) 3993 3992 CheckEditObject_Callback(handles.uvmat, [], handles) 3994 3993 end 3995 %ResizeFcn(handles.uvmat,[],handles) 3994 3996 3995 set(handles.uvmat,'Pointer',pointer) 3997 3996 … … 4359 4358 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); 4360 4359 if isempty(regexp(RootPath,'^http://')) 4361 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];4360 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt]; 4362 4361 else 4363 4362 FileName=[RootPath '/' SubDir '/' RootFile FileIndices FileExt]; … … 4452 4451 set(handles.Coord_y,'Max',2) 4453 4452 %set(huvmat, 4454 case 'civdata...'%reinitiate input, return to automatic civ data reading 4453 case 'civdata...'%reinitiate input, return to automatic civ data readingget_field 4455 4454 display_file_name(handles,FileName,1) 4456 4455 end … … 4459 4458 if isfield(GetFieldData,'Coordinates') 4460 4459 XName=GetFieldData.Coordinates.Coord_x; 4461 % set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate4462 % else4463 % set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate4464 4460 end 4465 4461 TimeNameStr=GetFieldData.Time.SwitchVarIndexTime; … … 4477 4473 MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension); 4478 4474 set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit 4479 UvData=get(handles.uvmat,'UserData');4480 4475 UvData.TimeUnit=GetFieldData.Time.TimeUnit; 4481 4476 set(handles.uvmat,'UserData',UvData); … … 4490 4485 MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension); 4491 4486 set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit 4492 UvData=get(handles.uvmat,'UserData');4493 4487 UvData.TimeUnit=GetFieldData.Time.TimeUnit; 4494 4488 set(handles.uvmat,'UserData',UvData); … … 4497 4491 end 4498 4492 set(handles.Coord_x,'String',XName) 4499 % if ischar(YName)4500 % YName={YName};4501 % end4502 4493 set(handles.Coord_y,'String',YName) 4503 4494 set(handles.Coord_z,'String',ZName) … … 4506 4497 set(handles.ColorScalar,'Value',1) 4507 4498 set(handles.ColorScalar,'String',VecColorList); 4508 UvData.FileInfo{1}.FileType='netcdf';4499 % UvData.FileInfo{1}.FileType='netcdf'; 4509 4500 set(handles.uvmat,'UserData',UvData) 4510 4501 REFRESH_Callback(hObject, eventdata, handles) … … 4672 4663 set(handles.FieldName_1,'String',[FieldList; {'get_field...'}]); 4673 4664 4674 UvData.File Type{2}='netcdf';4665 UvData.FileInfo{2}.FileType='netcdf'; 4675 4666 set(handles.uvmat,'UserData',UvData) 4676 4667 REFRESH_Callback(hObject, eventdata, handles) … … 4804 4795 else% we introduce the same file (with a different field) for the second series 4805 4796 FileName_1=FileName;% we compare two fields in the same file 4806 UvData.File Type{2}=UvData.FileInfo{1}.FileType;4797 UvData.FileInfo{2}.FileType=UvData.FileInfo{1}.FileType; 4807 4798 UvData.XmlData{2}= UvData.XmlData{1}; 4808 4799 set(handles.SubField,'Value',1) … … 5721 5712 %------------------------------------------------------------------------ 5722 5713 check_view=get(handles.CheckViewObject,'Value'); 5723 5724 5725 5726 5714 hset_object=findobj(allchild(0),'tag','set_object'); 5715 if ~isempty(hset_object) 5716 delete(hset_object)% delete existing version of set_object 5717 end 5727 5718 if check_view %activate set_object 5728 5719 IndexObj=get(handles.ListObject,'Value'); … … 5747 5738 data.Type='plane'; 5748 5739 end 5749 5740 5750 5741 %% initiate the new projection object 5751 5742 hset_object=set_object(data,[],ZBounds); … … 5758 5749 set(hhset_object.SAVE,'Enable','on') 5759 5750 end 5760 else5761 % hset_object=findobj(allchild(0),'tag','set_object');5762 % if ~isempty(hset_object)5763 % delete(hset_object)% delete existing version of set_object5764 % end5765 5751 end 5766 5752
Note: See TracChangeset
for help on using the changeset viewer.