Skip to content

Commit

Permalink
- [BUG] Revert code to this morning
Browse files Browse the repository at this point in the history
  • Loading branch information
Leguark committed Nov 12, 2021
1 parent f6e092c commit 152b0f4
Show file tree
Hide file tree
Showing 4 changed files with 421 additions and 421 deletions.
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
pyvista.rcParams['window_size'] = np.array([1024, 768]) * 2

# Save figures in specified directory
#pyvista.FIGURE_PATH = os.path.join(os.path.abspath('./images/'), 'auto-generated/')
pyvista.FIGURE_PATH = os.path.join(os.path.abspath('./images/'), 'auto-generated/')

# if not os.path.exists(pyvista.FIGURE_PATH):
# os.makedirs(pyvista.FIGURE_PATH)
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)

sys.path.insert(0, os.path.abspath('.'))

Expand Down
100 changes: 50 additions & 50 deletions examples/examples/gempy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,53 +33,53 @@
mesh = ss.visualization.to_pyvista_mesh(obj)
ss.visualization.pv_plot([mesh])

#
# # %% md
# # Four Layers
# # -----------
#
# # Pull gempy model
# model_files_2 = pooch.retrieve(
# url="https://github.com/cgre-aachen/gempy_data/raw/master/data/gempy_models/Kim.zip",
# known_hash="f530a88351ed0e38673c6937161c59a2f69df92202e14c1e5d5729ed5d72a323",
# processor=pooch.Unzip()
# )
#
# # %% md
# # Triangular meshes
# # +++++++++++++++++
#
# # %%
# fname, = [i for i in model_files_2 if "meshes.nc" in i]
# gempy_tri_mesh_unstruct = ss.reader.read_netcdf.read_unstruct(fname)
# tri_surf = ss.TriSurf(gempy_tri_mesh_unstruct)
# mesh = ss.visualization.to_pyvista_mesh(tri_surf)
# ss.visualization.pv_plot([mesh])
#
# # %% md
# # Regular grid
# # ++++++++++++
#
# fname, = [i for i in model_files_2 if "regular_grid.nc" in i]
# gempy_struct = ss.reader.read_netcdf.read_struct(fname)
# regular_grid = ss.StructuredGrid(gempy_struct)
#
# # %%
# pyvista_mesh = ss.visualization.to_pyvista_grid(regular_grid,
# data_set_name='property_matrix',
# attribute_slice={'Properties': 'id'}
# )
#
# ss.visualization.pv_plot([pyvista_mesh])
#
#
#
#
# # %%
#
# pyvista_mesh = ss.visualization.to_pyvista_grid(regular_grid,
# data_set_name='block_matrix',
# attribute_slice={'Properties': 'id',
# 'Features': 'Default series'})
#
# ss.visualization.pv_plot([pyvista_mesh])

# %% md
# Four Layers
# -----------

# Pull gempy model
model_files_2 = pooch.retrieve(
url="https://github.com/cgre-aachen/gempy_data/raw/master/data/gempy_models/Kim.zip",
known_hash="f530a88351ed0e38673c6937161c59a2f69df92202e14c1e5d5729ed5d72a323",
processor=pooch.Unzip()
)

# %% md
# Triangular meshes
# +++++++++++++++++

# %%
fname, = [i for i in model_files_2 if "meshes.nc" in i]
gempy_tri_mesh_unstruct = ss.reader.read_netcdf.read_unstruct(fname)
tri_surf = ss.TriSurf(gempy_tri_mesh_unstruct)
mesh = ss.visualization.to_pyvista_mesh(tri_surf)
ss.visualization.pv_plot([mesh])

# %% md
# Regular grid
# ++++++++++++

fname, = [i for i in model_files_2 if "regular_grid.nc" in i]
gempy_struct = ss.reader.read_netcdf.read_struct(fname)
regular_grid = ss.StructuredGrid(gempy_struct)

# %%
pyvista_mesh = ss.visualization.to_pyvista_grid(regular_grid,
data_set_name='property_matrix',
attribute_slice={'Properties': 'id'}
)

ss.visualization.pv_plot([pyvista_mesh])




# %%

pyvista_mesh = ss.visualization.to_pyvista_grid(regular_grid,
data_set_name='block_matrix',
attribute_slice={'Properties': 'id',
'Features': 'Default series'})

ss.visualization.pv_plot([pyvista_mesh])
Loading

0 comments on commit 152b0f4

Please sign in to comment.