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

📄 importlas.m

📁 基于matlab的反演程序,用于地球物理勘探中射线追踪及偏移成像程序.
💻 M
📖 第 1 页 / 共 2 页
字号:
function importlas(transfer,logmnem,logdesc,lognums,wellid,wellname,x,...
			zunits,zstart,zend,kb,topsflag,wellnamelist)
%
%
% importlasinit(transfer,lognames,lognums,wellid,wellname,x,...
%					zunits,kb,topsflag,wellnamelist)
%
% Initiate a dialog to determine what to do with logs imported from an LAS
%	file. (READLAS has already been run.)
% transfer = a string matlab command to be evaluated with EVAL at the 
%            completion of the dialog. Usually this will re-invoke the 
%            calling program
%  logmnem = string matrix of the log mnemonics found in the LAS file. 
%            (The second return value from read LAS excluding the first row)
%  logdesc = string matrix of the log descriptions found in the LAS file. 
%	     (The third return value from read LAS excluding the first row)
%  lognums = vector of integers indicating the default choice for which logs
%            to use
%   wellid = string containing the unique well id
% wellname = string containing the well name
%        x = the default inline coordinate. Set to nan to indicate no default
%   zunits = string containing the depth units (for display only)
%   zstart = starting log depth
%     zend = ending log depth
%       kb = the kelly bushing elevation (for display only)
% topsflag = default setting for whether to use tops or not
%            -1 ... there are no tops, option not shown
%             0 ... tops present, default is don't use
%             1 ... tops present, default is use
% wellnamelist = vector of names. If present, a toggle button will be present
%		allowing the new log(s) to be associated with an existing 
%               well. If selected the namefield and inline coordinate fields
%               will disappear to be replaced by a popup menu allowing the 
%               selection of one of the names in the vector.
%               Namelist may be in the format returned by 
%               objget(object,'fieldnames') 
%		or that returned by objget(object,'namesmatrix') 
%
% G.F. Margrave May 1994, modified by Chad Hogan 2004
%
% NOTE: It is illegal for you to use this software for a purpose other
% than non-profit education or research UNLESS you are employed by a CREWES
% Project sponsor. By using this software, you are agreeing to the terms
% detailed in this software's Matlab source file.
 
% BEGIN TERMS OF USE LICENSE
%
% This SOFTWARE is maintained by the CREWES Project at the Department
% of Geology and Geophysics of the University of Calgary, Calgary,
% Alberta, Canada.  The copyright and ownership is jointly held by 
% its author (identified above) and the CREWES Project.  The CREWES 
% project may be contacted via email at:  crewesinfo@crewes.org
% 
% The term 'SOFTWARE' refers to the Matlab source code, translations to
% any other computer language, or object code
%
% Terms of use of this SOFTWARE
%
% 1) Use of this SOFTWARE by any for-profit commercial organization is
%    expressly forbidden unless said organization is a CREWES Project
%    Sponsor.
%
% 2) A CREWES Project sponsor may use this SOFTWARE under the terms of the 
%    CREWES Project Sponsorship agreement.
%
% 3) A student or employee of a non-profit educational institution may 
%    use this SOFTWARE subject to the following terms and conditions:
%    - this SOFTWARE is for teaching or research purposes only.
%    - this SOFTWARE may be distributed to other students or researchers 
%      provided that these license terms are included.
%    - reselling the SOFTWARE, or including it or any portion of it, in any
%      software that will be resold is expressly forbidden.
%    - transfering the SOFTWARE in any form to a commercial firm or any 
%      other for-profit organization is expressly forbidden.
%
% END TERMS OF USE LICENSE

% $Id: importlas.m,v 1.4 2004/07/30 21:24:42 kwhall Exp $

	if( nargin < 10)
		wellnameslist=[];
	end

	if( nargin==1 )
		action=transfer;
	else
		action='init';
	end

if(strcmp(action,'init') )
	hax=gca; % get the handle of current axes in calling figure

if(topsflag>0)
	nrows=13;
else
	nrows=12;
end

if(isempty(wellnamelist))
	nrows=nrows-1;
end
        
%build the dialog box and the questions
 hdial=figure('visible','off');
 pos=get(hdial,'position');
 %
 %
 figwidth=400;
 figheight=300;
 bgkol=[0 1 1];
 grey=[.702 .702 .702];

 sep=.005;
 height=(1/nrows)-sep;
 width=1;
 ynow=1-height;
 xnow=sep;
 hmsg=uicontrol('style','text','string','Import LAS logs dialog','units','normalized',...
 	'position',[xnow ynow width height],'foregroundcolor','r','userdata',hax);

% a toggle button
ynow=ynow-sep-height;
htoggle=uicontrol('style','checkbox','string','Use log descriptors as names',...
		'value',0,'callback','importlas(''lognames'')','units','normalized',...
		'position',[xnow,ynow,width,height]);
        	
