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

📄 pi_openfile.asv

📁 基于matlab的反演程序,用于地球物理勘探中射线追踪及偏移成像程序.
💻 ASV
📖 第 1 页 / 共 2 页
字号:
    hi=image(dist,t,seis(:,ix));
    h(5)=hi;
    set(gcf,'userdata',h);
    set(hi,'xdata',dist,'ydata',t);
    set(hvertscrol,'min',t(1),'max',t(end),'visible','off');
    set(hhorscrol,'min',dist(1),'max',dist(end),'visible','off');
    set(gcf,'currentaxes',hposax);
    hi2=image(dist,t,seis(:,ix));
    cdat=get(hi2,'cdata');
    cdat=cdat(1:6:size(cdat,1),1:6:size(cdat,2));
    set(hi2,'xdata',dist,'ydata',t,'cdata',cdat);
    set(hposax,'visible','on','xtick',[],'ytick',[]);
    title('Holding Line Data');
    set(get(hposax,'title'),'visible','off');
    % position lines
    col='r';
    lwid=.25;
    % bottom
    ln1=line([dist(1) dist(end)],[t(end) t(end)],'color',col,'linewidth',lwid,'visible','off',...
        'buttondownfcn',@PI_positionaxes_linebuttondown);
    % top
    ln2=line([dist(1) dist(end)],[t(1) t(1)],'color',col,'linewidth',lwid,'visible','off',...
        'buttondownfcn',@PI_positionaxes_linebuttondown);
    % Left Side
    ln3=line([dist(1) dist(1)],[t(1) t(end)],'color',col,'linewidth',lwid,'visible','off',...
        'buttondownfcn',@PI_positionaxes_linebuttondown);
    % Right Side
    ln4=line([dist(end) dist(end)],[t(1) t(end)],'color',col,'linewidth',lwid,'visible','off',...
        'buttondownfcn',@PI_positionaxes_linebuttondown);
    % patch
    pt1=patch([dist(1) dist(end) dist(end) dist(1)],[t(1) t(end) t(end) t(1)],col);
    set(pt1,'visible','off','buttondownfcn',@PI_positionaxes_linebuttondown,'facealpha',[.02],...
        'edgecolor','none');
    
    set(get(hposax,'title'),'userdata',[ln1 ln2 ln3 ln4 hi2 pt1]);
    set(gcf,'currentaxes',haxis);
    set(hposax,'tag','POSITIONAXES');
    set(haxis,'tag','MAINAXES');
    %#function autumn
    %#function bone
    %#function colorcube
    %#function cool
    %#function copper
    %#function flag
    %#function gray
    %#function hot 
    %#function hsv
    %#function jet 
    %#function lines
    %#function pink
    %#function prism
    %#function spring
    %#function summer
    %#function white
    %#function winter
    if(strcmp(COLOR_MAP,'seisclrs'))
        clrmap=seisclrs(NUMBER_OF_COLORS,GRAY_PCT);
        set(gcf,'colormap',clrmap);
    else
        colormap(COLOR_MAP);
    end
    presentpath=pwd;
    nkols=size(get(gcf,'colormap'),1);
    if(val{1}==4)
    else
        QuickMenu=findobj(gcf,'type','uimenu','tag','QUICK_OPENFILE');
        udat=get(QuickMenu,'userdata');
        CheckMenu=udat{3};
        HoldNames=get(CheckMenu,'label');
        set(CheckMenu(1),'label',filename,'visible','on');
        jj=1;
        ii=2;
        while jj<=3
            if(strcmp(HoldNames{jj},filename))
                jj=jj+1;
            else
                if(isempty(deblank(HoldNames{jj})))
                    vis='off';
                else
                    vis='on';
                end
                set(CheckMenu(ii),'label',HoldNames{jj},'visible',vis);
                jj=jj+1;
                ii=ii+1;
            end
        end  
        filenames=get(CheckMenu,'label');
        cd(originalpath)
        save('plotimagedata.mat','filenames');
        cd(lastpath)
    end
    h=get(gcf,'userdata');
    hi=h(5);
    set(gcf,'userdata',h);
    set(hscale,'userdata',[scaleopt mxs2 mns smean2 stddev2]);
    set(hmaster,'userdata',[mxs smean stddev],'value',[1],'backgroundcolor',[.8314 .8157 .7843]);
    set(hi,'userdata',{seis dist t {nkols COLOR_MAP} [scaleopt mxs2 mns smean2 stddev2] [mxs smean stddev]});
    plotimage('KillLimitLines(gcf)');
    h=get(gcf,'userdata');
    for ii=1:length(h)
        if(ishandle(h(ii))&ii~=5)
            set(h(ii),'enable','on');
        end
    end
    set(QuickMenu,'userdata',{[3] gcf quickhandles originalpath presentpath});
    if(XAXISTOP==1)
        xaxistop='top';
    else
        xaxistop='bottom';
    end
    set(gca,'xaxislocation',xaxistop);
    gtfigs=findobj(0,'type','figure','tag','PLOTIMAGEFIGURE');
    nm=1;
    xxnm=1;
    adon='';
    for ii=1:length(gtfigs)
        haxs=findobj(gtfigs(ii),'type','axes','tag','MAINAXES');
        ttl=get(haxs,'title');
        dat=get(ttl,'userdata');
        if(~isempty(dat))
            xfile=dat{1};
            xnm=dat{2};
            if(strcmp(xfile,file));
                nm=nm+1;
                if(xnm>=nm)
                    nm=xnm+1;
                end
                adon=['(' num2str(nm) ')'];
            end 
        end
    end
    title([file adon],'tag','PLOTIMAGE-TITLE','fontweight','bold',...
        'userdata',{file nm 'Seismic'},'interpreter','none');
    xlabel(xlbl,'horizontalalignment','right');
    ylabel(ylbl,'tag','PLOTIMAGE-YLABEL');
    newlocks=[];
    if(~isempty(ZOOM_LOCKS))
        for ii=1:size(ZOOM_LOCKS,1)
            CheckLock=ZOOM_LOCKS(ii,:);
            if(find(CheckLock==gcf))
                ZOOM_LOCKS(ii,:)=[];
                ii=ii-1;
            end
        end
    end
    hzoompick=h(9);
    set(hzoompick,'value',1);
    selboxinit('plotimage(''zoom'')',1);
