示例#1
0
    def showVA(self, ax=None, t=None, name='va', pseudosection=False,
               squeeze=True, full=True):
        """show apparent velocity as image plot

        TODO showXXX commands need to return axes and cbar .. if there is one

        """

        if ax is None:
            fig, ax = plt.subplots()
            self.figs[name] = fig

        self.axs[name] = ax
        if t is None:
            t = self.dataContainer('t')

        px = pg.x(self.dataContainer.sensorPositions())
        gx = np.array([px[int(g)] for g in self.dataContainer("g")])
        sx = np.array([px[int(s)] for s in self.dataContainer("s")])
        offset = self.getOffset(full=full)
        va = offset / t

        if pseudosection:
            midpoint = (gx + sx) / 2
            plotVecMatrix(midpoint, offset, va, squeeze=True, ax=ax,
                          label='Apparent slowness [s/m]')
        else:
            plotVecMatrix(gx, sx, va, squeeze=squeeze, ax=ax,
                          label='Apparent velocity [m/s]')
#        va = showVA(ax, self.dataContainer)
#        plt.show(block=False)
        return va
示例#2
0
    def showVA(self,
               ax=None,
               t=None,
               name='va',
               pseudosection=False,
               squeeze=True,
               full=True):
        """show apparent velocity as image plot

        TODO showXXX commands need to return ax and cbar .. if there is one

        """

        if ax is None:
            fig, ax = plt.subplots()
            self.figs[name] = fig

        self.axs[name] = ax
        if t is None:
            t = self.dataContainer('t')

        px = pg.x(self.dataContainer.sensorPositions())
        gx = np.array([px[int(g)] for g in self.dataContainer("g")])
        sx = np.array([px[int(s)] for s in self.dataContainer("s")])
        offset = self.getOffset(full=full)
        va = offset / t

        if pseudosection:
            midpoint = (gx + sx) / 2
            plotVecMatrix(midpoint,
                          offset,
                          va,
                          squeeze=True,
                          ax=ax,
                          label='Apparent slowness [s/m]')
        else:
            plotVecMatrix(gx,
                          sx,
                          va,
                          squeeze=squeeze,
                          ax=ax,
                          label='Apparent velocity [m/s]')


#        va = showVA(ax, self.dataContainer)
#        plt.show(block=False)
        return va
示例#3
0
    def showVA(self, t=None, ax=None, usepos=True, name='va', squeeze=True):
        """show apparent velocity as image plot"""
        # va = self.getVA(vals=vals)
        xvec = self.dataContainer('g')
        yvec = self.dataContainer('s')
        if usepos:
            pz = pg.y(self.dataContainer.sensorPositions())
            if squeeze:
                xvec = pz[xvec]
                yvec = pz[yvec]
            else:
                pz = pg.y(self.dataContainer.sensorPositions())
                raise Exception('Implement ME')
                # xvec = px[xvec]*1000 + pz[xvec]
                # xvec = px[yvec]*1000 + pz[yvec]

        plotVecMatrix(xvec, yvec, vals=t, squeeze=squeeze, ax=ax, name=name)
示例#4
0
    def showVA(self, t=None, ax=None, usepos=True, name='va', squeeze=True):
        """show apparent velocity as image plot"""
        # va = self.getVA(vals=vals)
        xvec = self.dataContainer('g')
        yvec = self.dataContainer('s')
        if usepos:
            pz = pg.y(self.dataContainer.sensorPositions())
            if squeeze:
                xvec = pz[xvec]
                yvec = pz[yvec]
            else:
                pz = pg.y(self.dataContainer.sensorPositions())
                raise Exception('Implement ME')
                # xvec = px[xvec]*1000 + pz[xvec]
                # xvec = px[yvec]*1000 + pz[yvec]

        plotVecMatrix(xvec, yvec, vals=t, squeeze=squeeze, ax=ax, name=name)