📄 pickfb.m,v
字号:
head 3.0;access;symbols;locks; strict;comment @// @;3.0date 2000.06.13.19.23.04; author gilles; state Exp;branches;next 2.0;2.0date 99.05.21.18.47.41; author mah; state Exp;branches;next 1.1;1.1date 99.01.06.19.09.27; author kay; state Exp;branches;next ;desc@@3.0log@Release 3@text@function pickfb(action)%pickfb%%To use this module type 'pickfb' and a menu will appear.%Graphic interface program for displaying 3 component data and picking interactively.%Allows 3 component picking, tuning, rotation on the fly, zooming, and killing of traces.%Flattening of traces is available for display only, as is rotation, but picking can%be done while components are rotated. Pick times will be stored in a header word of%the user's choice. Killed traces will be flagged in trace header word 6. Pack_good%must be used externally to remove or zero flagged traces. To work with single component%data, use 'pick1comp'.%%picking is done as follows:% first mouse button: clears a single trace pick% second mouse button: selects a single trace pick% third mouse button: starts dragging a line% followed by 1st or 3d button: erases picks on all selected traces% followed by 2nd button: picks times on all selected traces%%DSI customized processing software%written by K.S. Beaty February, 1998%$Id: pickfb.m,v 2.0 1999/05/21 18:47:41 mah Exp gilles $%$Log: pickfb.m,v $%Revision 2.0 1999/05/21 18:47:41 mah%Release 2%%Revision 1.1 1999/01/06 19:09:27 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 pickmenu; return;end %ifswitch action%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'getdataset' dataset=get(gcbo,'userdata'); H=findobj(gcbf,'Name','Picker Menu'); handle(1)=findobj(H,'Tag','EditRec1'); set(handle(1),'String','1'); handle(2)=findobj(H,'Tag','EditRec2'); rec2=dataset.fh{12}; set(handle(2),'String',num2str(rec2)); handle(3)=findobj(H,'Tag','EditTr1'); tr1=1; set(handle(3),'String','1'); handle(4)=findobj(H,'Tag','EditTr2'); tr2=dataset.th{1}(12,1); set(handle(4),'String',num2str(tr2)); handle(5)=findobj(H,'Tag','EditT1'); t1=dataset.fh{9}; set(handle(5),'String',num2str(t1)); handle(6)=findobj(H,'Tag','EditT2'); t2=dataset.fh{10}; set(handle(6),'String',num2str(t2)); handle(7)=findobj(H,'Tag','EditDir'); dir=1; set(handle(7),'String','1'); if rec2~=3 msgbox('This program only works with 3 component data. Use SORTREC to sort into 3 components or else use PICK1COMP to pick only one component.','Warning','warn') set(findobj(gcbf,'string','PLOT'),'enable','off') return else set(findobj(gcbf,'string','PLOT'),'enable','on') end %if/else set(H,'userdata',handle);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'plot' H=findobj('name','Picker Menu'); handle=findobj(H,'Tag','PopMaxAve'); maxav=abs(2-get(handle,'Value')); dataset=get(findobj(H,'Tag','EditText1'),'userdata'); value=get(findobj(H,'tag','PopupMenu1'),'value'); %indicates scale window=str2num(get(findobj(H,'Tag','EditWind'),'String')); t1=str2num(get(findobj(H,'tag','EditT1'),'string')); switch value case 2 dataset=agc(dataset,window,1); case 3 dataset=ener(dataset,t1,t1+window); end %switch pltflg=0; scfact=1; G=findobj('Tag','pickfig'); if isempty(G) pickplot; G=findobj('Tag','pickfig'); ax(1)=findobj(G,'Tag','Axes1'); ax(2)=findobj(G,'Tag','Axes2'); ax(3)=findobj(G,'Tag','Axes3'); else scfact=get(findobj(G,'tag','EditText1'),'userdata'); if isempty(scfact) scfact=1; end %if data=get(G,'userdata'); ax=data{5}; if get(gcbo,'string')=='UNDO' global ptimes tr=find(ptimes(1,:)~=0); if ~isempty(tr) headwd=str2num(get(findobj(H,'tag','EditHead1'),'string')); tr1=str2num(get(findobj(H,'tag','EditTr1'),'string')); ntr=length(ptimes); dataset.th{1}(headwd,tr1:tr1+ntr-1)=0; dataset.th{1}(headwd,tr+tr1-1)=(ptimes(1,tr)-1).*dataset.fh{8}+t1; end %if isempty end %if UNDO end %if/else set(G,'userdata',{dataset;maxav;pltflg;scfact;ax}); compplot(dataset,maxav,pltflg,scfact); datasetname=get(findobj(H,'Tag','EditText1'),'string'); set(findobj(G,'Tag','Supertitle'),'string',datasetname) picktimes3; killint3('firstcall',dataset.th{1});%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'quitall' handle=findobj('tag','pickfig'); if ~isempty(handle) pickfb quit close(handle) else close all end %if/else%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'quit' global ptimes global temp killflg=get(findobj('string','KILL'),'userdata'); bad=find(killflg{1}(1,:)~=0); ptimes(2,:)=0; if ~isempty(bad) ptimes(2,bad)=-1; end %if data=get(findobj('tag','pickfig'),'userdata'); dataset=data{1}; smp=dataset.fh{8}; t1=str2num(get(findobj('tag','EditT1'),'string')); tr1=str2num(get(findobj('tag','EditTr1'),'string')); tr2=str2num(get(findobj('tag','EditTr2'),'string')); headwd=str2num(get(findobj('tag','EditHead1'),'string')); temp=[headwd tr1 tr2]; tr=find(ptimes(1,:)~=0); if ~isempty(tr) ptimes(1,tr)=(ptimes(1,tr)-1)*smp+t1; end %if close(gcbf); pickquit; set(findobj(gcf,'style','edit'),'string',num2str(headwd))%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'tune' handle=findobj(gcbf,'Tag','PopTune'); option=get(handle,'Value'); %1 for peaks, 2 for troughs, 3 for zeros dir=str2num(get(findobj('tag','EditDir'),'string')); if dir~=1 if option==1 option=2; elseif option==2 option=1; end %if/elseif end %if tune3comp(option)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'zoom' zoom on%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'zoomall' limx=get(gca,'xlim'); limy=get(gca,'ylim'); G=findobj('Tag','pickfig'); data=get(G,'userdata'); axhand=data{5}; set(axhand,'xlim',limx) set(axhand,'ylim',limy) zoom off set(findobj(gcf,'style','slider'),'enable','on')%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'full' [rec1,rec2,tr1,tr2,t1,t2,dir]=getstrings; data=get(findobj('Tag','pickfig'),'userdata'); axhand=data{5}; set(axhand,'xlim',[tr1-1 tr2+1]) set(axhand,'ylim',[t1 t2]) set(findobj(gcf,'style','slider'),'enable','off')%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'scale' global ptimes G=findobj(gcbf,'Tag','pickfig'); data=get(G,'userdata'); scfact_old=data{4}; scfact=str2num(get(gcbo,'String')); data{4}=scfact; set(G,'userdata',data); axhand=data{5}; child=get(axhand,'children'); tr1=str2num(get(findobj('tag','EditTr1'),'String')); for n=1:length(child) L=flipud(findobj(child{n},'type','line')); P=flipud(findobj(child{n},'type','patch')); for i=1:length(ptimes) a=get(L(i),'xdata'); k=i+tr1-1; set(L(i),'xdata',(a-k).*scfact./scfact_old+k) a=get(P(i),'xdata'); set(P(i),'xdata',(a-k).*scfact./scfact_old+k) if ptimes(n+1,i)~=0 a=get(ptimes(n+1,i),'xdata'); set(ptimes(n+1,i),'xdata',(a-k).*scfact./scfact_old+k) end %if end %for
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -