Zabamund / wellpathpy

Well deviation import
GNU Lesser General Public License v3.0
78 stars 28 forks source link

Unexpected results when resampling the position log #19

Closed jgvabo closed 3 years ago

jgvabo commented 4 years ago

Consider code below. The end position seems to be correctly calculated using minimum curvature, but the resampling seems fishy. I would expect a semi-circle in the NZ plane, but rather a straight line is produced.

import wellpathpy as wp
import matplotlib.pyplot as plt

# If using min curvature, this should result in a quarter circle northward,
# with end TVD at 2*1000/pi ~637 m
md = [0,1000]
inc = [0,90]
azi = [0,0]

# Calculate coarse pos log
dev = wp.deviation(md, inc, azi)
pos = dev.minimum_curvature()

# Create fine md interval and resample pos log
depths = list(range(int(dev.md[0]), int(dev.md[-1]) + 1, 1))
pos_fine = pos.resample(depths = depths)

# Plot
plt.subplot(2,3,1)
plt.title('NE plane, coarse')
plt.plot(pos.easting, pos.northing, '-ok')
plt.subplot(2,3,4)
plt.title('NE plane, fine')
plt.plot(pos_fine.easting, pos_fine.northing,'-or')
plt.subplot(2,3,2)
plt.title('NZ plane, coarse')
plt.plot(pos.northing, pos.depth, '-ok')
plt.subplot(2,3,5)
plt.title('NZ plane, fine')
plt.plot(pos_fine.northing, pos_fine.depth,'-or')
plt.subplot(2,3,3)
plt.title('EZ plane, coarse')
plt.plot(pos.easting, pos.depth, '-ok')
plt.subplot(2,3,6)
plt.title('EZ plane, fine')
plt.plot(pos_fine.easting, pos_fine.depth,'-or')
plt.show()

Result Screenshot 2020-07-31 at 11 02 15

Zabamund commented 4 years ago

Hello and thank you for posting this issue @jgvabo we are currently in the process of refactoring the code and improving the implementaion of resample, deviation and resample_position. You should therefore consider the current code to be unstable and subject to breakage until our next release. Hopefully our next release will solve this issue. I will leave it open until then.

Zabamund commented 3 years ago

Hello @jgvabo , we are still in the process of updating the documentation, but the code you posted now returns the following:

import wellpathpy as wp
import matplotlib.pyplot as plt

# If using min curvature, this should result in a quarter circle northward,
# with end TVD at 2*1000/pi ~637 m
md = [0,1000]
inc = [0,90]
azi = [0,0]

# Calculate coarse pos log
dev = wp.deviation(md, inc, azi)
pos = dev.minimum_curvature()

# Create fine md interval and resample pos log
depths = list(range(int(dev.md[0]), int(dev.md[-1]) + 1, 1))
pos_fine = pos.resample(depths = depths)
print('TVD depth {:.2f}'.format(pos.depth[-1]))
# Plot
plt.figure(figsize=(12, 8))
plt.subplot(2,3,1)
plt.title('NE plane, coarse')
plt.plot(pos.easting, pos.northing, '-ok')
plt.subplot(2,3,4)
plt.title('NE plane, fine')
plt.plot(pos_fine.easting, pos_fine.northing,'-or')
plt.subplot(2,3,2)
plt.title('NZ plane, coarse')
plt.plot(pos.northing, pos.depth, '-ok')
plt.subplot(2,3,5)
plt.title('NZ plane, fine')
plt.plot(pos_fine.northing, pos_fine.depth,'-or')
plt.subplot(2,3,3)
plt.title('EZ plane, coarse')
plt.plot(pos.easting, pos.depth, '-ok')
plt.subplot(2,3,6)
plt.title('EZ plane, fine')
plt.plot(pos_fine.easting, pos_fine.depth,'-or')
plt.show()

TVD depth 636.62 Github_issue_#19