level=INDICES.CALCULATION_METHOD,
                  drop_level=True).copy()

idf_reverse = IntensityDurationFrequencyAnalyse(series_kind=SERIES.PARTIAL,
                                                worksheet=METHOD.KOSTRA,
                                                extended_durations=True)
idf_reverse._parameter.reverse_engineering(idf_table)

output_directory = path.join('design_rain_ehyd_5214')
idf_reverse.auto_save_parameters(
    path.join(output_directory, 'idf_parameters.yaml'))
exit()
# ----------------------------------
max_duration = 2880
fig, ax = idf_reverse.result_figure(color=True,
                                    logx=True,
                                    max_duration=max_duration)
fig.set_size_inches(12, 8)

ax = idf_table.loc[:max_duration, [1, 2, 5, 10, 50, 100]].plot(ax=ax,
                                                               marker='x',
                                                               lw=0)
# ax.set_xlim(0, 720)
fig.tight_layout()
fig.show()
fig.savefig(path.join('idf_reverse_curves_plot_color.png'), dpi=200)

# ----------------------------------
# sub-folder for the results
output_directory = path.join('ehyd_112086_idf_data')
# initialize of the analysis class
# initialize of the analysis class
idf = IntensityDurationFrequencyAnalyse(series_kind=SERIES.PARTIAL, worksheet=METHOD.KOSTRA, extended_durations=True)

# reading the pandas series of the precipitation (data from ehyd.gv.at - ID=112086)
series = pd.read_parquet('ehyd_112086.parquet')['precipitation']

# setting the series for the analysis
idf.set_series(series)
# idf.write_parameters(path.join(output_directory, 'idf_parameters.yaml'))
# exit()
# auto-save the calculated parameter so save time for a later use
idf.auto_save_parameters(path.join(output_directory, 'idf_parameters_new.yaml'))

exit()

idf.result_figure(color=False)

# --------
# plotting the IDF curves
fig, ax = idf.result_figure(color=True)
fig.set_size_inches(12, 8)
fig.tight_layout()
fig.savefig(path.join(output_directory, 'idf_curves_plot_color.png'), dpi=200)
plt.close(fig)

# -------
# plotting the idf curves in black and white
fig, ax = idf.result_figure(color=False)
fig.set_size_inches(12, 8)
fig.tight_layout()
fig.savefig(path.join(output_directory, 'idf_curves_plot.png'), dpi=200)