%     set(gcf,'name','Seismic Image Plot, Simplezooming installed (Use MB1)');
    %     ms1=['data maximum: ' num2str(full(mxs))];
    % 	ms2=['data mean: ' num2str(full(smean))];
    % 	ms3=['data stddev: ' num2str(full(stddev))];
    % 	ms4=['number of gray levels ' int2str(number_of_colors)];
    % 	ms5=['Percentage of gray transition ' int2str(gray_pct)];
    %     ms5=[];
    %     ms6=[];
    %     msg=[];
    %     msg={ms1 ms2 ms3 ms4 ms5 ms6};
    save('plotimageproperties.mat','XAXISTOP','PICKCOLOR','NOBRIGHTEN','COLOR_MAP',...
        'GRAY_PCT','NUMBER_OF_COLORS','SCALE_OPT');
    %     msgbox(msg,'File Properties','help','modal');
    stringinfo=['"' file adon '" has been opened and plotted'];
    col=[1 1 1];
catch
    % going to remove file from Quick file menu if it is there
    QuickMenu=findobj(gcf,'type','uimenu','tag','QUICK_OPENFILE');
    udat=get(QuickMenu,'userdata');
    CheckMenu=udat{3};
    HoldNames=get(CheckMenu,'label');
    HoldNames{5}='';
    jj=1;
    ii=1;
    while jj<=4
        if(strcmp(HoldNames{ii},filename))
            if(isempty(HoldNames{ii+1}))
                vis='off';
            else
                vis='on';
            end
            set(CheckMenu(jj),'label',HoldNames{ii+1},'visible',vis);
            jj=jj+1;
            ii=ii+2;
        else
            if(isempty(HoldNames{ii}))
                vis='off';
            else
                vis='on';
            end
            set(CheckMenu(jj),'label',HoldNames{ii},'visible',vis);
            jj=jj+1;
            ii=ii+1;
        end
    end 
    filenames=get(CheckMenu,'label');
    save('plotimagedata.mat','filenames');
    errordlg('Data choosen not in proper format');
    stringinfo=['Error in data choosen, please inspect your data for anomalies'];
    col=[1 1 0];