% the log name question
 %first modify the lognames
 [nlogs,m]=size(logmnem);
 logmnem=[32*ones(nlogs,3) logmnem];
 logdesc=[32*ones(nlogs,3) logdesc];
 impstr=[];
 for k=1:nlogs
		n=int2str(k);
		logmnem(k,1:length(n))=n;
		logdesc(k,1:length(n))=n;
		impstr=[impstr ' ' n];
	end
	ynow=ynow-sep-height;
	width=.3;
		
	hlogname1=uicontrol('style','text','string','Log names:','units','normalized',...
			'position',[xnow,ynow,width,height]);

	xnow=xnow+width+2*sep;
	width=1-xnow-sep;
	hlogname2=uicontrol('style','popupmenu','string',logmnem,'units','normalized',...
			'position',[xnow,ynow+sep,width,height],'callback',...
			'importlas(''setlogname'')','userdata',logdesc,'backgroundcolor',bgkol);

	%log name to edit
	xnow=sep;
	width=.3;
	ynow=ynow-height-sep;
	hlogedit1=uicontrol('style','text','string','Edit log name:','units',...
		'normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=1-xnow-sep;
	hlogedit2=uicontrol('style','edit','string',logmnem(1,4:7),'units','normalized',...
		'position',[xnow,ynow,width,height],'userdata',1);


	% log #'s to import
	xnow=sep;
	width=.4;
	ynow=ynow-height-sep;
	hlogimp1=uicontrol('style','text','string','Log numbers to import:',...
		'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=1-xnow-sep;
	hlogimp2=uicontrol('style','edit','string',impstr,'units','normalized',...
		'position',[xnow,ynow,width,height],'backgroundcolor',bgkol);

	% well name options
	xnow=sep;
	width=.3;
	ynow=ynow-height-sep;
	hwellopt1=uicontrol('style','text','string','Well name options:',...
		'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+2*sep;
	width=1-xnow-sep;
	if(isempty(wellnamelist))
		str=[char(wellname) '|' wellid];
	else
		str=[char(wellname) '|' wellid '|Existing Well'];
	end
	hwellopt2=uicontrol('style','popupmenu','string',str,'units',...
			'normalized','position',[xnow,ynow+sep,width,height],...
			'callback','importlas(''wellname'')');

% the well name
	xnow=sep;
	width=.3;
	ynow=ynow-height-sep;
	hwellname1=uicontrol('style','text','string','Well name:',...
		'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=1-xnow-sep;
	hwellname2=uicontrol('style','edit','string',wellname,'units','normalized',...
		'position',[xnow,ynow,width,height],'backgroundcolor',bgkol);

	if(~isempty(wellnamelist))
		% the existing wells popup 
		xnow=sep;
		width=.4;
		hexist1=uicontrol('style','text','string','Existing Well Names:',...
			'units','normalized','position',[xnow,ynow,width,height],'visible','off');

		xnow=xnow+width+2*sep;
		width=1-xnow-sep;
		hexist2=uicontrol('style','popupmenu','string',wellnamelist,'units',...
			'normalized','position',[xnow,ynow+sep,width,height],'visible',...
			'off','backgroundcolor',bgkol);
	else
		hexist1=0;
		hexist2=0;
	end

	%inline coordinate question
	xnow=sep;
	width=.5;
	ynow=ynow-height-sep;
	hinline1=uicontrol('style','text','string','Inline coordinate:',...
		'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=1-xnow-sep;
	if(isnan(x))
		xstr='';
	else
		xstr=num2str(x);
	end
	hinline2=uicontrol('style','edit','string',xstr,'units','normalized','position',...
		[xnow,ynow,width,height],'backgroundcolor',bgkol);

	%start and end depths
	xnow=sep;
	width=.23;
	ynow=ynow-height-sep;
	hzstart1=uicontrol('style','text','string','Start depth:',...
		'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=.5-xnow-sep;
	hzstart2=uicontrol('style','edit','string',num2str(zstart),'units','normalized',...
		'position',[xnow,ynow,width,height],'backgroundcolor',bgkol);

	xnow=.5+sep;
	width=.23;
	hzend1=uicontrol('style','text','string','End depth:',...
		'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=1-xnow-sep;
	hzend2=uicontrol('style','edit','string',num2str(zend),'units','normalized',...
		'position',[xnow,ynow,width,height],'backgroundcolor',bgkol);

	% depth units and kb elevation
	ynow=ynow-height-sep;
	xnow=sep;
	width=.5;
	hunits=uicontrol('style','text','string',['Depth units: ' zunits],...
		'units','normalized','position',[xnow,ynow,width,height]);

    % 	xnow=xnow+width+sep;
    % 	width=1-xnow-sep;
    % 	hkb=uicontrol('style','text','string',['KB elevation: ' num2str(kb)],...
    % 		'units','normalized','position',[xnow,ynow,width,height]);

    % I added this to allow the KB elevation to be editable. LOGSEC gets
    % really confused if there is no KB at all, and it seems that too many
    % LAS file lack a KB -- and those that have one can't agree on where to
    % put it. 
    % 
    % Chad Hogan, April 2004.
    
    xnow=.5+sep;
    width=.23;
    hkbtext=uicontrol('style','text','string','KB elevation: ',...
        'units','normalized','position',[xnow,ynow,width,height]);

	xnow=xnow+width+sep;
	width=1-xnow-sep;
	hkb=uicontrol('style','edit','string',num2str(kb),'units','normalized',...
		'position',[xnow,ynow,width,height],'backgroundcolor',bgkol);
    
    
	% use tops checkbox
	if( topsflag>0)
		ynow=ynow-height-sep;
		width=.5;
		xnow=sep;
		if(topsflag)
			val=1;
			kol=bgkol;
		else
			val=0;
			kol=grey;
		end
		htops=uicontrol('style','checkbox','string','Import tops','value',val,...
			'units','normalized','position',[xnow,ynow,width,height],...
			'backgroundcolor',kol,'callback','importlas(''tops'')');
	else
		htops=0;
	end

⌨️ 快捷键说明

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