Skip to content

Commit

Permalink
Merge pull request #165 from jonnymaserati/bug/simple_example
Browse files Browse the repository at this point in the history
Update simple_example and some other minor changes.
  • Loading branch information
jonnymaserati committed Nov 12, 2023
2 parents e814cc8 + 95e4158 commit 12f5e6d
Show file tree
Hide file tree
Showing 7 changed files with 1,057 additions and 33 deletions.
8 changes: 4 additions & 4 deletions examples/connect_two_random_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@
([section.pos2], [section.pos3], [section.pos_target])
)
lines = Lines(
startPoints=start_points,
endPoints=end_points,
start_pts=start_points,
end_pts=end_points,
c='green',
lw=5
)

# Add some arrows to represent the vectors at the start and end positions
scalar = 150
arrows = Arrows(
startPoints=np.array([
start_pts=np.array([
section.pos1,
section.pos_target
]),
endPoints=np.array([
end_pts=np.array([
section.pos1 + scalar * section.vec1,
section.pos_target + scalar * section.vec_target
]),
Expand Down
48 changes: 28 additions & 20 deletions examples/evaluating_clearance.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ def worker(well, reference, surveys):
c = we.clearance.Clearance(reference, offset)

print(f"Calculating ISCWSA clearance for {well}...")
result_iscwsa = we.clearance.ISCWSA(c)
result_iscwsa = we.clearance.IscwsaClearance(
c.reference, c.offset
)

print(f"Calculating mesh clearance for {well}...")
rm = we.clearance.MeshClearance(c, sigma=2.445)
rm = we.clearance.MeshClearance(
c.reference, c.offset, sigma=2.445
)

color = 'blue'

Expand All @@ -138,11 +142,11 @@ class R:
R.nev = rm.nev
R.off_md = rm.off_md
R.hoz_bearing_deg = rm.hoz_bearing_deg
R.distance_CC = rm.distance_CC
R.ref_PCR = rm.ref_PCR
R.off_PCR = rm.off_PCR
R.distance_cc = rm.distance_cc
R.ref_pcr = rm.ref_pcr
R.off_pcr = rm.off_pcr
R.calc_hole = rm.calc_hole
R.SF = rm.SF
R.sf = rm.sf

m = WellMesh(
survey=surveys[well],
Expand Down Expand Up @@ -186,10 +190,14 @@ class R:
c = we.clearance.Clearance(reference, offset)

print(f"Calculating ISCWSA clearance for {well}...")
result_iscwsa = we.clearance.ISCWSA(c)
result_iscwsa = we.clearance.IscwsaClearance(
c.reference, c.offset
)

print(f"Calculating mesh clearance for {well}...")
result_mesh = we.clearance.MeshClearance(c, sigma=2.445)
result_mesh = we.clearance.MeshClearance(
c.reference, c.offset, sigma=2.445
)

colors.append('blue')

Expand Down Expand Up @@ -246,20 +254,20 @@ class R:
if well == "Reference well": continue
r = results[well]['iscwsa']
data = {
"REF_MD (m)": r.c.ref.md,
"REF_TVD (m)": r.c.ref.tvd,
"REF_N (m)": r.c.ref.n,
"REF_E (m)": r.c.ref.e,
"REF_MD (m)": r.ref.md,
"REF_TVD (m)": r.ref.tvd,
"REF_N (m)": r.ref.n,
"REF_E (m)": r.ref.e,
"Offset_MD (m)": r.off.md,
"Offset_TVD (m)": r.off.tvd,
"Offset_N (m)": r.off.n,
"Offset_E (m)": r.off.e,
"Hoz_Bearing (deg)": r.hoz_bearing_deg,
"C-C Clr Dist (m)": r.dist_CC_Clr,
"Ref_PCR (m 1sigma)": r.ref_PCR,
"Offset_PCR (m 1 sigma)": r.off_PCR,
"C-C Clr Dist (m)": r.distance_cc,
"Ref_PCR (m 1sigma)": r.ref_pcr,
"Offset_PCR (m 1 sigma)": r.off_pcr,
"Calc hole": r.calc_hole,
"ISCWSA ACR": r.SF
"ISCWSA ACR": r.sf
}
df = pd.DataFrame(data=data)
df.to_excel(writer, sheet_name=f'{well} - iscwsa')
Expand All @@ -275,11 +283,11 @@ class R:
"Offset_N (m)": [n[1][0][0] for n in r.nev],
"Offset_E (m)": [e[1][0][1] for e in r.nev],
"Hoz_Bearing (deg)": r.hoz_bearing_deg,
"C-C Clr Dist (m)": r.distance_CC,
"Ref_PCR (m 1sigma)": r.ref_PCR,
"Offset_PCR (m 1 sigma)": r.off_PCR,
"C-C Clr Dist (m)": r.distance_cc,
"Ref_PCR (m 1sigma)": r.ref_pcr,
"Offset_PCR (m 1 sigma)": r.off_pcr,
"Calc hole": r.calc_hole,
"SF": r.SF
"SF": r.sf
}
df = pd.DataFrame(data=data)
df.to_excel(writer, sheet_name=f'{well} - mesh')
Expand Down
11 changes: 8 additions & 3 deletions examples/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
author: Jonny Corcutt
email: jonnycorcutt@gmail.com
date: 29-09-2021
updated: 12-11-2023
'''
import welleng as we
from tabulate import tabulate
Expand Down Expand Up @@ -85,16 +86,20 @@
)

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 Down
Loading

0 comments on commit 12f5e6d

Please sign in to comment.