API
TIE_load
General functions/methods that allow you to load the data and extract the traces in a way needed to perform a TIE-analysis.
- TIE.TIE_load.adaptSHAPE2DEM(shapefile, DEM)[source]
Adapt a shapefile’s extent to match the extent given by a DEM.
- Parameters:
shapefile (geopandas.GeoDataFrame) – Geopandas shapefile object.
DEM (dict) – Dictionary containing DEM and coordinate data obtained with TIE_load.cropDEMextent.
- Returns:
Clipped shapefile.
- Return type:
geopandas.GeoDataFrame
Notes
- The DEM parameter should be a dictionary with the following keys:
‘meta’: Metadata of the DEM.
‘z’: DEM data.
- TIE.TIE_load.createExtentPLG(x, y, crs_shp)[source]
Creates Extent Polygon.
Creates a georeferenced polygon (geopandas) covering the extent defined with x- and y-coordinates.
- Parameters:
x (list of float) – X-coordinates of the wanted polygon.
y (list of float) – Y-coordinates of the wanted polygon.
crs_shp (geopandas.crs.CRS) – Coordinate system of the shape (geopandas object).
- Returns:
Geopandas object (shapefile) with the polygon extent.
- Return type:
geopandas.geodataframe.GeoDataFrame
- TIE.TIE_load.cropDEMextent(geotif, shapefile)[source]
Crop DEM with Shapefile.
Crops the DEM extent according to a PLG shapefile (often an extent shapefile).
- Parameters:
geotif (rasterio.io.DatasetReader) – Handle to an opened geotif (rasterio).
shapefile (gpd.GeoDataFrame) – Handle to an opened shapefile (geopandas object).
- Returns:
Dictionary containing coordinate data. - ‘z’: Numpy array representing the cropped DEM. - ‘x’: Numpy array representing the x-coordinates. - ‘y’: Numpy array representing the y-coordinates. - ‘meta’: Metadata for the cropped DEM.
- Return type:
dict
- TIE.TIE_load.extractTraces(TRmatrix, shape)[source]
Extract Traces as Trace Objects.
Extracts individual, sorted traces (as a trace_OBJ) based on a trace matrix.
- Parameters:
TRmatrix (numpy.ndarray) – Matrix containing the traces (binary image), in the form of its trace matrix.
shape (str) – ‘L’ for polylines (e.g., faults), ‘PLG’ for traces extracted from polygons (e.g., bedrock interface traces).
- Returns:
List of trace objects (trace_OBJ) defined in TIE_classes.
- Return type:
list
- TIE.TIE_load.findNeighType(TRACES, BEDrst)[source]
Extracts the TWO bedrock types stored in BEDrst, which form a bedrock interface trace.
- Parameters:
TRACES (List[TIEclass.trace_OBJ]) – List of trace_OBJ storing trace information of bedrock interface traces.
BEDrst (numpy.ndarray) – Bedrock matrix (rasterized version of bedrock shapefile).
- Returns:
List of trace_OBJ with added SECOND bedrock type defining a boundary type.
- Return type:
List[TIEclass.trace_OBJ]
- TIE.TIE_load.identifyTRACE(BEDrst, FAULTS)[source]
Identifies traces in a bedrock matrix based on the bedrock distinction and the fault traces.
- Parameters:
BEDrst (numpy.ndarray) – Matrix with Bedrock data (see loadBedrock and rasterizeBedrock).
FAULTS (List[TIEclass.trace_OBJ]) – List of trace_OBJ containing FAULT information.
- Returns:
Matrix (same size as BEDrst) with trace information.
- Return type:
numpy.ndarray
- TIE.TIE_load.loadGeocover(sheet, geoc_path, language='de')[source]
Loads Geocover Data (all geology data) according to the Geocover structure.
- Parameters:
sheet (int) – Identification number of LK sheet (Landeskarte 1.25’000).
geoc_path (str) – Path to Geocover folder.
language (str, optional) – Language for the version (“de” for German, “fr” for French), default is “de”.
- Returns:
Geopandas handles to shapefiles of Bedrock_PLG.shp, Tectonic_Boundaries_L.shp, and Planar_Structures_PT.shp.
- Return type:
Tuple[geopandas.GeoDataFrame, geopandas.GeoDataFrame, geopandas.GeoDataFrame]
- TIE.TIE_load.loadLKdem(sheet, path_alti3D_folder)[source]
Loads DEM (swissALTI3D), gluing the different patches together.
- Parameters:
sheet (int) – Identification number of LK sheet (Landeskarte 1:25’000).
path_alti3D_folder (str) – Path to swissALTI3D folder.
- Returns:
Rasterio handle to DEM of the whole LK sheet (Landeskarte 1:25’000), or None if loading fails.
- Return type:
Union[rasterio.DatasetReader, None]
- TIE.TIE_load.rasterizeSHP(shp, attribute, DEM)[source]
Rasterizes Shapefile.
Rasterizes a shapefile according to a specific attribute field value.
- Parameters:
shp (geopandas.geodataframe.GeoDataFrame) – Opened geopandas handle to a shapefile.
attribute (str) – Attribute in shapefile that will be used to distinguish between different types of tectonic boundaries or litho-stratigraphic units. The attribute value must be a number.
DEM (dict) – Dictionary containing coordinates (x, y, and z) of the analyzed zone (see crop2DEMextent).
- Returns:
Raster matrix.
- Return type:
numpy.ndarray
TIE_general
Created on Mon Feb 15 16:07:59 2021 @author: Anna Rauch
This script contains a set of general functions/methods usually related to linear algebra and connectivty issues. These functions are independent from the TIE-method, yet are used by it.
- TIE.TIE_general.Mbox(title, text, style)[source]
Creates a message box.
- Parameters:
title (str) – Title/name of the box.
text (str) – Message text.
style (int) – Style of text (bold, fontsize, …).
- Returns:
Message box appears.
- Return type:
None
- TIE.TIE_general.angle2normal(azim, dip)[source]
Calculate the normal vector of a plane (or set of planes) defined with orientational angles in degrees.
- Parameters:
azim (float or array_like) – Angles of azimuth (dip azimuth) in degrees.
dip (float or array_like) – Dip angles of the plane(s) in degrees.
- Returns:
Normal vector of the plane(s) in the form [normalx, normaly, normalz].
- Return type:
numpy.ndarray
- TIE.TIE_general.angle2vect(trend, plunge)[source]
Calculate the directional vector (length = 1) from a line defined by angles - trend and plunge.
- Parameters:
trend (float or array_like) – Angles of trend (plunge azimuth) in degrees.
plunge (float or array_like) – Plunge angles of the directional vector in degrees.
- Returns:
Coordinates of the oriented vector in the form (vx, vy, vz).
- Return type:
tuple of numpy.ndarray
- TIE.TIE_general.angleBtwVec(v1, v2)[source]
Calculate the small angle between two directional oriented vectors.
- Parameters:
v1 (array_like) – First vector in the form (x, y, z).
v2 (array_like) – Second vector in the form (x, y, z).
- Returns:
Angle between the two vectors in degrees.
- Return type:
float
- TIE.TIE_general.azimRot(dip, trend, plunge)[source]
Azimuth according to rotation axis and dip.
Calculates the azimuth of a plane with a certain dip that goes through a rotation axis defined with trend and plunge angles.
- Parameters:
dip (float) – Angles of plane dip (angles in degrees).
trend (float) – Angles of trend (plunge azimuth) of the rotational axis.
plunge (float) – Plunge of the rotational axis (angles in degrees).
- Returns:
Angles of plane dip azimuths (angles in degrees) that pass through the axis.
- Return type:
float
- TIE.TIE_general.dipRot(azim, trend, plunge)[source]
Dip According To Rotation Axis And Azimuth.
Calculates the dip of a plane with a certain dip azimuth that passes through a rotation axis defined with trend and plunge angles.
- Parameters:
azim (float) – Angles of plane dip azimuth (angles in degrees) (no strike).
trend (float) – Angles of trend (plunge azimuth) of the rotational axis.
plunge (float) – Plunge of the rotational axis (angles in degrees).
- Returns:
Angles of plane dips (angles in degrees) that pass through the axis.
- Return type:
float
- TIE.TIE_general.distance(P1, P2)[source]
Calculate the shortest distance between two points in space.
- Parameters:
P1 (list) – Coordinates of the first point [x, y, z].
P2 (list) – Coordinates of the second point [x, y, z].
- Returns:
Distance between two points.
- Return type:
float
- TIE.TIE_general.greatCircle(azim, dip)[source]
Extract coordinates of the great circle of a given plane orientation.
- Parameters:
azim (float) – Angle of azimuth (dip azimuth) of the plane.
dip (float) – Dip angle of the plane.
- Returns:
Coordinates of great circle points [x_stereo, y_stereo].
- Return type:
list
- TIE.TIE_general.neighborPoints(j, rows, columns, connectivity)[source]
Define array containing all neighbor indexes of a certain point in a matrix.
- Parameters:
j (int) – Index in the matrix of the point being analyzed (flattened matrix).
rows (int) – Number of rows in the matrix.
columns (int) – Number of columns in the matrix.
connectivity (str) – Type of neighbor connectivity (8-connectivity or 4-connectivity).
- Returns:
Array with indexes of neighbors.
- Return type:
numpy.ndarray
- TIE.TIE_general.neighborPointsD(j, rows, columns, dp)[source]
- Define array containing the indexes surrounding the index j at a given
distance dp in a matrix [rows,columns] (8-connectivity).
- Parameters:
rows (int) – Number of rows in the matrix.
columns (int) – Number of columns in the matrix.
j (int) – Index in matrix of the point being analyzed (flattened matrix).
dp (int) – Pixel number at the wanted distance (1 being the closest neighbor possible).
- Returns:
Array with indexes of neighbors.
- Return type:
numpy.ndarray
- TIE.TIE_general.nmbNeighbors(binaryimage)[source]
- Extract a matrix (of size of the binary image) that contains the
number of positive neighbors for each pixel of the binary image.
- Parameters:
binaryimage (numpy.ndarray) – Matrix of zeros and ones (or TRUE’s and FALSE’s).
- Returns:
Matrix with the number of positive neighbors.
- Return type:
numpy.ndarray
- TIE.TIE_general.normal2angle(normal)[source]
Calculates the orientation (in dip azimuth and dip) of the plane according to its normal (in x, y, z).
- Parameters:
normal (numpy.ndarray) – Normal vector: n = [x, y, z].
- Returns:
Azimuth (dip azimuth) and dip of the plane expressed in angles.
- Return type:
Tuple[float, float]
- TIE.TIE_general.plungeRot(azim, dip, trend)[source]
Calculates the plunge of an axis with a given trend and through which a plane with a given orientation goes through.
- Parameters:
azim (float) – Angles of plane orientation (angles degree °).
dip (float) – Angles of plane dip (angles degree °).
trend (float) – Angles of trend (plunge azimuth) (angles degree °).
- Returns:
Angles of axis plunge (angles degree °) that hosts the given plane.
- Return type:
float
- TIE.TIE_general.sortLine(ind, matSize)[source]
Sorts a vector of points to connect them into a line and attribute an order (2D only).
- Parameters:
ind (array_like) – Indexes of points in a matrix.
matSize (tuple) – Size/shape of matrix.
- Returns:
newi – Newly sorted/ordered indexes.
- Return type:
ndarray
- TIE.TIE_general.stereoLine(trend, plunge)[source]
Extracts coordinates of a projected line on a stereonet.
- Parameters:
trend (float) – Angle of trend (plunge azimuth) of the line.
plunge (float) – Plunge of the line.
- Returns:
[x_stereo, y_stereo] – Coordinates of point(s) in a stereonet.
- Return type:
list
TIE_Visual
Created on Wed Mar 31 12:20:00 2021 @author: Anna Rauch
This script contains a set of functions/methods that are useful to display and visualize the TIE-results.
- TIE.TIE_visual.bed2cmap(BEDrst, legendfile, leg_labels=False)[source]
Color Information For Bedrock.
Transforms the raw-bedrock raster in a scalar matrix and extracts based on a prepared textfile the color (rgb-values) of the litho-stratigraphic units present and re-structures it in a cmap-matrix. If the legendfile contains label information, you can also extract the legend string values.
- Parameters:
BEDrst (numpy.ndarray) – Bedrock raster matrix.
legendfile (str) – Tab-separated textfile [bedrock_ID, R, G, B, label].
leg_labels (bool, optional) – Boolean indicating whether to extract labels (e.g., ‘Schrattenkalk’) or not. Default is False.
- Returns:
- cmnumpy.ndarray
Scalar matrix.
- cmapnumpy.ndarray
Colormap for bedrock information.
- formationslist
List of labels for legend. If leg_labels==False, then formations corresponds to the original Bedrock ID.
- Return type:
tuple
- TIE.TIE_visual.colorClassID(segment_OBJ)[source]
Color Information Trace Classification.
Extracts color code for TIE-classification.
- Parameters:
segment_OBJ (TIEclass.segment_OBJ) – Segment object.
- Returns:
Normalized RGB-value corresponding to TIE-class.
- Return type:
list
- TIE.TIE_visual.createCmap(rgbv, n)[source]
Create Cmap.
Creates a continuous color range (n values) from one rgb value (rgbv) to the other(s).
- Parameters:
rgbv (numpy.ndarray) – Vector containing rgb-values of endmembers.
n (int) – Resolution of cmap (number of values in cmap).
- Returns:
Newly created cmap.
- Return type:
numpy.ndarray
- TIE.TIE_visual.showOrientBars(traces, vx, vy, vz, stereo=False)[source]
Show orientation bars along traces in 3D or stereo.
- Parameters:
traces (list of trace_OBJ (TIE_classes.trace_OBJ)) – List of trace objects.
vx (numpy.ndarray) – Flattened x-, y-, and z-coordinate matrices.
vy (numpy.ndarray) – Flattened x-, y-, and z-coordinate matrices.
vz (numpy.ndarray) – Flattened x-, y-, and z-coordinate matrices.
stereo (bool, optional) – Boolean indicating whether to display the bars in stereo. If True, the bar length is stereographically projected on the map. Default is False.
- Returns:
bar – Handle to the plot.
- Return type:
mayavi.modules.surface.Surface
- TIE.TIE_visual.showOverview3D(mx, my, mz, mc, cmap=[], BTraces=[], FTraces=[], ATraces=[], WithlabelsB=True, WithlabelsF=True, WithlabelsA=True, Textsize=30)[source]
Show Geological Map In 3d (No Tie)
Displays the geological map in 3D, as well as the different trace sets and their ID (yet, no TIE classification).
- Parameters:
mx (array-like) – Coordinate matrices of the analyzed extent.
my (array-like) – Coordinate matrices of the analyzed extent.
mz (array-like) – Coordinate matrices of the analyzed extent.
mc (array-like) – Scalar field of bedrock id’s.
cmap (list, optional) – Bedrock colormap. Default is Mayavi’s default cmap.
BTraces (list, optional) – List of trace_OBJ of bedrock interface traces. Default is an empty list.
FTraces (list, optional) – List of trace_OBJ of faults (tectonic boundaries). Default is an empty list.
ATraces (list, optional) – List of trace_OBJ of axial traces. Default is an empty list.
Textsize (int, optional) – Text size of trace labels. Default is 30.
WithlabelsB (bool, optional) – Boolean indicating whether to add trace ID on the figure for bedrock traces. Default is True.
WithlabelsF (bool, optional) – Boolean indicating whether to add trace ID on the figure for fault traces. Default is True.
WithlabelsA (bool, optional) – Boolean indicating whether to add trace ID on the figure for axial traces. Default is True.
- Returns:
fig – Handle to the figure.
- Return type:
mayavi.mlab.Figure
- TIE.TIE_visual.showOverviewMap(mx, my, mc, cmap=[], mz=[], BTraces=[], FTraces=[], ATraces=[], leg_labels=[], WithSeg=True)[source]
Show Geological Map In 2d As An Overview
Displays the geological map in 2D (with legend), as well as different trace sets and their ID (yet, no TIE classification).
- Parameters:
mx (array-like) – Coordinate matrices of the analyzed extent.
my (array-like) – Coordinate matrices of the analyzed extent.
mz (array-like) – Coordinate matrices of the analyzed extent.
mc (array-like) – Scalar field of bedrock id’s.
cmap (list, optional) – Bedrock colormap. Default is Matplotlib’s default cmap.
BTraces (list, optional) – List of trace_OBJ of bedrock interface traces. Default is an empty list.
FTraces (list, optional) – List of trace_OBJ of faults (tectonic boundaries). Default is an empty list.
ATraces (list, optional) – List of trace_OBJ of axial traces. Default is an empty list.
leg_labels (list, optional) – List of labels for bedrock units. Default is an empty list.
WithSeg (bool, optional) – Boolean - show segmentation. Default is True.
- Returns:
fig (matplotlib.figure.Figure) – Handle to the figure.
ax (matplotlib.axes._axes.Axes) – Handle to the axes.
- TIE.TIE_visual.showSigStereo(trace_OBJ)[source]
Show Trace Signals As Stereographic Projection
Displays the evolution of the chords (1st subplot) and chord planes (2nd plot) of a specific trace by means of a stereographic projection.
- Parameters:
trace_OBJ (trace object (TIE_classes.trace_OBJ)) – The trace object for which signals are to be displayed.
- Returns:
fig – Handle to the figure.
- Return type:
matplotlib.figure.Figure
- TIE.TIE_visual.showSignal(trace_OBJ)[source]
Show Trace Signals
Displays signals of a specific trace. First subplot: major signals - alpha (normal and reverse) and beta (normal and reverse) and their signal heights. Second subplot: signal of the orthogonal distance between chords forming a chord plane (normalized to the total length of the trace).
- Parameters:
trace_OBJ (trace object (TIE_classes.trace_OBJ)) – The trace object for which signals are to be displayed.
- Returns:
fig – Handle to the figure.
- Return type:
matplotlib.figure.Figure
- TIE.TIE_visual.showTIEmap(mx, my, mz, mc=[], cmap='', MainTrace_Set=[], AuxTrace_Set=[], ShowBars=True)[source]
Show Tie-Results In 3d.
Displays the TIE-results in 3D on top of the slightly transparent geological map. TIE-results: (1) trace segments are colored according to TIE-class, (2) orientation bars indicate chord plane orientations along the trace.
- Parameters:
mx (numpy.ndarray) – Coordinate matrixes of analyzed extent.
my (numpy.ndarray) – Coordinate matrixes of analyzed extent.
mz (numpy.ndarray) – Coordinate matrixes of analyzed extent.
mc (list, optional) – Scalar field of bedrock id’s.
cmap (str, optional) – Bedrock colormap. Default is mayavi’s default cmap.
MainTrace_Set (list, optional) – List of tie-analyzed trace objects.
AuxTrace_Set (list, optional) – List of auxiliary trace objects that are to be neutrally displayed (e.g., fault traces).
ShowBars (bool, optional) – Boolean indicating whether to show orientation bars or not. Default is True.
- Returns:
Handle to the figure.
- Return type:
mayavi.modules.figure.Figure
- TIE.TIE_visual.sigHdiagram(trace_set, pth=[3, 9, 18, 90], txt=True, scale='lin')[source]
Show Signal Height Diagram.
Displays a scatter plot with the signal height h_alpha as a function of the signal height h_beta for each trace in a trace set. The classification boundaries (pth) are displayed as background information. The dots are colored according to their TIE-classification.
- Parameters:
trace_set (list of trace_OBJ (TIE_classes.trace_OBJ)) – List of trace objects.
pth (list of int, optional) – Planarity threshold used to classify the traces. Default is [3, 9, 18, 90].
txt (bool, optional) – Boolean indicating whether to display the trace’s id or not. Default is True.
scale (str, optional) – Scale for displaying the SH-diagram. “log” for logarithmic scale, “lin” for linear scale. Default is “lin”.
- Returns:
fig – Handle to the figure.
- Return type:
matplotlib.figure.Figure
- TIE.TIE_visual.stereoPlot(ax, WithCircles='no')[source]
Stereoplot.
Displays a stereonet (“Wulff - preservation of angles”).
- Parameters:
ax (matplotlib.axes.Axes) – Handle to the axes in which the stereonet should be displayed.
with_circles (bool, optional) – Boolean indicating whether to show the great circles or only show major axes. Default is False.
- Returns:
ax – Handle to the axes.
- Return type:
matplotlib.axes.Axes
TIE_Core
Created on Fri Apr 23 09:19:29 2021 @author: Anna Rauch
This script contains a set of general functions/methods that perform the core-steps of the TIE-method (i.e. the actual TIE-steps)
- TIE.TIE_core.changeTHseg(TRACES, X, Y, Z, n, amp=-10, newTH=None)[source]
Change Threshold For Segmentation.
Changes the threshold that defines the convexity size to segment the traces for a specific trace n and performs the TIE on new segmentation.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
X (array_like) – Coordinate vectors.
Y (array_like) – Coordinate vectors.
Z (array_like) – Coordinate vectors.
n (int) – Trace ID of the trace that is going to be analyzed with changed threshold.
amp (float, optional) – Amplitude expressed in % by which the defined threshold should be lowered (negative) or increased (positive). Default is -10.
newTH (list or None, optional) – Newly defined convexity size threshold [peak prominence, peak width]. If newTH is defined, the amplitude is ignored. Default is None.
- Returns:
TRACES – List with adapted segmentation for the specific trace object.
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.classifyTRACE(TRACES, pth=None)[source]
Classify traces based on TIE parameters.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects to be classified.
pth (list of float or None, optional) – Planarity thresholds for classification. If None, default thresholds [3, 9, 18] will be used. Must be of size 3.
- Returns:
The input list of trace objects with added classification parameters.
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.clearTIE(TRACES, n=None)[source]
Clear TIE information from trace objects.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
n (list or None, optional) – List of trace IDs (integers) that designate the traces to be cleared. If n is None (default), all traces will be cleared.
- Returns:
TRACES – List with suppressed TIE information.
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.extractAlpha(TRACES)[source]
Extracts alpha signal from traces.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
- Returns:
TRACES – List with added alpha values for each trace object (respectively each chord object).
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.extractBeta(TRACES)[source]
Extracts beta signal from traces.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
- Returns:
TRACES – List with added beta values for each trace object (respectively each chordPlane object).
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.extractChdPlanes(TRACES, mX, mY, mZ)[source]
Extracts chord planes from traces.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
mX (array-like) – Matrices of coordinates of the analyzed extent.
mY (array-like) – Matrices of coordinates of the analyzed extent.
mZ (array-like) – Matrices of coordinates of the analyzed extent.
- Returns:
TRACES – List with added list of chord plane objects (TIE_classes.chordPlane_OBJ) to each trace object (respectively each segment object).
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.extractChords(TRACES, mX, mY, mZ)[source]
Extracts connecting chords of a trace set (1st step of TIE).
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
mX (array-like) – Matrices of coordinates of the analyzed extent.
mY (array-like) – Matrices of coordinates of the analyzed extent.
mZ (array-like) – Matrices of coordinates of the analyzed extent.
- Returns:
TRACES – List with added list of chords (TIE_classes.chords_OBJ) to each trace object (respectively each segment object).
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.extractOrientBars(TRACES)[source]
Extraction of orientation bars (TIE).
Extracts orientation bars from chord planes. Chord plane values are distributed along the trace.
- Parameters:
TRACES (list of trace_OBJ) – List of trace objects containing basic TRACE information (any TRACE set, could also be FAULTS).
- Returns:
TRACES – List with added orientation bar values to each trace object.
- Return type:
list of trace_OBJ
- TIE.TIE_core.mergeSeg(TRACES, n, s, X, Y, Z)[source]
Merges two or more segments of a certain trace (trace_OBJ) into one single segment and reclassifies it according to TIE.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
n (int) – ID of specific trace_OBJ (only one trace_OBJ at a time).
s (list) – List of segments that will be merged (e.g., [2, 3]).
X (array-like) – Coordinate vectors.
Y (array-like) – Coordinate vectors.
Z (array-like) – Coordinate vectors.
- Returns:
TRACES – List with merged segments in the specific trace_OBJ.
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.mergeTraces(TRACES, tn, X, Y, Z, seg=False)[source]
Merges two or more traces into one single trace object and reclassifies it according to TIE.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
tn (list) – List of trace IDs that will be merged (e.g., [2, 3]).
X (array-like) – Coordinate vectors.
Y (array-like) – Coordinate vectors.
Z (array-like) – Coordinate vectors.
- Returns:
TRACES – List with merged traces (new IDs).
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.segSeg(TRACES, n, s, X, Y, Z)[source]
Analyses a certain trace segment for potential segmentation at a more detailed scale. Important for long irregular traces that were not segmented during the first segmentation process.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
n (int) – ID of the trace object that contains the segment.
s (int) – ID of the segment that will be re-analyzed for segmentation.
X (array-like) – Coordinate vectors.
Y (array-like) – Coordinate vectors.
Z (array-like) – Coordinate vectors.
- Returns:
TRACES – List with potentially added segments.
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.segmentTRACE(TRACES, mX, mY, mZ, peakthresh=[100, 15])[source]
Segments the traces at their inflection points defined based on a peak threshold.
- Parameters:
TRACES (list of trace objects (TIE_classes.trace_OBJ)) – List of trace objects.
mX (array-like) – Matrices of coordinates of the analyzed extent.
mY (array-like) – Matrices of coordinates of the analyzed extent.
mZ (array-like) – Matrices of coordinates of the analyzed extent.
peakthresh (list of float, optional) – Peak thresholds for convexity [peak prominence, peak width]. Default is [100, 15].
- Returns:
TRACES – List with added segmentation where needed: list of segment objects (TIE_classes.segment_OBJ). Where no segmentation occurred, only one segment for one trace exists.
- Return type:
list of trace objects (TIE_classes.trace_OBJ)
- TIE.TIE_core.tie(TRACES, X, Y, Z, pth=[3, 9, 18], seg=False, peakthresh=[100, 15])[source]
Performs the entire TIE analysis, step by step.
- Parameters:
TRACES (list of trace_OBJ (TIE_classes.trace_OBJ)) – List of trace objects for TIE analysis.
X (numpy.ndarray) – Vectors of X and Y coordinates of the analyzed extent.
Y (numpy.ndarray) – Vectors of X and Y coordinates of the analyzed extent.
Z (numpy.ndarray) – Matrix of Z values of the analyzed extent (size [len(X), len(Y)]).
pth (list of int, optional) – Planarity thresholds for TIE classification. Default is [3, 9, 18].
seg (bool, optional) – Boolean indicating if the trace should first undergo a segmentation process before extracting the trace information. Default is False.
peakthresh (list of int, optional) – Peak thresholds for convexity [peak prominence, peak width]. Default is [90, 15], and it is not used if seg=False.
- Returns:
TRACES – The same list with added TIE information.
- Return type:
list of trace_OBJ
TIE_classes
Created on Fri Apr 23 11:43:27 2021 @author: Anna Rauch
This script contains a set of object definitions (classes), which are the main structure forms, in which the trace information is stored. It is a tree-based structure, so that list of objects can be stored within a different object. As an example: a trace_OBJ stores a list of segment_OBJ, each segment_OBJ itself contains a list of chordPlane_OBJ…