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

📄 subset.m,v

📁 具有特色的地震数据处理源码
💻 M,V
字号:
head	3.0;access;symbols;locks; strict;comment	@// @;3.0date	2000.06.13.19.22.13;	author gilles;	state Exp;branches;next	2.0;2.0date	99.05.21.18.46.44;	author mah;	state Exp;branches;next	1.2;1.2date	99.05.17.17.17.18;	author mah;	state Exp;branches;next	1.1;1.1date	99.01.06.19.09.09;	author kay;	state Exp;branches;next	;desc@@3.0log@Release 3@text@function [dataout]=subset(datain,tr1,tr2,t1,t2,r1,r2)%function [dataout]=subset(datain,tr1,tr2,t1,t2,r1,r2)%%subset -> creates a new variable containing only the traces specified%-tr1, tr2 are the first and last traces of the desired subset%-t1, t2 are the first and last times of the desired subset in seconds%-r1 and r2 are the first and last records of the desired subset%-similar to GETR in Insight%%[dataout]=subset(datain,tr1,tr2,t1,t2,r1,r2)%%DSI customized VSP processing software%written by Kristen Beaty October, 1997%$Id: subset.m,v 2.0 1999/05/21 18:46:44 mah Exp gilles $%$Log: subset.m,v $%Revision 2.0  1999/05/21 18:46:44  mah%Release 2%%Revision 1.2  1999/05/17 17:17:18  mah%fixed help message%%Revision 1.1  1999/01/06 19:09:09  kay%Initial revision%%%Copyright (C) 1998 Seismology and Electromagnetic Section/%Continental Geosciences Division/Geological Survey of Canada%%This library is free software; you can redistribute it and/or%modify it under the terms of the GNU Library General Public%License as published by the Free Software Foundation; either%version 2 of the License, or (at your option) any later version.%%This library is distributed in the hope that it will be useful,%but WITHOUT ANY WARRANTY; without even the implied warranty of%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%Library General Public License for more details.%%You should have received a copy of the GNU Library General Public%License along with this library; if not, write to the%Free Software Foundation, Inc., 59 Temple Place - Suite 330,%Boston, MA  02111-1307, USA.%%DSI Consortium%Continental Geosciences Division%Geological Survey of Canada%615 Booth St.%Ottawa, Ontario%K1A 0E9%%email: dsi@@cg.nrcan.gc.cadisp('[dataout]=subset(datain,tr1,tr2,t1,t2,r1,r2)');%check for errorsif tr1>tr2 | t1>t2 | r1>r2     disp('check parameters for subset and try again');     error('tr1, t1 and r1 should be smaller than tr2, t2 and r2 respectively');end; %if%find indexes corresponding to t1 and t2startt=round((t1-datain.fh{9})/datain.fh{8}+1);	%index of t1endt=round((t2-datain.fh{9})/datain.fh{8}+1);	%index of t2%datain.fh{8} is the sampling interval in seconds%datain.fh{9} is the trace start time in secondsdt=endt-startt+1;dtr=tr2-tr1+1;%make some changes to file headerdataout.fh=datain.fh;				%copy file headerdataout.fh{1}=dtr.*(r2-r1+1); %number of trace in datasetdataout.fh{7}=dt;		%number of points/tracedataout.fh{9}=t1;			%trace start time (ms)dataout.fh{10}=t2;		%trace end time (ms)dataout.fh{12}=r2-r1+1;				%number of recordsdataout.fh{13}=dtr;				%max record foldfor COUNT =r1:r2	%loop over records        orec=COUNT-r1+1;%put selected subset into dataout	dataout.dat{orec}=datain.dat{COUNT}(startt:endt,tr1:tr2);	dataout.th{orec}=datain.th{COUNT}(:,tr1:tr2);%make necessary changes to trace headers	dataout.th{orec}(12,1)=dtr;		%number of traces in record	for i=1:dtr		dataout.th{orec}(13,i)=i;	%trace number within record	end; %forend; %loop over records@2.0log@Release 2@text@d15 1a15 1%$Id: subset.m,v 1.2 1999/05/17 17:17:18 mah Exp mah $d17 3@1.2log@fixed help message@text@d15 1a15 1%$Id: subset.m,v 1.1 1999/01/06 19:09:09 kay Exp mah $d17 3@1.1log@Initial revision@text@d2 1d15 5a19 2%$Id:$%$Log:$@

⌨️ 快捷键说明

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