pybert.data package¶
Submodules¶
pybert.data.datascheme module¶
-
class
pybert.data.datascheme.
DataSchemeBase
(typ=0, name='unknown', prefix='uk')[source]¶ Bases:
object
Attributes: - closed : bool
Close the chain. Measure from the end of the array to the first electrode.
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation -
closed
¶
-
class
pybert.data.datascheme.
DataSchemeDipoleDipole
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Dipole-dipole data scheme.
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. createData
(kwargs)Create a Dipole-Dipole dataset. create createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemeHalfWenner
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Pole-Dipole like Wenner Beta with increasing dipole distance
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemeManager
[source]¶ Bases:
object
Methods
scheme
(name)Return DataScheme for a given name if registered. schemeFromPrefix
(prefix)Return DataScheme for a given prefix name. addScheme schemeFromTyp schemes
-
class
pybert.data.datascheme.
DataSchemeMultipleGradient
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
MultipleGradient (C—P-P–C) data scheme.
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemePoleDipole
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Pole-dipole data scheme
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemePolePole
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemeSchlumberger
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Wenner-Schlumberger (C–P-P–C) data scheme.
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemeWennerAlpha
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Wenner alpha (C–P–P–C) data scheme with equal distances.
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
DataSchemeWennerBeta
[source]¶ Bases:
pybert.data.datascheme.DataSchemeBase
Wenner-beta (C–C–P–P) data scheme with equal distance.
Attributes: - closed
Methods
addInverse
([addInverse])Add inverse value to create a full dataset. create createData createDatum_ createElectrodes setInverse setMaxSeparation
-
class
pybert.data.datascheme.
Pseudotype
[source]¶ Bases:
object
-
AB_M
= 3¶
-
AB_MN
= 2¶
-
AB_N
= 4¶
-
A_M
= 1¶
-
DipoleDipole
= 5¶
-
Gradient
= 9¶
-
HalfWenner
= 11¶
-
PoleDipole
= 10¶
-
PolePole
= 12¶
-
Schlumberger
= 6¶
-
Test
= 99¶
-
WennerAlpha
= 7¶
-
WennerBeta
= 8¶
-
unknown
= 0¶
-
-
pybert.data.datascheme.
createData
(elecs, schemeName='none', **kwargs)[source]¶ Utility one-liner to create a BERT datafile
Parameters: - elecs : int | list[pos] | array(x)
Number of electrodes or electrode positions or x-positions
- schemeName : str [‘none’]
Name of the configuration. If you provide an unknown scheme name, all known schemes [‘wa’, ‘wb’, ‘pp’, ‘pd’, ‘dd’, ‘slm’, ‘hw’, ‘gr’] listed.
- **kwargs :
Arguments that will be forwarded to the scheme generator.
- inverse : bool
- interchange AB MN with MN AB
- reciprocity : bool
- interchange AB MN with BA NM
- addInverse : bool
- add aditional inverse measurements
- spacing : float [1]
- electrode spacing in meters
- closed : bool
- Close the chain. Measure from the end of the array to the first electrode.
Returns: - data : DataContainerERT
Examples
>>> import matplotlib.pyplot as plt >>> import pybert as pb >>> >>> schms = ['wa', 'wb', 'pp', 'pd', 'dd', 'slm', 'hw', 'gr'] >>> fig, ax = plt.subplots(3,3) >>> >>> for i, schemeName in enumerate(schms): ... s = pb.createData(elecs=21, schemeName=schemeName) ... k = pb.geometricFactor(s) ... mg = pb.data.DataSchemeManager() ... longname = mg.scheme(schemeName).name ... pb.showData(s, vals=k, ax=ax[i/3, i%3], ... label='k ' + longname + ')-' + schemeName) >>> >>> plt.show()
pybert.data.dataview module¶
Visualize ERT data.
-
pybert.data.dataview.
annotateSeparationAxis
(ax, scheme, grid=False)[source]¶ Draw y-axes tick labels corresponding to the separation.
-
pybert.data.dataview.
createDataMatrix
(data, vals, scheme)[source]¶ Create a matrix that represents the ERT data.
-
pybert.data.dataview.
createDataPatches
(ax, data, scheme, **kwargs)[source]¶ Create patches for a pseudosection.
-
pybert.data.dataview.
createPseudoPosition
(data, scheme, scaleX=False)[source]¶ Create pseudo x position and separation for the dataset.
ScaleX: scales the x positions regarding the real electrode positions.
-
pybert.data.dataview.
drawData
(axes, data, vals, schemeName='A_M', patchView=False, colorBar=True, cMin=None, cMax=None, linear=False, label='', **kwargs)[source]¶ TODO DOCUMENTME.
-
pybert.data.dataview.
drawDataAsMarker
(ax, data, scheme, **kwargs)[source]¶ Draw pseudosection scheme for the data using marker only.
-
pybert.data.dataview.
drawDataAsMatrix
(ax, data, vals, scheme, mat=None, logScale=True, **kwargs)[source]¶ Draw data as matrix image in axes ax.
-
pybert.data.dataview.
drawDataAsPatches
(ax, data, vals, scheme, writeValues=False, logScale=True, **kwargs)[source]¶ Draw pseudosection as patch graphic.
-
pybert.data.dataview.
drawElectrodesAsMarker
(ax, data)[source]¶ Draw electrode marker, these marker are pickable.
-
pybert.data.dataview.
generateConfStr
(yy)[source]¶ Generate configuration string to characterize array.
-
pybert.data.dataview.
midconfERT
(data, ind=None, rnum=1, circular=False)[source]¶ Return the midpoint and configuration key for ERT data.
Return the midpoint and configuration key for ERT data.
Parameters: - data : pybert.DataContainerERT
data container with sensorPositions and a/b/m/n fields
- ind : []
Documentme
- rnum : []
Documentme
- circular : bool
Return midpoint in degree (rad) instead if meter.
Returns: - mid : np.array of float
representative midpoint (middle of MN, AM depending on array)
- conf : np.array of float
configuration/array key consisting of 1) array type (Wenner-alpha/beta, Schlumberger, PP, PD, DD, MG)
00000: pole-pole 10000: pole-dipole or dipole-pole 30000: Wenner-alpha 40000: Schlumberger or Gradient 50000: dipole-dipole or Wenner-beta
- potential dipole length (in electrode spacings)
- separation factor (current dipole length or (di)pole separation)
-
pybert.data.dataview.
plotERTData
(data, **kwargs)[source]¶ Plot ERT data as pseudosection matrix (position over separation).
Parameters: - data : pybert.DataContainerERT
data container with sensorPositions and a/b/m/n fields
- vals : iterable of data.size() [data(‘rhoa’)]
vector containing the vals to show
- ax : mpl.axis
axis to plot, if not given a new figure is created
- cMin/cMax : float
minimum/maximum color vals
- logScale : bool
logarithmic colour scale [min(A)>0]
- label : string
colorbar label
- **kwargs:
- dx : float
- x-width of individual rectangles
- ind : integer iterable or IVector
- indices to limit display
- var : int [0]
- historical plotting styles (1, 2)
- circular : bool
- Plot in polar coordinates when plotting via patchValMap
- Returns
- ——-
- ax:
The used Axes
- cbar:
The used Colorbar or None
-
pybert.data.dataview.
showData
(data, vals=None, **kwargs)[source]¶ Utility one-liner to show a BERT datafile.
Creates figure, axis and Show.
Parameters: - data : :bertapi:`BERT::DataContainerERT`
- **kwargs :
- axes : matplotlib.axes
- Axes to plot into. Default is None and a new figure and axes are created.
- vals : Array[nData]
- Values to be plotted. Default is data(‘rhoa’).
- schemeName : str
- Name for the scheme to be plotted with the old semiautomatic style. Default is ‘auto’ to draw the new plotting style.
- : *
- is forwarded to plotERTData (old style) or drawData (new style)