euler.get_time_series returns negative values
schoeller opened this issue · 1 comments
schoeller commented
Dear all,
thanks for this lovely opensource. During usage I stumbled over something which I would call a minor issue. One may reconfirm as below.
import io
from pandas import read_csv
from ehyd_tools.synthetic_rainseries import RainModeller
rain = """duration,1,2,5,10,20
5,12.9,14.7,17.2,19.0,20.9
10,18.9,21.9,25.6,28.8,31.9
15,24.6,28.2,34.4,37.9,43.0
30,34.4,40.9,49.5,55.6,62.3
60,45.4,55.0,69.8,79.2,88.8
90,47.4,56.8,68.9,78.6,88.6
120,50.0,59.3,71.5,81.5,91.3
240,55.9,66.6,81.1,91.5,102.2
720,61.9,72.9,87.9,100.5,111.9
1440,66.1,78.1,92.3,104.8,115.9
"""
kostra = read_csv(io.StringIO(rain), index_col=0)
model_rain = RainModeller()
model_rain.idf_table = kostra
model_rain.idf_table.columns = model_rain.idf_table.columns.astype(int)
ts = model_rain.euler.get_time_series(return_period=20, duration=1440, interval=5, kind=2, start_time='2021-01-01 00:00')
print(ts.tail(10))
Small negative values are returned for the final timesteps. The cumulative amount of the output (including negative values) balances to 115.9, which is to be expected from the input.
2021-01-01 23:30:00 0.027778
2021-01-01 23:35:00 -0.033333
2021-01-01 23:40:00 -0.033333
2021-01-01 23:45:00 -0.033333
2021-01-01 23:50:00 -0.033333
2021-01-01 23:55:00 -0.033333
2021-01-02 00:00:00 -0.033333
dtype: float64
Repeating for different duration I observe that negative values start from 90min and above.
Kind regards
Sebastian
MarkusPic commented
Hi!
Thanks for the heads up!
Your idf-table values are malicious.
I added a Warning:
ModelRainWarning: IDF values for the return period of 20 a is not raising monotonically between the durations [60] and [90]! )
Kind regards
Markus