fractopo.analysis.contour_grid module

Scripts for creating sample grids for fracture trace, branch and node data.

fractopo.analysis.contour_grid.create_grid(cell_width: float, lines: GeoDataFrame | GeoSeries) GeoDataFrame

Create an empty polygon grid for sampling fracture line data.

Grid is created to always contain all given lines.

E.g.

>>> lines = gpd.GeoSeries(
...     [
...         LineString([(1, 1), (2, 2)]),
...         LineString([(2, 2), (3, 3)]),
...         LineString([(3, 0), (2, 2)]),
...         LineString([(2, 2), (-2, 5)]),
...     ]
... )
>>> create_grid(cell_width=0.1, lines=lines).head(5)
                                            geometry
0   POLYGON ((-2 5, -1.9 5, -1.9 4.9, -2 4.9, -2 5))
1  POLYGON ((-2 4.9, -1.9 4.9, -1.9 4.8, -2 4.8, ...
2  POLYGON ((-2 4.8, -1.9 4.8, -1.9 4.7, -2 4.7, ...
3  POLYGON ((-2 4.7, -1.9 4.7, -1.9 4.6, -2 4.6, ...
4  POLYGON ((-2 4.6, -1.9 4.6, -1.9 4.5, -2 4.5, ...
fractopo.analysis.contour_grid.populate_sample_cell(sample_cell: Polygon, sample_cell_area: float, traces: GeoDataFrame, nodes: GeoDataFrame, branches: GeoDataFrame, snap_threshold: float, resolve_branches_and_nodes: bool, traces_sindex: Any | None = None) dict[str, float]

Take a single grid polygon and populate it with parameters.

Mauldon determination requires that E-nodes are defined for every single sample circle. If correct Mauldon values are wanted resolve_branches_and_nodes must be passed as True. This will result in much longer analysis time.

fractopo.analysis.contour_grid.sample_grid(grid: GeoDataFrame, traces: GeoDataFrame, nodes: GeoDataFrame, branches: GeoDataFrame, snap_threshold: float, resolve_branches_and_nodes: bool = False) GeoDataFrame

Populate a sample polygon grid with geometrical and topological parameters.