Quellcode durchsuchen

fix 后处理指定辐照参数

hzh vor 2 Wochen
Ursprung
Commit
d22fea35fb
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      post_processing/post_process.py

+ 3 - 2
post_processing/post_process.py

@@ -59,10 +59,11 @@ def predict_result_adjustment(df, args):
             'mongodb_read_table': args['mongodb_nwp_table'],
             'col_time': col_time
         }
+        col_radiation = args['radiation']
         nwp = get_data(nwp_param)
 
-        df_cp = df_cp.join(nwp['radiation'])
-        df_cp.loc[nwp['radiation'] == 0, 'power_forecast'] = 0
+        df_cp = df_cp.join(nwp[col_radiation])
+        df_cp.loc[nwp[col_radiation] == 0, 'power_forecast'] = 0
         df_cp.drop(columns=['radiation'], inplace=True)
         logger.info("solar processed")
     df_cp['power_forecast'] = round(df_cp['power_forecast'], 2)