import parameter import datetime import matplotlib.pyplot as plt print("start program", datetime.datetime.now()) ### getting parameter print("getting parameters") parameter = parameter.SiteInfo() begYear = parameter.begYear() endYear = parameter.endYear() totalYear = endYear - begYear + 1 radiusInflu = parameter.radiusInflu() returnPeriod = parameter.returnPeriod() allWeatherStationInfo = parameter.allWeatherStaionInfo() allWindFarmInfo = parameter.allWindFarmInfo() specialWindFarmInfo = parameter.specialWindFarmInfo() oneSiteInfo = parameter.oneSiteInfo() KEY = 2 # 2,3 if KEY == 1: #陆地站点 totalDict = allWeatherStationInfo #衰减系数 factor = [1.0, 1.0, 1.0, 0.95, 0.85, 0.9, 1.1, 0.8, 0.9, 0.75, 0.9] outVmax50a = "VmaxReturnPeriodAllWeatherStation50a.csv" if KEY == 2: #海上风电场 totalDict = allWindFarmInfo factor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] outVmax50a = "VmaxReturnPeriodAllWeatherStation50a.csv" if KEY == 3: #湛江 totalDict = oneSiteInfo #湛江
plt.ylabel(u'风速(m/s)', fontproperties=myfont,fontsize=fontsize) ylim0 = np.min(spdSim)-2 ylim1 = np.max(spdSim)+1/6*np.max(spdSim) plt.ylim(ylim0,ylim1) plt.xticks(iX,Xticks,rotation=25,fontproperties=myfont,fontsize=fontsize) plt.xticks(iX[::5],Xticks[::5],rotation=80,fontproperties=myfont,fontsize=fontsize) plt.tight_layout() plt.show() fig.savefig(figName) plt.close() return None if __name__ == '__main__': # get parameter parameter = parameter.SiteInfo() iKey = '59663' kpFile = r"allTyphoonKeyParameter/"+iKey+"KeyParameters.csv" simFile = r"allTyphoonVmax/"+iKey+"Vmax.csv" obsFile = r"obs_data_hours/"+iKey+".csv" plotCase = plotCase() dictInfo = parameter.allWeatherStaionInfo() dictInfo2 = parameter.allWindFarmInfo() #plt1 = plotCase.plotCaseVmaxSpd(kpFile,simFile,obsFile,iKey) #plt2 绘制2016-2018年9个陆地站每个台风的最大风速与观测对比+RMSE plt2 = plotCase.plotCaseVmaxSpdValidationSubplot(dictInfo) #plt3 = plotCase.plotCaseVmaxSpdSubplot(dictInfo,"allWeatherStationVmaxSimTyCase.png") #plt4 = plotCase.plotCaseVmaxSpdSubplot(dictInfo2,"allWindFarmVmaxSimTyCase.png")