Skip to content

Commit

Permalink
Merge pull request #696 from MiraGeoscience/GEOPY-1932b
Browse files Browse the repository at this point in the history
GEOPY-1932: Desurveying can produce a divide by zero warning with some paths
  • Loading branch information
domfournier authored Jan 31, 2025
2 parents d43bbad + 215d679 commit 0ed8adc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions geoh5py/objects/drillhole.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,10 @@ def compute_intervals(survey: np.ndarray, collar, end_of_hole) -> dict:
norm[norm == 0.0] = INFINITE_RADIUS
tangential /= norm[:, None]
alpha = np.abs(0.5 * np.pi - np.arctan2(dot, vr))
alpha[alpha == 0.0] = INFINITE_RADIUS**-1.0
delta_depth = np.diff(full_survey[:, 0])
radius = delta_depth / alpha

radius[alpha == 0.0] = delta_depth[alpha == 0.0] * INFINITE_RADIUS
alpha[alpha == 0.0] = delta_depth[alpha == 0.0] / radius[alpha == 0.0]

intervals = {
"depths": np.r_[full_survey[:, 0]],
"rad": np.r_[radius, INFINITE_RADIUS],
Expand Down

0 comments on commit 0ed8adc

Please sign in to comment.