dtopotools_horiz_okada_and_1d.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:finite_volume_seismic_model 作者: cjvogl 项目源码 文件源码
def plot_okada(self, axes=None, dim=1, displacement='vertical', kwargs={}):
        if (self.dtopo is None):
        raise ValueError("Need to call create_dtopography before plot_okada")

        if (displacement is 'vertical'):
            if axes is None:
                from pylab import figure, subplot
                figure()
                axes = subplot(111)
            if (dim is 1):
                axes.plot(self.dtopo.x*LAT2METER,self.dtopo.dZ[0,0,:],**kwargs)
            elif (dim is 2):
                X,Y = numpy.meshgrid(self.dtopo.x,self.dtopo.y)
                axes.pcolormesh(X*LAT2METER,Y*LAT2METER,self.dtopo.dZ[0,:,:],**kwargs)
        elif (displacement is 'horizontal'):
            if axes is None:
                from pylab import figure, subplot
                figure()
                axes = subplot(111)
            if (dim is 1):
                axes.plot(self.dtopo.x*LAT2METER,self.dtopo.dY[0,0,:],**kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号