|
@@ -281,12 +281,16 @@ class WindDirectionFrequencyAnalyst(AnalystNotFilter):
|
|
|
|
|
|
|
|
result_rows = []
|
|
result_rows = []
|
|
|
for turbineCode in turbineCodes:
|
|
for turbineCode in turbineCodes:
|
|
|
- if turbineCode in self.frequency_data:
|
|
|
|
|
- # 确保 enginName 是具体的值
|
|
|
|
|
- enginName = dataFrameMerge[dataFrameMerge[Field_CodeOfTurbine] == turbineCode][Field_NameOfTurbine].iloc[0]
|
|
|
|
|
- if isinstance(enginName, pd.Series):
|
|
|
|
|
- enginName = enginName.iloc[0]
|
|
|
|
|
|
|
+ if turbineCode not in self.frequency_data:
|
|
|
|
|
+ # 风向/风速数据缺失时 windRoseAnalysis 返回空,不生成空 JSON 文件
|
|
|
|
|
+ continue
|
|
|
|
|
+ # 确保 enginName 是具体的值
|
|
|
|
|
+ enginName = dataFrameMerge[dataFrameMerge[Field_CodeOfTurbine] == turbineCode][Field_NameOfTurbine].iloc[0]
|
|
|
|
|
+ if isinstance(enginName, pd.Series):
|
|
|
|
|
+ enginName = enginName.iloc[0]
|
|
|
jsonDictionary = self.convert2Json(turbineModelInfo, turbineCode, dataFrameMerge)
|
|
jsonDictionary = self.convert2Json(turbineModelInfo, turbineCode, dataFrameMerge)
|
|
|
|
|
+ if not jsonDictionary:
|
|
|
|
|
+ continue
|
|
|
jsonFileName = f"wind_direction_frequency{enginName}.json"
|
|
jsonFileName = f"wind_direction_frequency{enginName}.json"
|
|
|
jsonFilePath = os.path.join(outputAnalysisDir, jsonFileName)
|
|
jsonFilePath = os.path.join(outputAnalysisDir, jsonFileName)
|
|
|
JsonUtil.write_json(jsonDictionary, file_path=jsonFilePath)
|
|
JsonUtil.write_json(jsonDictionary, file_path=jsonFilePath)
|