Skip to content

Commit

Permalink
Update quick start example to reflect updated module.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnymaserati committed Jul 7, 2024
1 parent f49a4fd commit b3193d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Here's an example using `welleng` to construct a couple of simple well trajector
import welleng as we
from tabulate import tabulate


# construct simple well paths
print("Constructing wells...")
connector_reference = we.survey.from_connections(
Expand All @@ -207,7 +208,7 @@ connector_reference = we.survey.from_connections(
pos2=[-100., 0., 2000.],
inc2=90,
azi2=60,
),
),
step=50
)

Expand Down Expand Up @@ -266,16 +267,20 @@ c = we.clearance.Clearance(
)

print("Calculating ISCWSA clearance...")
clearance_ISCWSA = we.clearance.ISCWSA(c)
clearance_ISCWSA = we.clearance.IscwsaClearance(
survey_reference, survey_offset
)

print("Calculating mesh clearance...")
clearance_mesh = we.clearance.MeshClearance(c, sigma=2.445)
clearance_mesh = we.clearance.MeshClearance(
survey_reference, survey_offset, sigma=2.445
)

# tabulate the Separation Factor results and print them
results = [
[md, sf0, sf1]
for md, sf0, sf1
in zip(c.reference.md, clearance_ISCWSA.SF, clearance_mesh.SF)
in zip(c.reference.md, clearance_ISCWSA.sf, clearance_mesh.sf)
]

print("RESULTS\n-------")
Expand All @@ -285,12 +290,12 @@ print(tabulate(results, headers=['md', 'SF_ISCWSA', 'SF_MESH']))
lines = we.visual.get_lines(clearance_mesh)

# plot the result
we.visual.plot(
[mesh_reference.mesh, mesh_offset.mesh], # list of meshes
names=['reference', 'offset'], # list of names
colors=['red', 'blue'], # list of colors
lines=lines
)
plot = we.visual.Plotter()
plot.add(mesh_reference, c='red')
plot.add(mesh_offset, c='blue')
plot.add(lines)
plot.show()
plot.close()

print("Done!")

Expand Down
14 changes: 6 additions & 8 deletions examples/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
'''
import welleng as we
from tabulate import tabulate
# import os

# os.environ['DISPLAY'] = ':1'

# construct simple well paths
print("Constructing wells...")
Expand Down Expand Up @@ -109,11 +107,11 @@
lines = we.visual.get_lines(clearance_mesh)

# plot the result
we.visual.plot(
[mesh_reference.mesh, mesh_offset.mesh], # list of meshes
names=['reference', 'offset'], # list of names
colors=['red', 'blue'], # list of colors
lines=lines
)
plot = we.visual.Plotter()
plot.add(mesh_reference, c='red')
plot.add(mesh_offset, c='blue')
plot.add(lines)
plot.show()
plot.close()

print("Done!")
2 changes: 1 addition & 1 deletion welleng/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def get_lines(clearance):
c = clearance.sf
start_points, end_points = clearance.get_lines()
lines = Lines(start_points, end_points).cmap('hot_r', c, on='cells')
lines.addScalarBar(title='SF')
lines.add_scalarbar(title='SF')

return lines

Expand Down

0 comments on commit b3193d8

Please sign in to comment.