PVLIB 确定大型数据帧的每月平均正确 P_mp DC 输出

问题描述 投票:0回答:0

大家好,

对于我面临的问题,我将不胜感激。我运行了一个 pvlib 模型(从 PVGIS 导入 POA 数据)。我已经获得了 2011-2020 时间段内系统每小时的直流功率结果。这些都是正确的。当我将 I_mp 与 V_mp 相乘时,我得到与模型给定的相同的 P_mp 值。 我现在想确定整个时间段的月平均值(即 2011-2020 整个时间段的 1 月平均值)。但是,当我运行代码以获取月平均值时,直流电源输出 (P_mp) 变得不正确。有了这个,我的意思是它不再等于 V_mp * I_mp。

这是我用来运行模型和确定月平均值的代码。

modelchain.run_model_from_poa(ir_data)
dc_output = modelchain.results.dc.reset_index()   
dc_output_month = dc_output.groupby(pd.to_datetime(dc_output['time'],
                                 format='%Y-%m-%d %H:%M:%S.%f').dt.month, as_index=False).mean()

Example of the hour based data, as you can see I_mp * V_mp equals P_mp

Example of the monthly average as calculated with the code above, as you can see I_mp * V_mp does not equal P_mp anymore

pandas datetime group-by mean pvlib
© www.soinside.com 2019 - 2024. All rights reserved.