fractopo.analysis.relationships module

Functions for plotting cross-cutting and abutting relationships.

fractopo.analysis.relationships.determine_crosscut_abutting_relationships(trace_series, node_series, node_types, set_array, set_names, buffer_value, label)

Determine cross-cutting and abutting relationships between trace sets.

Determines relationships between all inputted sets by using spatial intersects between node and trace data.

E.g.

>>> trace_series = gpd.GeoSeries(
...     [LineString([(0, 0), (1, 0)]), LineString([(0, 1), (0, -1)])]
... )
>>> node_series = gpd.GeoSeries(
...     [Point(0, 0), Point(1, 0), Point(0, 1), Point(0, -1)]
... )
>>> node_types = np.array(["Y", "I", "I", "I"])
>>> set_array = np.array(["1", "2"])
>>> set_names = ("1", "2")
>>> buffer_value = 0.001
>>> label = "title"
>>> determine_crosscut_abutting_relationships(
...     trace_series,
...     node_series,
...     node_types,
...     set_array,
...     set_names,
...     buffer_value,
...     label,
... )
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~pandas.core.frame.DataFrame\``

name sets x y y-reverse error-count

0 title (1, 2) 0 1 0 0

TODO: No within set relations…..yet… Problem?

fractopo.analysis.relationships.determine_intersect(node, node_class, l1, l2, first_set, second_set, first_setpointtree, buffer_value)

Determine what intersection the node represents.

TODO: R0912: Too many branches.

Return type:

Dict[str, Union[Point, str, Tuple[str, str], bool]]

fractopo.analysis.relationships.determine_intersects(trace_series_two_sets, set_names_two_sets, node_series_xy_intersects, node_types_xy_intersects, buffer_value)

Determine how abutments and crosscuts occur between two sets.

E.g.

>>> traces = gpd.GeoSeries([LineString([(0, 0), (1, 1)])]), gpd.GeoSeries(
...     [LineString([(0, 1), (0, -1)])]
... )
>>> set_names_two_sets = ("1", "2")
>>> node_series_xy_intersects = gpd.GeoSeries([Point(0, 0)])
>>> node_types_xy_intersects = np.array(["Y"])
>>> buffer_value = 0.001
>>> determine_intersects(
...     traces,
...     set_names_two_sets,
...     node_series_xy_intersects,
...     node_types_xy_intersects,
...     buffer_value,
... )
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~pandas.core.frame.DataFrame\``

node nodeclass sets error

0 POINT (0 0) Y (1, 2) False

fractopo.analysis.relationships.determine_nodes_intersecting_sets(trace_series_two_sets, set_names_two_sets, node_series_xy, buffer_value)

Conduct a spatial intersect between nodes and traces.

Node GeoDataFrame contains only X- and Y-nodes and the trace GeoDataFrame only two sets. Returns boolean array of based on intersections.

E.g.

>>> traces = gpd.GeoSeries([LineString([(0, 0), (1, 1)])]), gpd.GeoSeries(
...     [LineString([(0, 1), (0, -1)])]
... )
>>> set_names_two_sets = ("1", "2")
>>> nodes_xy = gpd.GeoSeries([Point(0, 0), Point(1, 1), Point(0, 1), Point(0, -1)])
>>> buffer_value = 0.001
>>> determine_nodes_intersecting_sets(
...     traces, set_names_two_sets, nodes_xy, buffer_value
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`\~typing.List\`\\ \\\[\:py\:class\:\`bool\`\]`

… ) [True, False, False, False]

fractopo.analysis.relationships.plot_crosscut_abutting_relationships_plot(relations_df, set_array, set_names)

Plot cross-cutting and abutting relationships.

Return type:

Tuple[List[Figure], List[ndarray]]