示例#1
0
文件: gpr.py 项目: kmunve/processgpr
    def get_penetrationdepth(self, save=False):
        """
        Calculates the penetration depth for each trace.
        """
        self.info("Calculating the penetration depth along profile ...")
        zp = []
        for trace in range(self.traces):
            T = TRACE(self.data[:, trace], self.deltaT)
            T.get_penetrationdepth(self.r)
            zp.append(T.zp)

        self.zp = np.asarray(zp, np.float32)
        if save:
            if self.hascoords:
                np.savez('zp_' + self.filename, zp=self.zp,
                         x=self.coords.x, y=self.coords.y, z=self.coords.elev)
            else:
                np.savez('zp_' + self.filename, zp=self.zp)
        self.done()
示例#2
0
文件: gpr.py 项目: kmunve/processgpr
    def get_phasecenter(self, amp_threshold=1.0, freq_range=[500, 3000],
                        stacked=1, save=False, view=False):
        '''
        Calculates the phase center along the profile.
        The phase center is -delta_phi/(2 delta_k) 
        delta_k = delta_f * c0 / (2pi)
        The factor 2 in front of delta_k is due to the measuring geometry - the wave travels the distance twice 
        '''
        self.info("Calculating the phase center for each trace ...")
        self.phasecenter = np.zeros((self.traces,))
        for n in range(self.traces):
            trace = TRACE(self.data[:, n], self.deltaT, Nfft=2 ** 15)
            trace.get_phasecenter(amp_threshold, freq_range, self.cmed)
            self.phasecenter[n] = trace.zphi
            if self.hascoords:
                scoords = self.coords
        if stacked > 1:
            from processgpr.util.congrid import congrid

            newlength = int(self.phasecenter.shape[0] / stacked)
            self.phasecenter = congrid(self.phasecenter, (newlength,))
            scoords = self.coords
            scoords.stackCoords(newlength)

        if save:
            if self.hascoords:
                np.savez('zphi_coords_' + self.filename, zphi=self.phasecenter,
                         x=scoords.x, y=scoords.y, z=scoords.elev)
            else:
                np.savez('zphi_' + self.filename, zphi=self.phasecenter)

        if view:
            from pylab import show, plot

            plot(self.phasecenter)
            show()

        self.done()