base.py 文件源码

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

项目:kite 作者: pyrocko 项目源码 文件源码
def __init__(self, model, los_arrow=False):
        pg.PlotWidget.__init__(self)
        self.model = model
        self.draw_time = 0.
        self._data = None

        border_pen = pg.mkPen(255, 255, 255, 50)
        self.image = pg.ImageItem(
            None,
            autoDownsample=False,
            border=border_pen,
            useOpenGL=True)

        self.setAspectLocked(True)
        self.plotItem.getAxis('left').setZValue(100)
        self.plotItem.getAxis('bottom').setZValue(100)
        self.setLabels(
            bottom=('Easting', 'm'),
            left=('Northing', 'm'))

        self.hint = {
            'east': 0.,
            'north': 0.,
            'value': num.nan,
            'measure': self.component.title(),
            'vlength': '03',
            'precision': '3',
        }

        self.hint_text = pg.LabelItem(
            text='',
            justify='right', size='8pt',
            parent=self.plotItem)
        self.hint_text.anchor(
            itemPos=(1., 0.),
            parentPos=(1., 0.))
        self.hint_text.text_template =\
            '<span style="font-family: monospace; color: #fff;'\
            'background-color: #000;">'\
            'East {east:08.2f} m | North {north:08.2f} m | '\
            '{measure} {value:{length}.{precision}f}</span>'
        self.hint_text.setOpacity(.6)

        self.addItem(self.image)
        self.update()

        self.transFromFrame()
        self._move_sig = pg.SignalProxy(
            self.image.scene().sigMouseMoved,
            rateLimit=25, slot=self.mouseMoved)

        if los_arrow:
            self.addLOSArrow()

        # self.addIsocurve()
        # self.scalebar()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号