Skip to content

Commit 3fa3ade

Browse files
committed
fix divide by zero avoidance in IHmethod's semilog interpolation
1 parent 8d6dacb commit 3fa3ade

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydrograph/baseflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ def IHmethod(Qseries, block_length=5, tp=0.9, interp_semilog=True, freq='D', lim
203203
# interpolate between baseflow ordinates
204204
if interp_semilog:
205205
iszero = Q.ordinate.values == 0
206+
logQ = Q.ordinate.copy()
207+
logQ[iszero] = 0.01
206208
logQ = np.log10(Q.ordinate)
207-
logQ[iszero] = -2
208209
QB = np.power(10.0, logQ.interpolate(limit=limit).values)
209210
else:
210211
QB = Q.ordinate.interpolate(limit=limit).values

0 commit comments

Comments
 (0)