📄 pickfb.m,v
字号:
end %for%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'menu' H=findobj('Name','Picker Menu'); figure(H)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'pick' zoom off; set(gcf,'windowbuttondownfcn','picktimes3 down1;');%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'clear' global ptimes global temp peaks=find(ptimes(1,:)~=0); if ~isempty(peaks) delete(ptimes(2:4,peaks)) ptimes(:,:)=0; end %if a=ptimes(1,:); a(:)=NaN; for n=3:5 set(temp(n),'ydata',a) end %for set(gcf,'windowbuttondownfcn','')%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'kill' killint3 killbutton%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'flat' set(gcf,'windowbuttondownfcn','') global ptimes global temp data=get(gcf,'userdata'); axhand=data{5}; dataset=data{1}; npts=dataset.fh{7}; smp=dataset.fh{8}; tr1=str2num(get(findobj('tag','EditTr1'),'string')); buff=50; %buffer time (pts) ntr=length(ptimes); child=get(axhand,'children'); for n=1:3 L{n}=flipud(findobj(child{n},'type','line')); P{n}=flipud(findobj(child{n},'type','patch')); set(L{n}(1:ntr),'erasemode','normal') set(P{n}(1:ntr),'erasemode','normal') end %for tr=find(ptimes(1,:)~=0); if isempty(tr) msgbox('No picks to flatten.', 'Warning' ,'warn') return; end %if ydata=get(temp(3),'ydata'); if ptimes(1,tr(1))<0 %unflat set(findobj(gcf,'string','PICK'),'enable','on') %for pick,kill,clear,tune set(findobj(gcf,'string','TUNE'),'enable','on') set(findobj(gcf,'string','CLEAR'),'enable','on') set(findobj(gcf,'string','KILL'),'enable','on') set(findobj(gcf,'string','ROTATE'),'enable','on') set(findobj(gcf,'string','UNDO'),'enable','on') datamat=get(gcbo,'userdata'); for n=1:3 for i=tr set(L{n}(i),'xdata',datamat{n}.l{i}) set(P{n}(i),'xdata',datamat{n}.p{i}) if ptimes(n+1,i)~=0 ypeak=get(ptimes(n+1,i),'ydata'); ypeak=ypeak-(ptimes(1,i)+buff+1).*smp; set(ptimes(n+1,i),'ydata',ypeak) end %if end %for end %for ydata(tr)=ydata(tr)-(ptimes(1,tr)+buff+1).*smp; else %flat set(findobj(gcf,'string','PICK'),'enable','off') %for pick,kill,clear,tune set(findobj(gcf,'string','TUNE'),'enable','off') set(findobj(gcf,'string','CLEAR'),'enable','off') set(findobj(gcf,'string','KILL'),'enable','off') set(findobj(gcf,'string','ROTATE'),'enable','off') set(findobj(gcf,'string','UNDO'),'enable','off') for n=1:3 datamat{n}.l=get(L{n}(1:ntr),'xdata'); datamat{n}.p=get(P{n}(1:ntr),'xdata'); end %for set(gcbo,'userdata',datamat) newtr=datamat{1}.l{1}; row=length(newtr); newp=datamat{1}.p{1}; for n=1:3 for i=tr newtr(:)=i+tr1-1; newp(:)=i+tr1-1; xdtr=datamat{n}.l{i}; xdp=datamat{n}.p{i}; index=ptimes(1,i)-buff; newtr(1:row-index+1)=xdtr(index:row); newp(2:row-index+1)=xdp(index+1:row); set(L{n}(i),'xdata',newtr) set(P{n}(i),'xdata',newp) if ptimes(n+1,i)~=0 ypeak=get(ptimes(n+1,i),'ydata'); ypeak=ypeak-(index-1).*smp; set(ptimes(n+1,i),'ydata',ypeak) end %if end %for i end %for n ydata(tr)=ydata(tr)-(ptimes(1,tr)-buff-1).*smp; end %flat/unflat for n=3:5 set(temp(n),'ydata',ydata) end %for ptimes(1,:)=ptimes(1,:).*(-1); %multiply by -1 to mark whether flat or unflat%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'slider' zoom off xlim=get(gca,'xlim'); realxlim=get(get(gca,'ZLabel'),'UserData'); value=get(gcbo,'value'); dxreal=realxlim(2)-realxlim(1); dx=xlim(2)-xlim(1); newxlim=zeros(1,2); newxlim(1)=value*(dxreal-dx); newxlim(2)=newxlim(1)+dx; data=get(gcf,'userdata'); axhand=data{5}; set(axhand,'xlim',newxlim)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'rotate' global ptimes data=get(gcf,'userdata'); dataset=data{1}; tr=find(ptimes(1,:)~=0); trz=find(ptimes(1,:)==0);%if length(tr)<length(ptimes)% msgbox('Rotate option does not know how to deal with unpicked traces or dead traces yet','Warning','warn')% return;%end %if smp=dataset.fh{8}; headwd=str2num(get(findobj('tag','EditHead1'),'string')); t1=str2num(get(findobj('tag','EditT1'),'string')); tr1=str2num(get(findobj('tag','EditTr1'),'string')); dataset.th{1}(headwd,tr+tr1-1)=(ptimes(1,tr)-1).*smp+t1; dataset.th{1}(headwd,trz+tr1-1)=0; killflg=get(findobj('String','KILL'),'userdata'); bad=find(killflg{1}(1,:)~=0); dataset.th{1}(6,:)=0; dataset.th{1}(6,bad)=-1; maxav=data{2}; pltflg=data{3}; scfact=get(findobj(gcf,'tag','EditText1'),'string'); if isempty(scfact) scfact=1; else scfact=str2num(scfact); end %if/else radhand=flipud(findobj(gcf,'style','radiobutton')); val=zeros(1,3); for n=1:3 val(n)=get(radhand(n),'value'); end %for comp=find(val==1); if length(comp)~=2 msgbox('Must choose two components to do rotation.', 'Warning' ,'warn') return; end %if [dataset]=rot3c_eig(dataset,headwd,0.01,comp(1),comp(2)); c(1:3)='k'; c(comp)='b'; data{1}=dataset; set(gcf,'userdata',data) compplot(dataset,maxav,pltflg,scfact,c); picktimes3; killint3('firstcall',dataset.th{1});%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case 'radiobutton' radhand=flipud(findobj(gcf,'style','radiobutton')); val=get(gcbo,'value'); if val==1 n=find(radhand~=gcbo); m1=get(radhand(n(1)),'value'); m2=get(radhand(n(2)),'value'); if (m1+m2)==2 set(radhand(n(1)),'value',[0]); end %if end %ifend %switch%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [G]=compplot(dataset,maxav,pltflg,scfact,c) %c is colour if nargin==4 c(1:3)='k'; end %if [rec1,rec2,tr1,tr2,t1,t2,dir]=getstrings; G=findobj('Tag','pickfig'); data=get(G,'userdata'); axhand=data{5}; if isempty(G) pickplot; G=findobj('Tag','pickfig'); end figure(G) set(axhand,'nextplot','replace'); if dir~=1 %plot traces backwards by switching tr1 and tr2 values a=tr1; tr1=tr2; tr2=a; end %if subplot(axhand(1)) fact=seisplot(dataset.dat{1},t1,t2,tr1,tr2,dataset.fh{8},maxav,pltflg,scfact,c(1)); hold on title('Component 1','fontsize',12,'fontunits','points'); subplot(axhand(2)) scfact=1; seisplot(dataset.dat{2},t1,t2,tr1,tr2,dataset.fh{8},fact,pltflg,scfact,c(2)); hold on ylabel(''); title('Component 2','fontsize',12,'fontunits','points'); subplot(axhand(3)) seisplot(dataset.dat{3},t1,t2,tr1,tr2,dataset.fh{8},fact,pltflg,scfact,c(3)); hold on ylabel(''); title('Component 3','fontsize',12,'fontunits','points');%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [rec1,rec2,tr1,tr2,t1,t2,dir]=getstrings H=findobj('Name','Picker Menu'); handle=get(H,'userdata'); rec1=str2num(get(handle(1),'string')); rec2=str2num(get(handle(2),'string')); tr1=str2num(get(handle(3),'string')); tr2=str2num(get(handle(4),'string')); t1=str2num(get(handle(5),'string')); t2=str2num(get(handle(6),'string')); dir=str2num(get(handle(7),'string'));@2.0log@Release 2@text@d24 1a24 1%$Id: pickfb.m,v 1.1 1999/01/06 19:09:27 kay Exp mah $d26 3@1.1log@Initial revision@text@d24 4a27 2%$Id: $%$Log:$d29 1@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -