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

📄 aspec.m,v

📁 具有特色的地震数据处理源码
💻 M,V
字号:
head	3.0;access;symbols;locks; strict;comment	@// @;3.0date	2000.06.13.19.17.48;	author gilles;	state Exp;branches;next	2.0;2.0date	99.05.21.18.40.42;	author mah;	state Exp;branches;next	1.4;1.4date	99.05.19.20.59.36;	author mah;	state Exp;branches;next	1.3;1.3date	99.01.15.15.23.14;	author perron;	state Exp;branches;next	1.2;1.2date	99.01.11.18.57.06;	author kay;	state Exp;branches;next	1.1;1.1date	99.01.06.19.06.59;	author kay;	state Exp;branches;next	;desc@@3.0log@Release 3@text@function aspec(action)%function aspec%%Interactive module for displaying amplitude and phase versus frequency.%%DSIsoft version 2.0%Customized VSP processing software%%written by G. Perron and K.S. Beaty January, 1998%$Id: aspec.m,v 2.0 1999/05/21 18:40:42 mah Exp gilles $%$Log: aspec.m,v $%Revision 2.0  1999/05/21 18:40:42  mah%Release 2%%Revision 1.4  1999/05/19 20:59:36  mah%version number%%Revision 1.3  1999/01/15 15:23:14  perron%Modified calls to seisplot to include new variable tstart%%Revision 1.2  1999/01/11 18:57:06  kay%Fixed typo in Id.%%Revision 1.1  1999/01/06 19:06:59  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.caif ~nargin aspecplot returnend %ifswitch actioncase 'getdataset' datasetname=get(gcbo,'String'); dataset=get(gcbo,'userdata'); set(findobj(gcbf,'Tag','EditRec1'),'String','1'); rec1=1; rec2=dataset.fh{12}; set(findobj(gcbf,'Tag','EditRec2'),'String',num2str(rec2)); tr1=1; set(findobj(gcbf,'Tag','EditTr1'),'String','1'); tr2=dataset.th{1}(12,1); set(findobj(gcbf,'Tag','EditTr2'),'String',num2str(tr2)); t1=dataset.fh{9}; set(findobj(gcbf,'Tag','EditT1'),'String',num2str(t1)); t2=dataset.fh{10}; set(findobj(gcbf,'Tag','EditT2'),'String',num2str(t2)); dir=1; set(findobj(gcbf,'Tag','EditDir'),'String','1'); f1=0; set(findobj(gcbf,'Tag','EditF1'),'String',num2str(f1)); f2=1/(2*dataset.fh{8}); %Nyquist frequency set(findobj(gcbf,'Tag','EditF2'),'String',num2str(f2));case 'plot' h=findobj(gcf,'tag','EditText1'); G=findobj('name','AspecPlot'); if isempty(G)  aspecp;  a.axseis=findobj(gcf,'Tag','AxesSeis');  a.axf=findobj(gcf,'Tag','Axes2');  a.axp=findobj(gcf,'Tag','Axes3'); else  figure(G)  a=get(G,'userdata'); end %if/else set(gcf,'Pointer','watch'); a.rec1=str2num(get(findobj(gcbf,'Tag','EditRec1'),'String')); a.rec2=str2num(get(findobj(gcbf,'Tag','EditRec2'),'String')); a.t1=str2num(get(findobj(gcbf,'Tag','EditT1'),'String')); a.t2=str2num(get(findobj(gcbf,'Tag','EditT2'),'String')); a.tr1=str2num(get(findobj(gcbf,'Tag','EditTr1'),'String')); a.tr2=str2num(get(findobj(gcbf,'Tag','EditTr2'),'String')); dir=str2num(get(findobj(gcbf,'Tag','EditDir'),'String')); if dir~=1  temp=a.tr1;  a.tr1=a.tr2;  a.tr2=temp; end %if a.f1=str2num(get(findobj(gcbf,'Tag','EditF1'),'String')); a.f2=str2num(get(findobj(gcbf,'Tag','EditF2'),'String')); datasetname=get(h,'string'); a.dataset=get(h,'userdata'); a.scfact=1.5; a.maxav=1; a.pltflg=0; a.rec=a.rec1; a.smp=a.dataset.fh{8};
 a.c='k'; set(gcf,'CurrentAxes',a.axseis); seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c,a.dataset.fh{9}); aspecomputem(a.dataset,a.tr1,a.tr2,a.t1,a.t2,a.rec,1); set(gcf,'Pointer','fullcross') set([a.axf;a.axp],'xlim',[a.f1 a.f2]) set(gcf,'userdata',a) set(findobj(gcf,'tag','StaticText1'),'string',['Now showing record: ',num2str(a.rec)]) set(findobj(gcf,'tag','TitleText'),'string',['Variable: ',datasetname],'fontsize',12) subplot(a.axp) b=axis; set(get(gca,'xlabel'),'userdata',b) subplot(a.axf) b=axis; set(get(gca,'xlabel'),'userdata',b)case 'quitall' close all;case 'skip' a=get(gcf,'userdata'); a.rec=str2num(get(gcbo,'String')); if a.rec<a.rec1 | a.rec>a.rec2  msgbox('Not a valid record number.','Warning','warn');  return end %if set(gcf,'userdata',a) subplot(a.axseis) seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c,a.dataset.fh{9}); hdd=findobj(gcbf, 'Tag', 'StaticText1'); set(hdd, 'String' ,['Now showing record: ',num2str(a.rec)]); aspecomputem(a.dataset,a.tr1,a.tr2,a.t1,a.t2,a.rec,1);case 'scale' a=get(gcf,'userdata'); a.scfact=str2num(get(gcbo,'String')); set(gcf,'userdata',a) subplot(a.axseis) seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c,a.dataset.fh{9});case 'zoom' zoom on set(gcf,'windowbuttonupfcn','aspec zoomoff')case 'zoomoff' ones; zoom off a=get(gcf,'userdata'); limx=get(gca,'xlim'); if gca==a.axp  ax=a.axf; elseif gca==a.axf  ax=a.axp; else  return end %if set(gcf,'currentaxes',ax)% zoom off ylim=get(ax,'ylim');% set(ax,'ylim',ylim) set(gcf,'windowbuttonupfcn','')case 'full' a=get(gcf,'userdata'); subplot(a.axseis) lim=[a.tr1-1 a.tr2+1 a.t1 a.t2]; axis(lim) subplot(a.axf) lim=get(get(gca,'xlabel'),'userdata'); axis(lim) subplot(a.axp) lim=get(get(gca,'xlabel'),'userdata'); axis(lim)case 'next' set(gcbf,'Pointer','watch'); a=get(gcf,'userdata'); if a.rec<a.rec2,  a.rec=a.rec+1;  set(gcf,'userdata',a);  subplot(a.axseis)  seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c,a.dataset.fh{9});  hdd=findobj(gcbf,'Tag','StaticText1');  set(hdd,'String',['Now showing record: ',num2str(a.rec)]);  aspecomputem(a.dataset,a.tr1,a.tr2,a.t1,a.t2,a.rec,1); else,  msgbox('You have reach the EOF','Warning','warn') end set(gcbf,'Pointer','fullcross');case 'previous'set(gcbf,'Pointer','watch'); a=get(gcf,'userdata'); if a.rec>a.rec1,  a.rec=a.rec-1;  set(gcf,'userdata',a);  subplot(a.axseis)  seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c,a.t1);  hdd=findobj(gcbf,'Tag','StaticText1');  set(hdd,'String',['Now showing record: ',num2str(a.rec)]);  aspecomputem(a.dataset,a.tr1,a.tr2,a.t1,a.t2,a.rec,1); else,  msgbox('You have reach the BOF','Warning','warn') end set(gcbf,'Pointer','fullcross');case 'polarity' a=get(gcf,'userdata'); set(gcf,'CurrentAxes',a.axseis); a.scfact=a.scfact*(-1); if a.scfact<0  a.c='b'; else  a.c='k'; end %if/else set(gcf,'userdata',a) seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c,a.dataset.fh{9});case 'quit' close(gcbf)case 'menu' figure(findobj('Name','Aspecplot Menu'))case 'crosshair' a=get(gcf,'userdata'); v=get(gcbo,'value'); if v==1  acrss2(a.axf,a.axp,'begin') else  acrss2(a.axf,a.axp,'done') end %if/elseend %switch@2.0log@Release 2@text@d11 1a11 1%$Id: aspec.m,v 1.4 1999/05/19 20:59:36 mah Exp mah $d13 3@1.4log@version number@text@d11 1a11 1%$Id: aspec.m,v 1.3 1999/01/15 15:23:14 perron Exp mah $d13 3@1.3log@Modified calls to seisplot to include new variable tstart@text@d6 1a6 1%DSIsoft version 1.0d11 1a11 1%$Id: aspec.m,v 1.2 1999/01/11 18:57:06 kay Exp perron $d13 3@1.2log@Fixed typo in Id.@text@d11 1a11 1%$Id: aspec.m,v 1.1 1999/01/06 19:06:59 kay Exp kay $d13 3d107 2a108 1 a.smp=a.dataset.fh{8};d110 1a110 1 seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact);a113 1 a.c='k';d136 1a136 1 seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c);d146 1a146 1 seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c);d189 1a189 1  seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c);d205 1a205 1  seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c);d224 1a224 1 seisplot(a.dataset.dat{a.rec},a.t1,a.t2,a.tr1,a.tr2,a.smp,a.maxav,a.pltflg,a.scfact,a.c);@1.1log@Initial revision@text@d11 4a14 2$Id:$$Log:$@

⌨️ 快捷键说明

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