Update src/seismic_hazard_forecasting.py
This commit is contained in:
@@ -130,7 +130,7 @@ def calc_rates(act_rate, cps):
|
||||
for i in range(len(boundaries)-1)]
|
||||
return rt, boundaries
|
||||
|
||||
def apply_beast(act_rate, **kwargs):
|
||||
def apply_beast(act_rate, *args):
|
||||
"""
|
||||
Applies BEAST to the smmothed rate data using different smoothing windows.
|
||||
Input
|
||||
@@ -183,7 +183,7 @@ def apply_beast(act_rate, **kwargs):
|
||||
|
||||
return beast_result, np.sort(cps)
|
||||
|
||||
def bins_and_beast(dates, unit, bin_dur, multiplicator, **kwargs):
|
||||
def bins_and_beast(dates, unit, bin_dur, multiplicator, *args):
|
||||
start_date = dates.min()
|
||||
end_date = dates.max()
|
||||
|
||||
@@ -224,7 +224,7 @@ def bins_and_beast(dates, unit, bin_dur, multiplicator, **kwargs):
|
||||
act_rate = [count / ((bin_edges[i + 1] - bin_edges[i]) * multiplicator / bin_dur)
|
||||
for i, count in enumerate(bin_counts)]
|
||||
|
||||
out, cps = apply_beast(act_rate, **kwargs)
|
||||
out, cps = apply_beast(act_rate, *args)
|
||||
|
||||
if len(cps) > 0:
|
||||
rt, boundaries = calc_rates(act_rate, cps)
|
||||
@@ -617,7 +617,7 @@ verbose: {verbose}")
|
||||
|
||||
#-------split the data into bins and apply BEAST for changepoint detection--------------------
|
||||
act_rate, bin_counts, bin_edges, bin_edges_dt, out, cps, rt, boundaries, bin_dur, time_unit = bins_and_beast(
|
||||
np.array(datenum_data), time_unit, time_win_duration, multiplicator)
|
||||
np.array(datenum_data), time_unit, time_win_duration, multiplicator, tcp_max, torder_min, torder_max)
|
||||
|
||||
#------Forecasted rate is taken from BEAST or is equal to last value if no changepoints detected-----
|
||||
if len(cps) > 0:
|
||||
|
||||
Reference in New Issue
Block a user