|
@@ -92,7 +92,7 @@ def get_process_turbine(database):
|
|
engine = create_database(database)
|
|
engine = create_database(database)
|
|
for i in arg.turbineloc:
|
|
for i in arg.turbineloc:
|
|
print("导出风机{}的数据".format(i))
|
|
print("导出风机{}的数据".format(i))
|
|
- sql_turbine = "select C_TIME,C_WS,C_WD,C_ACTIVE_POWER from t_wind_turbine_status_data WHERE C_EQUIPMENT_NO=" + str(i) #+ " and C_WS>0 and C_ACTIVE_POWER>0"
|
|
|
|
|
|
+ sql_turbine = "select C_TIME,C_DATA1 as C_WS, C_DATA2 as C_WD, C_DATA3 as C_ACTIVE_POWER from t_wind_turbine_status_data WHERE C_EQUIPMENT_NO=" + str(i) + " and C_DATA1 != -99 AND C_DATA1 != 0" #+ " and C_WS>0 and C_ACTIVE_POWER>0"
|
|
turbine = exec_sql(sql_turbine, engine)
|
|
turbine = exec_sql(sql_turbine, engine)
|
|
|
|
|
|
#直接导出所有数据
|
|
#直接导出所有数据
|
|
@@ -139,6 +139,30 @@ def get_process_power(database):
|
|
power = exec_sql(sql_power, engine)
|
|
power = exec_sql(sql_power, engine)
|
|
utils.savedata.saveData("power.csv", power)
|
|
utils.savedata.saveData("power.csv", power)
|
|
|
|
|
|
|
|
+
|
|
|
|
+def get_process_dq(database):
|
|
|
|
+ """
|
|
|
|
+ 获取短期预测结果
|
|
|
|
+ :param database:
|
|
|
|
+ :return:
|
|
|
|
+ """
|
|
|
|
+ engine = create_database(database)
|
|
|
|
+ sql_dq = "select C_ABLE_VALUE, C_FORECAST_TIME from t_forecast_power_short_term_his"
|
|
|
|
+ dq = exec_sql(sql_dq, engine)
|
|
|
|
+ utils.savedata.saveData("dq.csv", dq)
|
|
|
|
+
|
|
|
|
+def get_process_cdq(database):
|
|
|
|
+ """
|
|
|
|
+ 获取超短期预测结果
|
|
|
|
+ :param database:
|
|
|
|
+ :return:
|
|
|
|
+ """
|
|
|
|
+ engine = create_database(database)
|
|
|
|
+ sql_cdq = "select C_ABLE_VALUE, C_FORECAST_TIME from t_forecast_power_ultra_short_term_his"
|
|
|
|
+ cdq = exec_sql(sql_cdq, engine)
|
|
|
|
+ utils.savedata.saveData("cdq.csv", cdq)
|
|
|
|
+
|
|
|
|
+
|
|
def get_turbine_info(database):
|
|
def get_turbine_info(database):
|
|
"""
|
|
"""
|
|
获取风机信息
|
|
获取风机信息
|
|
@@ -182,7 +206,7 @@ def indep_process():
|
|
# utils.savedata.saveData("/tower/tower-{}-process.csv".format(2), tower2)
|
|
# utils.savedata.saveData("/tower/tower-{}-process.csv".format(2), tower2)
|
|
|
|
|
|
# 所有表时间统一
|
|
# 所有表时间统一
|
|
- filenames = ["/NWP.csv","/power.csv", '/tower/tower-1-process.csv']
|
|
|
|
|
|
+ filenames = ["/NWP.csv","/power.csv", "/dq.csv", "/cdq.csv", '/tower/tower-1-process.csv']
|
|
dataframes = []
|
|
dataframes = []
|
|
for i in arg.turbineloc:
|
|
for i in arg.turbineloc:
|
|
filenames.append("/turbine-15/turbine-{}.csv".format(i))
|
|
filenames.append("/turbine-15/turbine-{}.csv".format(i))
|
|
@@ -313,6 +337,8 @@ def data_process(database):
|
|
get_turbine_info(database)
|
|
get_turbine_info(database)
|
|
get_process_tower(database)
|
|
get_process_tower(database)
|
|
get_process_power(database)
|
|
get_process_power(database)
|
|
|
|
+ get_process_dq(database)
|
|
|
|
+ get_process_cdq(database)
|
|
indep_process()
|
|
indep_process()
|
|
NWP_indep_process()
|
|
NWP_indep_process()
|
|
# Data_split()
|
|
# Data_split()
|