# LoopStructural: Loop3D Implicit Geological Modelling

[](https://badge.fury.io/py/LoopStructural)
[](https://github.com/Loop3D/LoopStructural/blob/master/LICENSE)
[](https://loop3d.github.io/LoopStructural)
## Overview
LoopStructural is an opensource Python library for 3D geological modelling. The library has been built in the scope of the Loop project ([Loop3d.org](https://loop3d.org/)). LoopStructural can:
- Model fault networks integrating fault kinematics and overprinting relationships
- Model folds using structural elements (fold axis, fold axial surface) for multiple fold events
- Use different implicit interpolation algorithms (Finite Difference, Piecewiese Linear, RBF)
- Export models to vtk, geoh5, omf, gocad, csv, obj formats
- Visualise models in an interactive python environment.
## Installation
### Google colab
LoopStructural can be used inside a google colab notebook, however interactive visualisation using kitware trame does not work. Only static plots can be displayed.
### Pip
`pip install loopstructural`
Optional dependencies are:
- loopstructuralvisualisation (wrapper for pyvista to interface with loopstructural objects)
- pyvista (3D visualisation)
- geoh5py (export to .geoh5 format)
- mira-omf (export to .omf format to load in Leapfrog)
- pyevtk
- dill (serialize loop models to a pickle file)
- tqdm (progress bars)
- loopsolver (experimental solver for admm inequality constraints)
You can install all of the optional dependencies using:
`pip install loopstructural[all]`
### conda
`conda install -c conda-forge -c loop3d loopstructural`
to install the working 3D visualisation environment
`conda install -c conda-forge -c loop3d loopstructural loopstructuralvisualisation pyvista trame trame-vtk trame-vuetify`
## Quickstart
- A basic geological model
```Python
from LoopStructural import GeologicalModel
from LoopStructural.datatypes import BoundingBox
from LoopStructural.visualisation import Loop3DView
from LoopStructural.datasets import load_claudius
import numpy as np
data, bb = load_claudius()
#bb constaints origin and maximum of axis aligned bounding box
#data is a pandas dataframe with X,Y,Z,val,nx,ny,nz, feature_name
model = GeologicalModel(bb[0,:],bb[1,:])
model.data = data
# nelements specifies the number of discrete interpolation elements
# 'stratÃ' is the feature name in the data dataframe
model.create_and_add_foliation('strati',nelements=1e5)
model.update()
# get the value of the interpolator at some random locations
locations = np.array(
[
np.random.uniform(bb[0, 0], bb[1, 0],5),
np.random.uniform(bb[0, 1], bb[1, 1],5),
np.random.uniform(bb[0, 2], bb[1, 2],5),
]
).T
val = model.evaluate_feature_value('strati', locations)
# get the gradient of the interpolator
gradient = model.evaluate_feature_gradient('strati',locations)
#Plot the scalar field of the model
model['strati'].scalar_field().plot()
```
## Documentation
The LoopStructural documentation can be found [here](https://loop3d.github.io/LoopStructural)
## Problems
Any bugs/feature requests/comments please create a new [issue](https://github.com/Loop3D/LoopStructural/issues).
## Acknowledgements
_The Loop platform is an open source 3D probabilistic geological and geophysical modelling platform, initiated by Geoscience Australia and the OneGeology consortium. The project is funded by Australian territory, State and Federal Geological Surveys, the Australian Research Council and the MinEx Collaborative Research Centre._
Raw data
{
"_id": null,
"home_page": null,
"name": "LoopStructural",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "earth sciences, geology, 3-D modelling, structural geology, uncertainty",
"author": null,
"author_email": "Lachlan Grose <lachlan.grose@monash.edu>",
"download_url": "https://files.pythonhosted.org/packages/af/a3/7248c0b0292b7664bebbb58c7ff6b270be5d55ddb13d9f882b5ce1028c71/loopstructural-1.6.7.tar.gz",
"platform": null,
"description": "# LoopStructural: Loop3D Implicit Geological Modelling\n\n\n[](https://badge.fury.io/py/LoopStructural)\n[](https://github.com/Loop3D/LoopStructural/blob/master/LICENSE)\n[](https://loop3d.github.io/LoopStructural)\n\n## Overview\n\nLoopStructural is an opensource Python library for 3D geological modelling. The library has been built in the scope of the Loop project ([Loop3d.org](https://loop3d.org/)). LoopStructural can:\n\n- Model fault networks integrating fault kinematics and overprinting relationships\n- Model folds using structural elements (fold axis, fold axial surface) for multiple fold events\n- Use different implicit interpolation algorithms (Finite Difference, Piecewiese Linear, RBF)\n- Export models to vtk, geoh5, omf, gocad, csv, obj formats\n- Visualise models in an interactive python environment.\n\n## Installation\n\n### Google colab\n\nLoopStructural can be used inside a google colab notebook, however interactive visualisation using kitware trame does not work. Only static plots can be displayed.\n\n### Pip\n\n`pip install loopstructural`\n\nOptional dependencies are:\n\n- loopstructuralvisualisation (wrapper for pyvista to interface with loopstructural objects)\n- pyvista (3D visualisation)\n- geoh5py (export to .geoh5 format)\n- mira-omf (export to .omf format to load in Leapfrog)\n- pyevtk\n- dill (serialize loop models to a pickle file)\n- tqdm (progress bars)\n- loopsolver (experimental solver for admm inequality constraints)\n\nYou can install all of the optional dependencies using:\n`pip install loopstructural[all]`\n\n### conda\n\n`conda install -c conda-forge -c loop3d loopstructural`\n\nto install the working 3D visualisation environment\n`conda install -c conda-forge -c loop3d loopstructural loopstructuralvisualisation pyvista trame trame-vtk trame-vuetify`\n\n## Quickstart\n\n- A basic geological model\n\n```Python\nfrom LoopStructural import GeologicalModel\nfrom LoopStructural.datatypes import BoundingBox\nfrom LoopStructural.visualisation import Loop3DView\nfrom LoopStructural.datasets import load_claudius\n\nimport numpy as np\ndata, bb = load_claudius()\n\n#bb constaints origin and maximum of axis aligned bounding box\n#data is a pandas dataframe with X,Y,Z,val,nx,ny,nz, feature_name\n\nmodel = GeologicalModel(bb[0,:],bb[1,:])\nmodel.data = data\n# nelements specifies the number of discrete interpolation elements\n# 'strat\u00ed' is the feature name in the data dataframe\nmodel.create_and_add_foliation('strati',nelements=1e5)\nmodel.update()\n# get the value of the interpolator at some random locations\nlocations = np.array(\n [\n np.random.uniform(bb[0, 0], bb[1, 0],5),\n np.random.uniform(bb[0, 1], bb[1, 1],5),\n np.random.uniform(bb[0, 2], bb[1, 2],5),\n ]\n).T\nval = model.evaluate_feature_value('strati', locations)\n# get the gradient of the interpolator\ngradient = model.evaluate_feature_gradient('strati',locations)\n\n#Plot the scalar field of the model\nmodel['strati'].scalar_field().plot()\n\n\n```\n\n## Documentation\n\nThe LoopStructural documentation can be found [here](https://loop3d.github.io/LoopStructural)\n\n## Problems\n\nAny bugs/feature requests/comments please create a new [issue](https://github.com/Loop3D/LoopStructural/issues).\n\n## Acknowledgements\n\n_The Loop platform is an open source 3D probabilistic geological and geophysical modelling platform, initiated by Geoscience Australia and the OneGeology consortium. The project is funded by Australian territory, State and Federal Geological Surveys, the Australian Research Council and the MinEx Collaborative Research Centre._\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "3D geological modelling",
"version": "1.6.7",
"project_urls": {
"Bug Tracker": "https://github.com/loop3d/loopstructural/issues",
"Documentation": "https://Loop3d.org/LoopStructural/",
"Source Code": "https://github.com/loop3d/loopstructural"
},
"split_keywords": [
"earth sciences",
" geology",
" 3-d modelling",
" structural geology",
" uncertainty"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d90e43218240b0823905546a1d204ebbf0fcbc182935e30a3dbe65b0060cd830",
"md5": "63ff351f16cd5233ecc60f8863e30896",
"sha256": "617ba75fad2fe8939f6e326879c726af3738b69136b3283ceff8f22d2c4a1859"
},
"downloads": -1,
"filename": "LoopStructural-1.6.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "63ff351f16cd5233ecc60f8863e30896",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 567522,
"upload_time": "2025-02-03T01:17:28",
"upload_time_iso_8601": "2025-02-03T01:17:28.110013Z",
"url": "https://files.pythonhosted.org/packages/d9/0e/43218240b0823905546a1d204ebbf0fcbc182935e30a3dbe65b0060cd830/LoopStructural-1.6.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "afa37248c0b0292b7664bebbb58c7ff6b270be5d55ddb13d9f882b5ce1028c71",
"md5": "922a36b8e76cdc20b186203db501b2ed",
"sha256": "8ef70a03c6a894d2ba0d685d18e6c8bc58983f90c2f383adbbedd94166d243b8"
},
"downloads": -1,
"filename": "loopstructural-1.6.7.tar.gz",
"has_sig": false,
"md5_digest": "922a36b8e76cdc20b186203db501b2ed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 508827,
"upload_time": "2025-02-03T01:17:30",
"upload_time_iso_8601": "2025-02-03T01:17:30.732476Z",
"url": "https://files.pythonhosted.org/packages/af/a3/7248c0b0292b7664bebbb58c7ff6b270be5d55ddb13d9f882b5ce1028c71/loopstructural-1.6.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-03 01:17:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "loop3d",
"github_project": "loopstructural",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "scikit-learn",
"specs": []
},
{
"name": "scikit-image",
"specs": []
},
{
"name": "scipy",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "setuptools",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "pyevtk",
"specs": []
},
{
"name": "dill",
"specs": []
}
],
"lcname": "loopstructural"
}