Skip to content

Commit

Permalink
Added new geo_toolz.
Browse files Browse the repository at this point in the history
  • Loading branch information
jejjohnson committed Mar 20, 2024
1 parent cfeff88 commit d139ba1
Show file tree
Hide file tree
Showing 6 changed files with 13,161 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bayesevt/_src/geoprocessing/math.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np


# SECOND AXIS
def safe_reciprocal(x):
"""Vectorized 1/x, treating x==0 manually"""
x = np.array(x, float)
near_zero = np.isclose(x, 0)
x[near_zero] = np.inf
x[~near_zero] = np.reciprocal(x[~near_zero])
return x
3,340 changes: 3,340 additions & 0 deletions notebooks/evt/1.1_extremes_geotoolz.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit d139ba1

Please sign in to comment.