end
set(hmsg,'string',stringinfo,'backgroundcolor',col);

% CHECKING DATA
%---------------
%
% This is pulling appart data
function DataOut=Check_Data(CheckData)
sampint={[] 'Unknown' 0};
dist=[];
nms=fieldnames(CheckData);
if(isempty(CheckData))
    dataout='No Data Found';
else
    stp=1;
    for ii=1:size(nms,1)
        cdat=getfield(CheckData,nms{ii});
        if(~isnumeric(cdat))
            DataOut='Some of data choosen is not numeric';
            stp=2;
        end
    end
end
if(stp==1) % keep going
    for ii=1:size(nms,1)
        cdat=getfield(CheckData,nms{ii});
        if(size(cdat,1)>=2&size(cdat,2)>=2)
            % choosing the first array that has bigger more then 2 rows and
            % colums as the main array
            dataout=cdat;
            kk=ii;
            break
        end
    end
    if(isnumeric(dataout))
        newdat=cell(size(nms,1)-1,1);
        jj=1;
        
        for ii=1:size(nms,1)
            cdat=getfield(CheckData,nms{ii});
            if(isempty(cdat))
                % in all truth, this could be a problem, but it is assumed
                % that if an array is empty, it will be ignored
            elseif(ii~=kk)
                newdat{jj}=cdat;
                jj=jj+1;
            end
        end
        if(isempty(newdat))
        elseif(size(newdat,1)==1)
            [rw cl]=size(newdat{1});
            dat=newdat{1};
            if(rw*cl==1)
                if(dat<=.05)
                    sampint={dat 'Seconds'};
                else
                    sampint={dat 'Meters'};
                end
            else 
                chdat=find([rw cl]~=1);
                if(length(chdat)>=2)
                    dataout='Sizes of data choosen do not match';
                else
                    if(size(dat,chdat)==size(dataout,1))
                        if((dat(2)-dat(1))<=.05)
                            sampint={dat 'Seconds'};
                        else
                            sampint={dat 'Meters'};
                        end
                    elseif(size(dat,chdat)==size(dataout,2))
                        dist=dat;
                    end
                    if(isempty(dist)&isempty(sampint{1}))
                        % back up incase something has gone wrong
                        dataout='Sizes of data choosen do not match';
                    end
                end
            end
        elseif(size(newdat,1)==2)
            for ii=1:2
                [rw cl]=size(newdat{ii});
                dat=newdat{ii};
                if(rw*cl==1&isempty(sampint{1}))
                    if(CheckData{jj(ii)}<=.05)
                        sampint={dat 'Seconds'};
                    else
                        sampint={dat 'Meters'};
                    end
                else 
                    checkingnum=[rw cl];
                    chdat=find([rw cl]~=1);
                    if(length(chdat)>=2)
                        dataout='Sizes of data choosen do not match';
                    else
                        if(size(dat,chdat)==size(dataout,1)&isempty(sampint{1}))
                            ndat=dat;
                            if((ndat(2)-ndat(1))<=.05)
                                sampint={ndat 'Seconds'};
                            else
                                sampint={ndat 'Meters'};
                            end
                        elseif(size(dat,chdat)==size(dataout,2)&isempty(dist))
                            dist=dat;
                        end
                    end
                end
            end
            if(isempty(dist)|isempty(sampint{1}))
                dataout='Sizes of data choosen do not match';
            end
        end
    end
end    
DataOut=cell(3,1);
DataOut{1}=dataout;
DataOut{2}=sampint;
DataOut{3}=dist; 

⌨️ 快捷键说明

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