⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 variogram3dfig.m

📁 Kriging插值matlab toolbox
💻 M
📖 第 1 页 / 共 3 页
字号:
function fig = variogram3dfig()
%% function fig = variogram3dfig() establishes a GUI configuration for task Variogram, 
%% it opens the Variogram window
%%
%%  Kriging Software Package  version 3.0,   May 1, 2004
%%  Copyright (c) 1999, 2001, 2004, property of Dezhang Chu and Woods Hole Oceanographic
%%  Institution.  All Rights Reserved.

global hdl data para color

grey=color.grey;
dark_grey=color.dark_grey;
blue=color.blue;

if ~isempty(findobj('type','figure','Tag','FitVariogram')) 
  		figure(hdl.vario.h0);
  		return
end

%% create 1-D semi-variogram/correlogram window
hdl.vario.h0 = figure('Units','normalized', ...
   'Color',color.background, ...
   'Name','Variogram/Correlogram', ...
   'Position',hdl.window_position, ...
   'Tag','FitVariogram','NumberTitle','off');

   set(0, 'showhidden', 'on')
   ch=get(gcf, 'children');
%	delete(ch(1))								%Help
   wmhdl=findobj(ch,'Label','&Help');		
   delete(wmhdl);
   ch(find(ch == wmhdl))=[];
%	delete(ch(3))								%Tools
   wmhdl=findobj(ch,'Label','&Tools');		
   delete(wmhdl);
   ch(find(ch == wmhdl))=[];
%     new feature in V6.x delete(ch(6))			%Edit
   wmhdl=findobj(ch,'Label','&Edit');		
   delete(wmhdl);
   ch(find(ch == wmhdl))=[];
%      new feature in V6.x                      %insert
   wmhdl=findobj(ch,'Label','&Insert');		
   if ~isempty(wmhdl)
     delete(wmhdl);
     ch(find(ch == wmhdl))=[];
   end
%      new feature in V6.x                      %View
   wmhdl=findobj(ch,'Label','&View');		
   if ~isempty(wmhdl)
     delete(wmhdl);
     ch(find(ch == wmhdl))=[];
   end
%      new feature of V7.0                      
   wmhdl=findobj(ch,'Label','&Desktop');	    %Desktop
   if ~isempty(wmhdl)
     delete(wmhdl);
     ch(find(ch == wmhdl))=[];
   end
  
Filehdl=findobj(ch,'Label','&File');
ch_file=get(Filehdl,'children');
%% ch_file   1  '&Print...'
%            2  'Print Pre&view...'
%            3  'Print Set&up...'
%            4  'Pa&ge Setup...'
%            5  'Pre&ferences...'
%            6  '&Export...'
%            7  'Save &As...'
%            8  '&Save'
%            9  '&Close'
%           10  '&Open...'
%           11  '&New Figure'
set(findobj(ch_file(1:end),'Label','&Open...'),'Label','&Load','callback','file_browser3d(2,2);')
file_hdl=findobj(ch_file,'Label','&New Figure');
if ~isempty(file_hdl) 
   delete(file_hdl);
   ch_file(find(ch_file == file_hdl))=[];	
end
set(findobj(ch_file(1:end),'Label','&Save'),'Label','Save &Figure As','callback','file_browser3d(4,3);')
file_hdl=findobj(ch_file,'Label','Save &As...');
if ~isempty(file_hdl) 
   delete(file_hdl);
   ch_file(find(ch_file == file_hdl))=[];	
end
file_hdl=findobj(ch_file,'Label','&Export...');
if ~isempty(file_hdl) 
   delete(file_hdl);
   ch_file(find(ch_file == file_hdl))=[];	
end
file_hdl=findobj(ch_file,'Label','Pre&ferences...');
if ~isempty(file_hdl) 
   delete(file_hdl);
   ch_file(find(ch_file == file_hdl))=[];	
end

%delete(ch_file([11 8 7 6 5]));

h2= uimenu('Parent',hdl.vario.h0,'label','&Task');
h20=uimenu(h2,'label','&Navigator','callback','main_menu3d','separator','off');
h2a=uimenu(h2,'label','   &Load Data','callback','dataprep3dfig;','separator','on');
h2c=uimenu(h2,'label','   &Kriging','callback','kriging3dfig;','separator','off');
h2d=uimenu(h2,'label','   &Visualization','callback','dispkrig3dfig;','separator','off');
h2e=uimenu(h2,'label','   &Save Window Position','callback','save_window_pos(hdl.vario.h0);','separator','off');

hdl.variogram.help=uimenu(hdl.vario.h0,'label','&Help','separator','off');
%% Model Parameters
hdl_variogram_help_MP=uimenu(hdl.variogram.help,'label','Model Parameter','separator','on','selected','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Variogram','Callback','variogram_help(1)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Correlogram','Callback','variogram_help(1)','separator','off','checked','off');
hdl_variogram_help_MP_ex=uimenu(hdl_variogram_help_MP,'label','   Model','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   1. Sphere','Callback','variogram_help(2)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   2. Exponential','Callback','variogram_help(3)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   3. Gaussian','Callback','variogram_help(4)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   4. Linear','Callback','variogram_help(5)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   5. Sinc','Callback','variogram_help(6)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   6. Exponential-Cosine (Type-I)','Callback','variogram_help(7)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   7. Exponential-Cosine (Type-II)','Callback','variogram_help(8)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   8. Gaussian-Cosine','Callback','variogram_help(9)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','   9. Bessel (1-J0)','Callback','variogram_help(10)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','  10. Exponential-Bessel','Callback','variogram_help(11)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','  11. Gassian-Bessel','Callback','variogram_help(12)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','  12. Gaussian-Linear','Callback','variogram_help(13)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP_ex,'label','  13. General Exponential-Bessel','Callback','variogram_help(14)','separator','off','checked','off');

uimenu(hdl_variogram_help_MP,'label','   Nugget','Callback','variogram_help(15)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Sill','Callback','variogram_help(16)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Length','Callback','variogram_help(17)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Power','Callback','variogram_help(18)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Hole Scale','Callback','variogram_help(19)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Range','Callback','variogram_help(20)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Resolution','Callback','variogram_help(21)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Load Parameter File','Callback','variogram_help(22)','separator','off','checked','off');
uimenu(hdl_variogram_help_MP,'label','   Save Parameter File','Callback','variogram_help(22)','separator','off','checked','off');

%% Anisotropy
hdl_variogram_help_AN=uimenu(hdl.variogram.help,'label','Anisotropy','separator','on','selected','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Isotropy','Callback','variogram_help(25)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Anisotropy','Callback','variogram_help(25)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Azimuth','Callback','variogram_help(26)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Dip','Callback','variogram_help(26)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Begin Angle','Callback','variogram_help(27)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   End Angle','Callback','variogram_help(27)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Angle Inc','Callback','variogram_help(27)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Tolerance','Callback','variogram_help(28)','separator','off','checked','off');
uimenu(hdl_variogram_help_AN,'label','   Rotation','Callback','variogram_help(29)','separator','off','checked','off');
%% Ratio
hdl_variogram_help_RT=uimenu(hdl.variogram.help,'label','      - Ratio','separator','off','selected','off','checked','off');
uimenu(hdl_variogram_help_RT,'label','   Y/X','Callback','variogram_help(30)','separator','off','checked','off');
uimenu(hdl_variogram_help_RT,'label','   Z/X','Callback','variogram_help(30)','separator','off','checked','off');

% Display Range
hdl_variogram_help_DR=uimenu(hdl.variogram.help,'label','Display Range','separator','on','selected','off','checked','off');
uimenu(hdl_variogram_help_DR,'label','   Lag','Callback','variogram_help(40)','separator','off');
uimenu(hdl_variogram_help_DR,'label','   Value','Callback','variogram_help(40)','separator','off');

% Push Buttons
hdl_variogram_help_PB=uimenu(hdl.variogram.help,'label','Push Buttons','separator','on','selected','off','checked','off');
uimenu(hdl_variogram_help_PB,'label','   Compute','Callback','variogram_help(50)','separator','off');
uimenu(hdl_variogram_help_PB,'label','   LSQ Fit','Callback','variogram_help(51)','separator','off');
uimenu(hdl_variogram_help_PB,'label','   Default','Callback','variogram_help(52)','separator','off');
uimenu(hdl_variogram_help_PB,'label','   Apply','Callback','variogram_help(53)','separator','off');
uimenu(hdl_variogram_help_PB,'label','   Navigator','Callback','variogram_help(55)','separator','off');
uimenu(hdl_variogram_help_PB,'label','   Quit','Callback','variogram_help(55)','separator','off');

hdl_quit=uimenu(hdl.vario.h0,'label','Quit','separator','on');
uimenu(hdl_quit,'label','&Close Current Window','Callback','close_window(2)','separator','off');
uimenu(hdl_quit,'label','&Quit EasyKrig','Callback','close all','separator','off');

hdl.vario.axes1 = axes('Parent',hdl.vario.h0, ...
	'Color',[1 1 1], ...
	'Position',[0.1 0.60 0.46 0.3], ...
	'Tag','variogramAxes1');
xlabel_str='Lag (Relative to the Full Length Scale)';
ylabel_str='Semi-Variogram/Correlogram';
hx1=xlabel(xlabel_str);
hy1=ylabel(ylabel_str);
para.vario.xlabel=xlabel_str;
para.vario.ylabel=ylabel_str;
hvl1=[hx1 hy1];
set(hvl1,'fontweight','bold')

hdata=get(hdl.vario.axes1,'children');
hline=findobj(hdata,'Type','line');
if ~isempty(hline)
   set(hline,'XDATA',[],'YDATA',[]);
end

%% FILE ID
if isfield(para.dataprep,'fileID')
    fileIDstr=para.dataprep.fileID;
else
    fileIDstr=' ';
end

hdl.vario.fileID = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',dark_grey, ...
	'FontWeight','bold', ...
	'ForegroundColor',[0 0 0.501960784313725], ...
	'ListboxTop',0, ...
	'Position',[0.27 0.95 0.48 0.03], ...
	'String',fileIDstr, ...
	'Style','text', ...
	'Tag','VarioFileID');

% Parameter frame
x00=0.6;y0=0.90;
x0=0.63;Lvarstr=0.07;Lvalue=0.05;Lslider=0.15;dx=0.005;Ly=0.025;
dy=0.045;
hdl.vario.h1 = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',grey, ...
	'ListboxTop',0, ...
	'Position',[x00 0.37 0.35 0.53], ...
	'Style','frame', ...
	'Tag','FrameParameter');
h1 = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',blue, ...
	'FontSize',10, ...
	'FontWeight','bold', ...
	'ForegroundColor',[0 0 1], ...
	'Position',[0.68  y0-0.01 0.2 .028], ...
	'String','Model Parameters', ...
	'Style','text', ...
	'Tag','StaticText2');

%%  semi-variogram / correlogram option
Lradio=0.13;
hdl.vario.variogram = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',dark_grey, ...
	'Callback','radio_action(2,1)', ...
	'FontWeight','bold', ...
	'ListboxTop',0, ...
	'Position',[x0 y0-dy Lradio Ly], ...
	'String','variogram', ...
	'Style','radiobutton', ...
	'Tag','radioVar', ...
	'Value',1);
hdl.vario.correlogram = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',dark_grey, ...
	'Callback','radio_action(2,2)', ...
	'FontWeight','bold', ...
	'ListboxTop',0, ...
	'Position',[x0+3*dx+Lradio y0-dy Lradio Ly], ...
	'String','correlogram', ...
	'Style','radiobutton', ...
	'Tag','radioCorr');

%%% semi-variogram / correlogram model
model_str={'1.  sphere','2.  exponential','3.  gaussian','4.  linear','5. sinc','6. exponential-cosine (type I)', ...
    '7. exponential-cosine (type II)','8. gaussian-cosine','9. Bessel (1-Jo)','10. exponential-bessel', ...
    '11. gaussian-bessel','12. gaussian-linear','13. general exponential-Bessel'};
h1 = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',dark_grey, ...
	'FontWeight','bold', ...
	'HorizontalAlignment','center', ...
	'Position',[x0+5*dx y0-2*dy Lvalue Ly], ...
	'String',' model', ...
	'Style','text', ...
	'Tag','StaticText2');
hdl.vario.model = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'Callback','popupmenu_action(2,1)', ...
	'BackgroundColor',[1 1 1], ...
	'Position',[x0+2*dx+Lvarstr y0-2*dy Lvarstr+Lslider-dx Ly], ...
	'String',model_str, ...
	'Style','popupmenu', ...
	'Tag','VariogramModel');

%%% nugget
h1 = uicontrol('Parent',hdl.vario.h0, ...
	'Units','normalized', ...
	'BackgroundColor',dark_grey, ...
	'HorizontalAlignment','center', ...
	'FontWeight','bold', ...
	'ListboxTop',0, ...
	'Position',[x0+3*dx y0-3*dy Lvarstr Ly], ...
	'String','  nugget', ...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -