Suppress numpy floating point arithmetic warnings

etta-drone
Dan Howe 6 years ago
parent 1bca8f4aad
commit db4fffd600

@ -132,7 +132,9 @@ def findZerochainage(chainage0, elevation0, max_beach_slope=5, min_beach_slope=5
else: else:
#find the slope between the last two points #find the slope between the last two points
try: try:
np.seterr(all='ignore')
beachslope = 1/((elevation0[-2] - elevation0[-1])/(chainage0[-1] - chainage0[-2])) beachslope = 1/((elevation0[-2] - elevation0[-1])/(chainage0[-1] - chainage0[-2]))
np.seterr(all=None)
except ZeroDivisionError: except ZeroDivisionError:
beachslope= 999 beachslope= 999
if beachslope>min_beach_slope: if beachslope>min_beach_slope:

Loading…
Cancel
Save