catch time_win_duration values that are too large

This commit is contained in:
ftong 2025-07-07 16:42:57 +02:00
parent 36378f4d6c
commit 664ab1025b

View File

@ -339,8 +339,8 @@ verbose: {verbose}")
elif time_unit == 'years':
multiplicator = 1 / 365
# Raise an exception when time_range from the user is too large
if time_range/multiplicator > 0.5*(time[-1] - time[0]):
# Raise an exception when time_win_duration from the user is too large relative to the catalog
if time_win_duration/multiplicator > 0.5*(time[-1] - time[0]):
msg = "Activity rate estimation time window must be less than half the catalog length. Use a shorter time window."
logger.error(msg)
raise Exception(msg)