Esempio n. 1
0
    def showCoverage(self, ax=None, name='coverage', **kwargs):
        """Show the ray coverage in log-scale."""
        if ax is None:
            fig, ax = plt.subplots()

        cov = self.rayCoverage()
        return pg.show(self.fop.paraDomain,
                       pg.log10(cov+min(cov[cov > 0])*.5), ax=ax,
                       coverage=self.standardizedCoverage(), **kwargs)
Esempio n. 2
0
    def showCoverage(self, ax=None, name='coverage'):
        """shows the ray coverage in logscale"""
        if ax is None:
            fig, ax = plt.subplots()
            self.figs[name] = fig

        self.axs[name] = ax
        cov = self.rayCoverage()
        pg.show(self.mesh, pg.log10(cov+min(cov[cov > 0])*.5), axes=ax,
                coverage=self.standardizedCoverage())
Esempio n. 3
0
    def showCoverage(self, ax=None, name='coverage', **kwargs):
        """shows the ray coverage in logscale"""
        if ax is None:
            fig, ax = plt.subplots()
            self.figs[name] = fig

        self.axs[name] = ax
        cov = self.rayCoverage()
        pg.show(self.mesh, pg.log10(cov+min(cov[cov > 0])*.5), ax=ax,
                coverage=self.standardizedCoverage(), **kwargs)
Esempio n. 4
0
def logDropTol( p, droptol = 1e-3 ):
    """"""
    tmp = pg.RVector( p );

    tmp = pg.abs( tmp / droptol )
    tmp.setVal( 1.0, pg.find( tmp < 1.0 ) )

    #for i, v in enumerate( tmp ):
        #tmp[ i ] = abs( tmp[ i ] / droptol );
        #if tmp[ i ] < 1.0: tmp[ i ] = 1.0;

    tmp = pg.log10( tmp );
    tmp *= pg.sign( p );
    return tmp;
Esempio n. 5
0
def logDropTol(p, droptol=1e-3):
    """
    Example
    -------
    >>> from pygimli.utils import logDropTol
    >>> x = logDropTol((-10,-1,0,1,100))
    >>> print(x.array())
    [-4. -3.  0.  3.  5.]
    """
    tmp = pg.RVector(p)

    tmp = pg.abs(tmp / droptol)
    tmp.setVal(1.0, pg.find(tmp < 1.0))

    tmp = pg.log10(tmp)
    tmp *= pg.sign(p)
    return tmp
Esempio n. 6
0
def logDropTol(p, droptol=1e-3):
    """Create logarithmic scaled copy of p.

    Examples
    --------
    >>> from pygimli.utils import logDropTol
    >>> x = logDropTol((-10, -1, 0, 1, 100))
    >>> print(x.array())
    [-4. -3.  0.  3.  5.]
    """
    tmp = pg.RVector(p)

    tmp = pg.abs(tmp / droptol)
    tmp.setVal(1.0, pg.find(tmp < 1.0))

    tmp = pg.log10(tmp)
    tmp *= pg.sign(p)
    return tmp
# %%
# as desired for a roughness operator. Therefore, an additional matrix called
# :py:func:`pg.matrix.GeostatisticalConstraintsMatrix`
# was implemented where this spur is corrected for.
# It is, like the correlation matrix, created by a mesh, a list of correlation
# lengths I, a dip angle# that distorts the x/y plane and a strike angle
# towards the third direction.
#
C = pg.matrix.GeostatisticConstraintsMatrix(mesh=mesh, I=5)

# %%
# In order to extract a certain column, we generate a vector with a single 1
vec = pg.Vector(mesh.cellCount())
vec[ind] = 1.0
pg.show(mesh, pg.log10(pg.abs(C * vec)), cMin=-6, cMax=0, cMap="magma_r")

# %%
# The constraints have a rather small footprint compared to the correlation
# (note the logarithmic scale) but still to the whole mesh unlike the classical
# constraint matrices that only include relations to neighboring cells.

# %%
# Such a matrix can also be defined for different ranges and a dip angle
Cdip = pg.matrix.GeostatisticConstraintsMatrix(mesh=mesh, I=[10, 3], dip=-25)
pg.show(mesh, pg.log10(pg.abs(Cdip * vec)), cMin=-6, cMax=0, cMap="magma_r")

# %%
# In order to illustrate the role of the constraints, we use a very simple
# mapping forward operator that retrieves the values in the mesh at some given
# positions. The constraints are therefore used as interpolation operators.
Esempio n. 8
0
# %%
# as desired for a roughness operator. Therefore, an additional matrix called
# :py:mod:`pg.matrix.GeostatisticalConstraintsMatrix`
# was implemented where this spur is corrected for.
# It is, like the correlation matrix, created by a mesh, a list of correlation
# lengths I, a dip angle# that distorts the x/y plane and a strike angle
# towards the third direction.
#
C = pg.matrix.GeostatisticConstraintsMatrix(mesh=mesh, I=5)

# %%
# In order to extract a certain column, we generate a vector with a single 1
vec = pg.Vector(mesh.cellCount())
vec[ind] = 1.0
ax, cb = pg.show(mesh,
                 pg.log10(pg.abs(C * vec)),
                 cMin=-6,
                 cMax=0,
                 cMap="magma_r")

# %%
# The constraints have a rather small footprint compared to the correlation
# (note the logarithmic scale) but still to the whole mesh unlike the classical
# constraint matrices that only include relations to neighboring cells.

# %%
# Such a matrix can also be defined for different ranges and dip angles, e.g.
Cdip = pg.matrix.GeostatisticConstraintsMatrix(mesh=mesh, I=[10, 3], dip=-25)
ax, cb = pg.show(mesh,
                 pg.log10(pg.abs(Cdip * vec)),
                 cMin=-6,