-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
112 changed files
with
6,589 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: fc2c3683f946fbb7f38bc837f719f7aa | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
73 changes: 73 additions & 0 deletions
73
docs/build/html/_downloads/4369ad747c2f34721fbe1dde6c7ad931/read_OMF_sites.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
""" | ||
Reading COLLINSTOWN OMF project | ||
================================ | ||
This tutorial demonstrates how to read an OMF project file in COLLINSTOWN. | ||
""" | ||
|
||
# %% | ||
# Required Libraries: | ||
# ~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# Import the required libraries. | ||
|
||
import omfvista | ||
import pyvista | ||
import subsurface | ||
from subsurface import TriSurf | ||
from subsurface.visualization import to_pyvista_mesh, pv_plot | ||
from subsurface.writer import base_structs_to_binary_file | ||
from dotenv import dotenv_values | ||
|
||
# %% | ||
# Load OMF Project: | ||
# ~~~~~~~~~~~~~~~~~ | ||
# | ||
# Load the OMF project using a fixture. | ||
|
||
def load_omf(): | ||
config = dotenv_values() | ||
path = config.get('PATH_TO_COLLINSTOWN') | ||
omf = omfvista.load_project(path) | ||
return omf | ||
|
||
omf = load_omf() | ||
|
||
# %% | ||
# Read OMF with PyVista: | ||
# ~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# Visualize the OMF project with PyVista. | ||
|
||
omf.plot(multi_colors=True, show_edges=True, notebook=False) | ||
|
||
# %% | ||
# Convert OMF to Unstructured Single Block: | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# Convert the loaded OMF project into an unstructured single block for further analysis. | ||
|
||
block_name = omf.get_block_name(4) | ||
polydata_obj: pyvista.PolyData = omf[block_name] | ||
unstruct_pyvista: pyvista.UnstructuredGrid = polydata_obj.cast_to_unstructured_grid() | ||
cells_pyvista = unstruct_pyvista.cells.reshape(-1, 4)[:, 1:] | ||
|
||
unstruct: subsurface.UnstructuredData = subsurface.UnstructuredData.from_array( | ||
vertex=unstruct_pyvista.points, | ||
cells=cells_pyvista, | ||
) | ||
|
||
if False: # Replace with condition for exporting to Liquid Earth | ||
base_structs_to_binary_file("leapfrog1", unstruct) | ||
|
||
# %% | ||
# Visualize Unstructured Data: | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# Use Subsurface and PyVista to visualize the unstructured data. | ||
|
||
ts = TriSurf(mesh=unstruct) | ||
s = to_pyvista_mesh(ts) | ||
pv_plot([s], image_2d=False) | ||
|
133 changes: 133 additions & 0 deletions
133
docs/build/html/_downloads/edd47a65ee199bebd83ea6e0a7f6412e/read_OMF_sites.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib inline\nfrom pyvista import set_plot_theme\nset_plot_theme('document')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n# Reading COLLINSTOWN OMF project\n\nThis tutorial demonstrates how to read an OMF project file in COLLINSTOWN.\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Required Libraries:\n\nImport the required libraries. \n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import omfvista\nimport pyvista\nimport subsurface\nfrom subsurface import TriSurf\nfrom subsurface.visualization import to_pyvista_mesh, pv_plot\nfrom subsurface.writer import base_structs_to_binary_file\nfrom dotenv import dotenv_values" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Load OMF Project:\n\nLoad the OMF project using a fixture.\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"def load_omf():\n config = dotenv_values()\n path = config.get('PATH_TO_COLLINSTOWN')\n omf = omfvista.load_project(path)\n return omf\n\nomf = load_omf()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Read OMF with PyVista:\n\nVisualize the OMF project with PyVista.\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"omf.plot(multi_colors=True, show_edges=True, notebook=False)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Convert OMF to Unstructured Single Block:\n\nConvert the loaded OMF project into an unstructured single block for further analysis.\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"block_name = omf.get_block_name(4)\npolydata_obj: pyvista.PolyData = omf[block_name]\nunstruct_pyvista: pyvista.UnstructuredGrid = polydata_obj.cast_to_unstructured_grid()\ncells_pyvista = unstruct_pyvista.cells.reshape(-1, 4)[:, 1:]\n\nunstruct: subsurface.UnstructuredData = subsurface.UnstructuredData.from_array(\n vertex=unstruct_pyvista.points,\n cells=cells_pyvista,\n)\n\nif False: # Replace with condition for exporting to Liquid Earth\n base_structs_to_binary_file(\"leapfrog1\", unstruct)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Visualize Unstructured Data:\n\nUse Subsurface and PyVista to visualize the unstructured data.\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"ts = TriSurf(mesh=unstruct)\ns = to_pyvista_mesh(ts)\npv_plot([s], image_2d=False)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Contributing | ||
------------ | ||
|
||
The package ``vector-geology`` is a community effort, and contributions of any kind | ||
(code, documentation, bug reports, examples) are very welcomed; please get in | ||
touch! | ||
|
||
.. todo:: | ||
|
||
Write! |
Oops, something went wrong.