- Timestamp:
- Apr 27, 2014, 8:14:51 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r750 r752 34 34 function varargout = get_field(varargin) 35 35 36 % Last Modified by GUIDE v2.5 2 1-Apr-2014 15:03:1936 % Last Modified by GUIDE v2.5 24-Apr-2014 22:45:34 37 37 38 38 % Begin initialization code - DO NOT EDIT … … 640 640 set(handles.Coord_x,'String',ListCoord) 641 641 end 642 if get(handles.CheckDimension Y,'Value')642 if get(handles.CheckDimensionX,'Value') 643 643 set(handles.Coord_y,'Value',1) 644 644 set(handles.Coord_y,'String',dim_var') … … 647 647 set(handles.Coord_y,'String',ListCoord) 648 648 end 649 if get(handles.CheckDimension Z,'Value')649 if get(handles.CheckDimensionX,'Value') 650 650 set(handles.Coord_z,'Value',1) 651 651 set(handles.Coord_z,'String',dim_var') … … 909 909 set(handles.TimeName, 'String',Field.Display.ListDimName) 910 910 end 911 TimeName_Callback(hObject, [], handles) 911 912 912 913 %----------------------------------------------------------------------- … … 985 986 % --- Executes on selection change in TimeName. 986 987 function TimeName_Callback(hObject, eventdata, handles) 988 Field=get(handles.get_field,'UserData'); 987 989 index=get(handles.SwitchVarIndexTime,'Value'); 988 if index==3 ; % TimeName is used to chose a variable 989 index=get(handles.TimeName,'Value'); 990 string=get(handles.TimeName,'String'); 991 VarName=string{index}; 992 end 993 update_field(handles,VarName) 990 switch index 991 case 1 992 set(handles.num_TimeDimension,'String','') 993 set(handles.TimeUnit,'String','index') 994 case 2 995 set(handles.num_TimeDimension,'String','') 996 attr_index=strcmpi(TimeUnit,Field.ListGlobalAttribute); 997 if ~isempty(attr_index) 998 AttrName=Field.ListGlobalAttribute{attr_index}; 999 set(handles.TimeUnit,'String',Field.(AttrName)) 1000 end 1001 case {3 ,4} 1002 MenuIndex=get(handles.TimeName,'Value'); 1003 string=get(handles.TimeName,'String'); 1004 if index==3 % TimeName is used to chose a variable 1005 VarName=string{MenuIndex}; 1006 VarIndex=name2index(VarName,Field.ListVarName); 1007 DimName=Field.VarDimName{VarIndex}; 1008 DimIndex=name2index(DimName,Field.ListDimName); 1009 DimValue=Field.DimValue(DimIndex); 1010 set(handles.num_TimeDimension,'String',num2str(DimValue)) 1011 unit=''; 1012 if isfield(Field,'VarAttribute')&& isfield(Field.VarAttribute{VarIndex},'Unit') 1013 unit=Field.VarAttribute{VarIndex}.Unit; 1014 end 1015 set(handles.TimeUnit,'String',unit) 1016 update_field(handles,VarName) 1017 elseif index==4% TimeName is used to chose a dimension 1018 DimName=string{MenuIndex}; 1019 DimIndex=name2index(DimName,Field.ListDimName); 1020 DimValue=Field.DimValue(DimIndex); 1021 set(handles.num_TimeDimension,'String',num2str(DimValue)) 1022 set(handles.TimeUnit,'String','index') 1023 1024 end 1025 end 994 1026 995 1027 … … 1002 1034 end 1003 1035 set(handles.Coord_z,'Visible',status) 1004 set(handles.CheckDimensionZ,'Visible',status)1036 % set(handles.CheckDimensionZ,'Visible',status) 1005 1037 set(handles.Z_title,'Visible',status) 1006 1038 set(handles.vector_z,'Visible',status) 1007 1039 set(handles.W_title,'Visible',status) 1008 1009 -
trunk/src/get_file_type.m
r675 r752 55 55 error_nc=0; 56 56 try 57 Data=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',...58 'CivStage','patch2','fix2','civ2','patch','fix' );59 if isfield(Data,'Txt') && ~isempty(Data.Txt)57 [Data,tild,tild,errormsg]=nc2struct(fileinput,'ListGlobalAttribute','absolut_time_T0','Conventions',... 58 'CivStage','patch2','fix2','civ2','patch','fix','hart'); 59 if ~isempty(errormsg) 60 60 error_nc=1; 61 61 else 62 if ~isempty(Data.absolut_time_T0') 62 if ~isempty(Data.absolut_time_T0') && ~isempty(Data.hart) 63 63 FileType='civx'; % test for civx velocity fields 64 if ~isempty(Data.patch2) &&isequal(Data.patch2,1)64 if isequal(Data.patch2,1) 65 65 FileInfo.CivStage=6; 66 elseif ~isempty(Data.fix2) &&isequal(Data.fix2,1)66 elseif isequal(Data.fix2,1) 67 67 FileInfo.CivStage=5; 68 elseif ~isempty(Data.civ2) && isequal(Data.civ2,1);68 elseif isequal(Data.civ2,1) 69 69 FileInfo.CivStage=4; 70 elseif ~isempty(Data.patch) && isequal(Data.patch,1);70 elseif isequal(Data.patch,1) 71 71 FileInfo.CivStage=3; 72 elseif ~isempty(Data.fix) && isequal(Data.fix,1);72 elseif isequal(Data.fix,1) 73 73 FileInfo.CivStage=2; 74 else if ~isempty(Data.absolut_time_T0) && ~isempty(Data.hart)74 else 75 75 FileInfo.CivStage=1; 76 76 end -
trunk/src/series.m
r748 r752 2001 2001 2002 2002 %% Detect the types of input files 2003 SeriesData=get(handles.series,'UserData'); 2003 SeriesData=get(handles.series,'UserData');% info on the input file series 2004 2004 iview_civ=[];nb_netcdf=0; 2005 2005 if ~isempty(SeriesData)&&isfield(SeriesData,'FileType') … … 2007 2007 nb_netcdf=numel(find(strcmp('netcdf',SeriesData.FileType))); 2008 2008 end 2009 if numel(iview_civ)>=1 2009 if numel(iview_civ)>=1 && ~isempty(iview_civ(1)) 2010 2010 menu=set_veltype_display(SeriesData.FileInfo{iview_civ(1)}.CivStage,SeriesData.FileType{iview_civ(1)}); 2011 2011 set(handles.VelType,'String',[{'*'};menu]) -
trunk/src/uvmat.m
r750 r752 3198 3198 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')]) 3199 3199 set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix) 3200 MaxIndex_i=get(handles.MaxIndex_i,'String'); 3201 MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension); 3202 set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit 3203 UvData=get(handles.uvmat,'UserData'); 3204 UvData.TimeUnit=GetFieldData.Time.TimeUnit; 3205 set(handles.uvmat,'UserData',UvData); 3200 3206 set(handles.FileIndex,'String','') 3201 3207 ParamIn.TimeVarName=GetFieldData.Time.TimeName; … … 3203 3209 set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]); 3204 3210 set(handles.NomType,'String','*') 3205 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')]) 3211 set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')]) 3206 3212 set(handles.i1,'String','1')% set counter to 1 (now the time index in the input matrix) 3213 MaxIndex_i=get(handles.MaxIndex_i,'String'); 3214 MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension); 3215 set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit 3216 UvData=get(handles.uvmat,'UserData'); 3217 UvData.TimeUnit=GetFieldData.Time.TimeUnit; 3218 set(handles.uvmat,'UserData',UvData); 3207 3219 set(handles.FileIndex,'String','') 3208 3220 ParamIn.TimeDimName=GetFieldData.Time.TimeName; … … 3810 3822 CoordUnitPrev=UvData.Field.CoordUnit; 3811 3823 end 3812 if ~isempty(list_path{ichoice}) 3813 if nargin(transform_handle)>1 && isfield(UvData,'XmlData')&&~isempty(UvData.XmlData) 3814 DataOut=feval(transform_handle,'*',UvData.XmlData{1});% execute the transform fct to get the required conditions 3824 if ~isempty(list_path{ichoice}) 3825 if nargin(transform_handle)>1 %&& isfield(UvData,'XmlData')&&~isempty(UvData.XmlData) 3826 XmlData=[]; 3827 if isfield(UvData,'XmlData')&&~isempty(UvData.XmlData) 3828 XmlData=UvData.XmlData{1}; 3829 end 3830 UvData.Field.Action.RUN=0;% indicate that the transform fct is called only to get input param 3831 DataOut=feval(transform_handle,UvData.Field,XmlData);% execute the transform fct to get the required conditions 3815 3832 if isfield(DataOut,'CoordUnit')% set the requested coord unit (info used to possibly delete the current projection objects) 3816 3833 CoordUnit=DataOut.CoordUnit; … … 4592 4609 %------------------------------------------------------------------------ 4593 4610 hfig=figure; 4594 copyobj(handles.PlotAxes,hfig); 4611 hc=copyobj(handles.PlotAxes,hfig); 4612 set(hc,'Position',[0.1 0.1 0.8 0.8]) 4595 4613 h=findobj(handles.PlotAxes,'tag','ima'); %look for image in the plot 4596 4614 if ~isempty(h) 4597 4615 map=colormap(handles.PlotAxes); 4598 colormap(map);%transmit the current colormap to the zoomfig4616 colormap(map);%transmit the current colormap to the new fig 4599 4617 colorbar 4600 4618 end … … 5669 5687 set(handles.TableDisplay,'Visible','off') 5670 5688 end 5671 5672 -
trunk/src/view_field.m
r748 r752 317 317 %------------------------------------------------------------------- 318 318 hfig=figure; 319 copyobj(handles.PlotAxes,hfig); 319 hc=copyobj(handles.PlotAxes,hfig); 320 set(hc,'Position',[0.1 0.1 0.8 0.8]) 321 h=findobj(handles.PlotAxes,'tag','ima'); %look for image in the plot 320 322 if ~isempty(h) 321 323 h=findobj(handles.PlotAxes,'tag','ima'); %look for image in the plot
Note: See TracChangeset
for help on using the changeset viewer.