|
@@ -127,7 +127,7 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
"""
|
|
"""
|
|
|
大部件温度传感器分析
|
|
大部件温度传感器分析
|
|
|
"""
|
|
"""
|
|
|
- y_name = '温差(℃)'
|
|
|
|
|
|
|
+ y_name = '温度(℃)'
|
|
|
|
|
|
|
|
outputDir = os.path.join(outputAnalysisDir, "GeneratorTemperature")
|
|
outputDir = os.path.join(outputAnalysisDir, "GeneratorTemperature")
|
|
|
dir.create_directory(outputDir)
|
|
dir.create_directory(outputDir)
|
|
@@ -139,15 +139,7 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
for column in temperatureCols:
|
|
for column in temperatureCols:
|
|
|
if not column in dataFrameMerge.columns:
|
|
if not column in dataFrameMerge.columns:
|
|
|
continue
|
|
continue
|
|
|
-
|
|
|
|
|
- # 判断是否是环境温度本身
|
|
|
|
|
- is_env_temp = (column == Field_EnvTemp)
|
|
|
|
|
-
|
|
|
|
|
columnZH = TemperatureColumns.get(column)
|
|
columnZH = TemperatureColumns.get(column)
|
|
|
-
|
|
|
|
|
- if not is_env_temp:
|
|
|
|
|
- columnZH = f"{columnZH}温差"
|
|
|
|
|
-
|
|
|
|
|
outputPath = os.path.join(outputAnalysisDir, column)
|
|
outputPath = os.path.join(outputAnalysisDir, column)
|
|
|
dir.create_directory(outputPath)
|
|
dir.create_directory(outputPath)
|
|
|
|
|
|
|
@@ -163,16 +155,6 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
for idx, (name, group) in enumerate(grouped):
|
|
for idx, (name, group) in enumerate(grouped):
|
|
|
currTurbineInfo_group = self.common.getTurbineInfo(
|
|
currTurbineInfo_group = self.common.getTurbineInfo(
|
|
|
conf.dataContract.dataFilter.powerFarmID, name, self.turbineInfo)
|
|
conf.dataContract.dataFilter.powerFarmID, name, self.turbineInfo)
|
|
|
-
|
|
|
|
|
- # --- 数据计算逻辑 ---
|
|
|
|
|
- x_data = group[Field_PowerFloor]
|
|
|
|
|
- y_data = group[column]
|
|
|
|
|
-
|
|
|
|
|
- # 如果不是环境温度本身,且存在环境温度数据,则计算温差(部件温度 - 环境温度)
|
|
|
|
|
- if not is_env_temp and Field_EnvTemp in group.columns:
|
|
|
|
|
- y_data = y_data - group[Field_EnvTemp]
|
|
|
|
|
- # ------------------
|
|
|
|
|
-
|
|
|
|
|
fig.add_trace(go.Scatter(
|
|
fig.add_trace(go.Scatter(
|
|
|
x=group[Field_PowerFloor],
|
|
x=group[Field_PowerFloor],
|
|
|
y=group[column],
|
|
y=group[column],
|
|
@@ -186,7 +168,7 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
"engineName": currTurbineInfo_group[Field_NameOfTurbine],
|
|
"engineName": currTurbineInfo_group[Field_NameOfTurbine],
|
|
|
"engineCode": name,
|
|
"engineCode": name,
|
|
|
"xData": group[Field_PowerFloor].tolist(),
|
|
"xData": group[Field_PowerFloor].tolist(),
|
|
|
- "yData": y_data.tolist(),
|
|
|
|
|
|
|
+ "yData": group[column].tolist(),
|
|
|
"color": colors[idx % len(colors)]
|
|
"color": colors[idx % len(colors)]
|
|
|
}
|
|
}
|
|
|
turbine_data_list.append(turbine_data_total)
|
|
turbine_data_list.append(turbine_data_total)
|
|
@@ -295,17 +277,9 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
if other_name != name:
|
|
if other_name != name:
|
|
|
tempTurbineInfo = self.common.getTurbineInfo(
|
|
tempTurbineInfo = self.common.getTurbineInfo(
|
|
|
conf.dataContract.dataFilter.powerFarmID, other_name, self.turbineInfo)
|
|
conf.dataContract.dataFilter.powerFarmID, other_name, self.turbineInfo)
|
|
|
-
|
|
|
|
|
- # --- 数据计算 ---
|
|
|
|
|
- ox_data = other_group[Field_PowerFloor]
|
|
|
|
|
- oy_data = other_group[column]
|
|
|
|
|
- if not is_env_temp and Field_EnvTemp in other_group.columns:
|
|
|
|
|
- oy_data = oy_data - other_group[Field_EnvTemp]
|
|
|
|
|
- # ---------------
|
|
|
|
|
-
|
|
|
|
|
single_fig.add_trace(go.Scatter(
|
|
single_fig.add_trace(go.Scatter(
|
|
|
- x=ox_data,
|
|
|
|
|
- y=oy_data,
|
|
|
|
|
|
|
+ x=other_group[Field_PowerFloor],
|
|
|
|
|
+ y=other_group[column],
|
|
|
mode='lines',
|
|
mode='lines',
|
|
|
name=tempTurbineInfo[Field_NameOfTurbine],
|
|
name=tempTurbineInfo[Field_NameOfTurbine],
|
|
|
line=dict(color='lightgrey', width=1),
|
|
line=dict(color='lightgrey', width=1),
|
|
@@ -316,21 +290,14 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
"engineName": tempTurbineInfo[Field_NameOfTurbine],
|
|
"engineName": tempTurbineInfo[Field_NameOfTurbine],
|
|
|
"engineCode": other_name,
|
|
"engineCode": other_name,
|
|
|
"xData": other_group[Field_PowerFloor].tolist(),
|
|
"xData": other_group[Field_PowerFloor].tolist(),
|
|
|
- "yData": oy_data.tolist(),
|
|
|
|
|
|
|
+ "yData": other_group[column].tolist(),
|
|
|
}
|
|
}
|
|
|
turbine_data_list_each.append(turbine_data_other_each)
|
|
turbine_data_list_each.append(turbine_data_other_each)
|
|
|
|
|
|
|
|
# Add the turbine of interest in dark blue
|
|
# Add the turbine of interest in dark blue
|
|
|
- # --- 数据计算 ---
|
|
|
|
|
- gx_data = group[Field_PowerFloor]
|
|
|
|
|
- gy_data = group[column]
|
|
|
|
|
- if not is_env_temp and Field_EnvTemp in group.columns:
|
|
|
|
|
- gy_data = gy_data - group[Field_EnvTemp]
|
|
|
|
|
- # ---------------
|
|
|
|
|
-
|
|
|
|
|
single_fig.add_trace(go.Scatter(
|
|
single_fig.add_trace(go.Scatter(
|
|
|
- x=gx_data,
|
|
|
|
|
- y=gy_data,
|
|
|
|
|
|
|
+ x=group[Field_PowerFloor],
|
|
|
|
|
+ y=group[column],
|
|
|
mode='lines',
|
|
mode='lines',
|
|
|
# Make it slightly thicker for visibility
|
|
# Make it slightly thicker for visibility
|
|
|
line=dict(color='darkblue', width=2),
|
|
line=dict(color='darkblue', width=2),
|
|
@@ -341,7 +308,7 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
"engineName": currTurbineInfo_each[Field_NameOfTurbine],
|
|
"engineName": currTurbineInfo_each[Field_NameOfTurbine],
|
|
|
"engineCode": currTurbineInfo_each[Field_CodeOfTurbine],
|
|
"engineCode": currTurbineInfo_each[Field_CodeOfTurbine],
|
|
|
"xData": group[Field_PowerFloor].tolist(),
|
|
"xData": group[Field_PowerFloor].tolist(),
|
|
|
- "yData": gy_data.tolist(),
|
|
|
|
|
|
|
+ "yData": group[column].tolist(),
|
|
|
}
|
|
}
|
|
|
turbine_data_list_each.append(turbine_data_curr)
|
|
turbine_data_list_each.append(turbine_data_curr)
|
|
|
|
|
|
|
@@ -426,8 +393,8 @@ class TemperatureLargeComponentsAnalyst(AnalystWithGoodBadLimitPoint):
|
|
|
if not Field_GeneratorDE in group.columns or not Field_GeneratorNDE in group.columns or group[Field_GeneratorDE].isna().all() or group[Field_GeneratorNDE].isna().all():
|
|
if not Field_GeneratorDE in group.columns or not Field_GeneratorNDE in group.columns or group[Field_GeneratorDE].isna().all() or group[Field_GeneratorNDE].isna().all():
|
|
|
self.logger.warning(f"{name} 不具备发电机温度测点,或测点值全为空")
|
|
self.logger.warning(f"{name} 不具备发电机温度测点,或测点值全为空")
|
|
|
continue
|
|
continue
|
|
|
- refFieldTemperature = Field_NacTemp if group[Field_EnvTemp].isna(
|
|
|
|
|
- ).all() else Field_EnvTemp
|
|
|
|
|
|
|
+ refFieldTemperature = Field_EnvTemp if group[Field_NacTemp].isna(
|
|
|
|
|
+ ).all() else Field_NacTemp
|
|
|
result_rows1 = self.drawGeneratorTemperature(
|
|
result_rows1 = self.drawGeneratorTemperature(
|
|
|
group, conf, Field_GeneratorDE, Field_GeneratorNDE, refFieldTemperature, Field_PowerFloor, name, outputDir)
|
|
group, conf, Field_GeneratorDE, Field_GeneratorNDE, refFieldTemperature, Field_PowerFloor, name, outputDir)
|
|
|
result_rows.extend(result_rows1)
|
|
result_rows.extend(result_rows1)
|