thouska / spotpy

A Statistical Parameter Optimization Tool
https://spotpy.readthedocs.io/en/latest/
MIT License
247 stars 149 forks source link

Sample in sceaua #323

Open XiaoXiaoLeisure opened 3 months ago

XiaoXiaoLeisure commented 3 months ago

Hi, I am using SPOTY's SCEUA algorithm to optimize the VIC model. I want to keep the parameter combinations of each calculation, but I find that the number of parameter combinations in the output csv file is less than iterations, for example, iterations=500, len(params)=208.

sampler = spotpy.algorithms.sceua(cal_setup, dbname=name, dbformat='csv') sampler.sample(iterations)

results_df = pd.DataFrame(np.array(sampler.getdata())) columns_to_save = results_df.columns[:7] # 获取前7列的列名 filtered_df = results_df[columns_to_save] filtered_df.columns = ['like1', 'binfil', 'Ds','Ds_max', 'Ws', 'Soil_D2', 'Soil_D3'] filtered_df.to_excel(outCal + paramfile, sheet_name='param', index=False)

How can I get the VIC parameters for each calculation?