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

📄 medirm.m

📁 具有特色的地震数据处理源码
💻 M
字号:
function [dataout,medi_data]=medirm(datain,tmax,win,v,static)%[dataout,medi_data]=medirm(datain,tmax,win,v,static)%(flattens by velocity and shot static)%or%[dataout,medi_data]=medirm(datain,tmax,win,headwd)%(flattens by pick times)%%Module to remove a downgoing wave using a median filter.%Data (in DSI format) is flattened according to the velocity of the wave to%be removed or else according to pick times and trim statics are applied.%Flattened data are then median filtered and this filtered dataset is stored%in the variable 'filt_data' and subtracted form the dataset.  Trim static%shifts are stored in trace header word 25.  Shifts done to flatten the%velocity are removed but trim statics are not.%%This routine is advantageous because it buffers the data so that none is%lost from doing time shifts.  This is especially good for trying to remove%the S wave without loosing reflections that arrive before it.%%tmax - maximum time shift to be considered by trim statics (try ~ 0.01s)%win - window for median filter (must be an odd number)%v - velocity of wave to be removed%static - shot static (s) (used to calculate window in which to perform trim%headwd - header word that first break pick times are stored in%%Uses other DSI modules (tred, flat, unflat, trim, ener, medi_filt, and subr)%%DSI customized VSP processing software%written by Kristen Beaty January, 1998%$Id: medirm.m,v 3.0 2000/06/13 19:20:46 gilles Exp $%$Log: medirm.m,v $%Revision 3.0  2000/06/13 19:20:46  gilles%Release 3%%Revision 2.0  1999/05/21 18:45:59  mah%Release 2%%Revision 1.2  1999/01/11 19:55:53  mah%removed repeated lines of code%%Revision 1.1  1999/01/06 19:09:05  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.catredway=(nargin==5);if tredway disp('[dataout,medi_data]=medirm(datain,tmax,win,v,static)');else disp('[dataout,medi_data]=medirm(datain,tmax,win,headwd)'); headwd=v;end %if%half of time window to which trim statics will be appliedthalf=0.015;nrec=datain.fh{12}; %number of recordsnpts=datain.fh{7}; %number of points per tracedata=datain;for COUNT=1:nrec %loop over records ntr=datain.th{COUNT}(12,1); %number of traces in this record data.dat{COUNT}=zeros(2.*npts,ntr); %zero pad data data.dat{COUNT}(npts+1:2.*npts,:)=datain.dat{COUNT};end %loop over recordsdata.fh{7}=2.*npts; %reset number of points per traceif tredway [data]=tred(data,-v,0); %flatten wave tw=static+datain.fh{10}; %add end time to account for zero paddingelse [data]=flat(data,0,headwd); %flatten by pick times tw=datain.fh{10};end %if/else[data]=ener(data,tw-thalf,tw+thalf); %energy balance wave[data]=trim(data,tw-thalf,tw+thalf,tmax); %trim statics[medi_data]=medi_filt(data,win); %median filterfor COUNT=1:nrec medi_data.dat{COUNT}(1:npts-50)=0; %mute filtered data before first breaksend %for[data]=subr(medi_data,data); %subtract filtered waveif tredway [data]=tred(data,v,0); %unflatten waveelse [data]=unflat(data,0,headwd); %unflatten by pick timesend %if/elsedataout=data;%remove zero paddingfor COUNT=1:nrec %loop over records dataout.dat{COUNT}=data.dat{COUNT}(npts+1:2.*npts,:); medi_data.dat{COUNT}=medi_data.dat{COUNT}(npts+1:2.*npts,:);end %loop over recordsdataout.fh{7}=npts; %reset number of points per tracemedi_data.fh{7}=npts; %reset number of points per trace

⌨️ 快捷键说明

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