Skip to content

Commit

Permalink
Update blob_shape.py
Browse files Browse the repository at this point in the history
_get_exponential_shape now protects against overflow for large theta-values.
  • Loading branch information
audunth authored Apr 19, 2024
1 parent 1d4b99c commit b9581cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blobmodel/blob_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def _get_exponential_shape(theta: np.ndarray, **kwargs) -> np.ndarray:
np.ndarray
Array representing the exponential pulse shape.
"""
return np.exp(theta) * np.heaviside(-1.0 * theta, 1)
kern = np.zeros(shape=np.shape(theta))
kern[theta < 0] = np.exp(theta[theta < 0])
return kern


def _get_lorentz_shape(theta: np.ndarray, **kwargs) -> np.ndarray:
Expand Down

0 comments on commit b9581cc

Please sign in to comment.