Skip to content

Commit

Permalink
Update statistics.py
Browse files Browse the repository at this point in the history
The "get_j" function is now modified to handle zero values in number_distribution[ind]
  • Loading branch information
arsalanmstn committed Sep 25, 2024
1 parent fc0345c commit 2e3c90b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyopia/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def get_j(dias, number_distribution):

# use polyfit to obtain the slope of the ditriubtion in log-space (which is
# assumed near-linear in most parts of the ocean)
p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1)
p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind], where=number_distribution[ind] > 0), 1)
junge_slope = p[0]
return junge_slope

Expand Down

0 comments on commit 2e3c90b

Please sign in to comment.