本文整理汇总了Python中Plugins.showMsgBox方法的典型用法代码示例。如果您正苦于以下问题:Python Plugins.showMsgBox方法的具体用法?Python Plugins.showMsgBox怎么用?Python Plugins.showMsgBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins.showMsgBox方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeoutlier
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def removeoutlier():
if len(ep.EpmDatasetPens.SelectedPens) != 1:
ep.showMsgBox("EPM - Histograma",
"Execute a consulta do Dataset Analysis \n e selecione uma pena antes de aplicar a funcao.",
"Warning")
return 0
epm_tag = ep.EpmDatasetPens.SelectedPens[0].Values
FATOR = 1.5
values = epm_tag["Value"]
q3, q1 = np.percentile(values, [75, 25])
iqr = q3 - q1
lowpass = q1 - (iqr * FATOR)
highpass = q3 + (iqr * FATOR)
epmarray = np.dtype([('Value','>f8'),('Timestamp','object'),('Quality','object')])
print data
ep.plotValues('No_Outliers',values)
示例2: histograma
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def histograma():
# Verifica se existe apenas uma pena selecionada no Dataset Analysis.
if len(ep.EpmDatasetPens.SelectedPens) != 1:
ep.showMsgBox("EPM - Histograma",
"Execute a consulta do Dataset Analysis \n e selecione uma pena antes de aplicar a funcao.",
"Warning")
return 0
# Passa para a variavel 'epm_tag' a variavel selecionada.
epm_tag = ep.EpmDatasetPens.SelectedPens[0].Values
x = epm_tag["Value"]
mu = epm_tag["Value"].mean() # Mediana da amostra
sigma = epm_tag["Value"].std() # Desvio padrao da amostra
# Quantidade de valores que desejamos agrupar. (barras verdes)
num_bins = 20
# Gera o histograma
n, bins, ignore = plt.hist(x, num_bins, normed=1, facecolor='green', alpha=0.5)
# Adiciona uma linha indicando a curva de normalidade (vermelha tracejada)
y = mlab.normpdf(bins, mu, sigma)
plt.plot(bins, y, 'r--')
plt.title("Histograma \n $\mu=" + "{:.3f}".format(mu) + "$, $\sigma=" + "{:.3f}".format(sigma) + "$")
# Mostra na tela o gráfico
plt.subplots_adjust(left=0.15)
plt.show()
示例3: windSpeedPowerChart
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def windSpeedPowerChart():
"""Grafico de potencia com a velocidade do vento
Apresenta um grafico de dispersao da potencia com a velocidade do vento e calcula a curva que melhor o representa
"""
if len(ep.EpmDatasetPens.SelectedPens) != 2:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select two interpolated pens before applying this function!', 'Warning')
return 0
global minSpeed
global nominalPower
runDialogMinSpeedNomPower()
minSpeed = float(minSpeed)
nominalPower = float(nominalPower)
rawSpeed, rawPower = getSpeedPowerValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1])
speed, power = cleanSpeedPowerData(rawSpeed, rawPower, minSpeed, nominalPower )
xm, ym = windPowerAverage(speed, power)
par0 = [1.0, 1.0, 1500.0, 1.0]
binSpeed = 0.5
parest,cov,infodict,mesg,ier = optimize.leastsq(residualsSPPn4, par0, args=(xm, ym), full_output=True)
xEst = np.arange(xm.min(), xm.max(), binSpeed)
yEst = powerFitPn4(parest, xEst)
posAbove = np.argwhere(yEst > nominalPower)
yEst[posAbove] = nominalPower
fig1 = plt.figure()
ax1 = fig1.add_subplot(1, 1, 1)
ax1.set_ylim(0, 1.05*nominalPower)
ax1.set_xlim(minSpeed-1, 1.1*speed.max())
ax1.set_xlabel(r'$Speed (m/s)$')
ax1.set_ylabel(r'$Power (KW)$')
ax1.scatter(speed, power)
ax1.plot(xEst, yEst, color='r', linewidth=3)
plt.show()
示例4: windDirectionPieChart
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def windDirectionPieChart():
"""Grafico de pizza da direcao do vento
Apresenta um grafico de pizza baseado no percentual de tempo da direcao do vento
"""
if len(ep.EpmDatasetPens.SelectedPens) != 1:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select one pen before applying this function!', 'Warning')
return 0
rawDirection = ep.EpmDatasetPens.SelectedPens[0]
nodesPercents, nodesLabels = percentTimeIn(rawDirection.Values)
colors = ['blue','yellowgreen', 'cyan', 'gold', 'lightskyblue', 'magenta', 'green', 'lightcoral']
plt.pie(nodesPercents[:,1], labels=nodesLabels, colors=colors,autopct='%1.1f%%', shadow=False, startangle=90)
plt.axis('equal')
plt.show()
示例5: PolarScatterWindDirection
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def PolarScatterWindDirection():
"""Grafico polar de dispersao da direcaodo vento
Apresenta um grafico polar de dispersao com a direcao do vento
"""
if len(ep.EpmDatasetPens.SelectedPens) != 2:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 2 interpolated pens before applying this function!', 'Warning')
return 0
speed, direction = getSpeedDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1])
ax1 = plt.subplot(111, polar=True)
ax1.set_theta_zero_location('N')
ax1.set_theta_direction(-1)
ax1.grid(True)
ax1.xaxis.set_ticklabels(['N',r"$45^{o}$",'E',r"$135^{o}$",'S',r"$225^{o}$",'W', r"$315^{o}$"])
ax1.set_title("Wind direction", va='bottom')
ax1.plot(direction, speed, 'bo')
plt.show()
示例6: PolarScatterAreaWind
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def PolarScatterAreaWind():
"""Grafico polar de dispersao-area da direcao, velocidade e potencia do vento
Apresenta um grafico polar de dispersao com a direcao, a velocidade e potencia do vento
"""
if len(ep.EpmDatasetPens.SelectedPens) != 3:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 3 interpolated pens before applying this function!', 'Warning')
return 0
speed, direction, power = getSpeedPowerDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1],
ep.EpmDatasetPens.SelectedPens[2])
colors = power/1000.
area = np.pi * speed**2
ax1 = plt.subplot(111, polar=True)
ax1.set_theta_zero_location('N')
ax1.set_theta_direction(-1)
ax1.xaxis.set_ticklabels(['N',r"$45^{o}$",'E',r"$135^{o}$",'S',r"$225^{o}$",'W', r"$315^{o}$"])
c = plt.scatter(direction, speed, c=colors, s=area, cmap=plt.cm.hsv)
c.set_alpha(0.75)
plt.show()
示例7: thirtyDaysProfilePlugin
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def thirtyDaysProfilePlugin():
"""
Gera uma superfície para avaliar a variação diária e ao longo do mês (30 dias).
Dados devem corresponder a uma consulta com 30 dias e serem interpolados (ProcessingInterval < 1h).
"""
if len(ep.EpmDatasetPens.SelectedPens) != 1:
ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select a single pen before applying this function!', 'Warning')
return 0
epmData = ep.EpmDatasetPens.SelectedPens[0].Values
sampling = 30
pHours = 24
iniPeriod = epmData['Timestamp'][0]
endPeriod = epmData['Timestamp'][-1]
dTotal = endPeriod - iniPeriod
totDays = dTotal.days
evalPeriod = dt.timedelta(hours = pHours)
nextPeriod = iniPeriod + evalPeriod
profileList = []
for i in range(totDays+1):
iniP = epmData['Timestamp'] >= iniPeriod
endP = epmData['Timestamp'] < nextPeriod
epmDataValue = epmData['Value']
dataPeriod = epmDataValue[iniP * endP]
profileList.append( dataPeriod )
iniPeriod = iniPeriod + dt.timedelta( 1 )
nextPeriod = iniPeriod + evalPeriod
profileMatrix = np.array(profileList)
days = np.arange(totDays)+1
hours = np.arange(0,pHours*60,sampling)
meshTime, indices = np.meshgrid(hours, days)
meshProfile = np.zeros(meshTime.shape)
for i in range( indices.shape[0] ):
for j in range( indices.shape[1] ):
meshProfile[i,j] = profileMatrix[i,j]
fig = plt.figure(figsize=(15, 8))
ax = fig.gca(projection='3d')
X = meshTime
Y = indices
Z = meshProfile
ax.plot_surface(X/60., Y, Z, rstride=1, cstride=1, cmap='coolwarm', alpha=0.8)
ax.set_xlabel('hour')
ax.set_ylabel('day')
ax.set_zlabel('Power')
plt.show()
示例8: PowerCurve3d
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def PowerCurve3d():
"""Grafico de dispersão em 3D"""
if len(ep.EpmDatasetPens.SelectedPens) != 3:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 3 interpolated pens before applying this function!', 'Warning')
return 0
speed, direction, power = getSpeedPowerDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1],
ep.EpmDatasetPens.SelectedPens[2])
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
c = np.abs(speed)
cmwinter = plt.get_cmap("winter")
ax.scatter(speed, direction, power, c=c, cmap=cmwinter)
ax.set_xlabel('Power (KW)')
ax.set_ylabel('Direction')
ax.set_zlabel('Speed (m/s)')
plt.show()
示例9: PolarBarWind
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def PolarBarWind():
"""Grafico de polar de barras da direcao, velocidade e potencia do vento
Apresenta um grafico polar de dispersao com a direcao, a velocidade e potencia do vento
"""
if len(ep.EpmDatasetPens.SelectedPens) != 3:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select 3 interpolated pens before applying this function!', 'Warning')
return 0
speed, direction, power = getSpeedPowerDirectionValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1],
ep.EpmDatasetPens.SelectedPens[2])
spd4, dir4, pow4 = groupByDirection(speed, direction, power)
width = pow4/1000.
ax1 = plt.subplot(111, polar=True)
ax1.set_theta_zero_location('N')
ax1.set_theta_direction(-1)
ax1.xaxis.set_ticklabels(['N',r"$45^{o}$",'E',r"$135^{o}$",'S',r"$225^{o}$",'W', r"$315^{o}$"])
bars = ax1.bar(dir4, spd4, width=width, bottom=0.0)
for r, bar in zip(spd4, bars):
bar.set_facecolor(plt.cm.jet(r / 10.))
bar.set_alpha(0.5)
plt.show()
示例10: suplierSpeedPowerChart
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def suplierSpeedPowerChart():
"""Grafico de potencia com a velocidade do vento comparada com a cruva do fornecedor em um arquivo CSV
Apresenta um grafico de dispersao da potencia com a velocidade do vento, calculan a curva que melhor o representa e compara com a curva
de referencia fornecida pelo fornecedor
"""
if len(ep.EpmDatasetPens.SelectedPens) != 2:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select two interpolated pens before applying this function!', 'Warning')
return 0
global minSpeed
global nominalPower
global supplierCurveFile
runDialogMinSpeedNomPowerSupplier()
minSpeed = float(minSpeed)
nominalPower = float(nominalPower)
rawSpeed, rawPower = getSpeedPowerValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1])
speed, power = cleanSpeedPowerData(rawSpeed, rawPower, minSpeed, nominalPower )
xm, ym = windPowerAverage(speed, power)
par0 = [1.0, 1.0, 1500.0, 1.0]
binSpeed = 0.5
parest,cov,infodict,mesg,ier = optimize.leastsq(residualsSPPn4, par0, args=(xm, ym), full_output=True)
xEst = np.arange(xm.min(), xm.max(), binSpeed)
yEst = powerFitPn4(parest, xEst)
posAbove = np.argwhere(yEst > nominalPower)
yEst[posAbove] = nominalPower
speedRef, powerRef = readFromCsv(fileName=supplierCurveFile, delimiter=';')
tckRef = interpolate.splrep(speedRef, powerRef, s=0)
binSpeed = 0.5
xRef = np.arange(speedRef.min(), speedRef.max(), binSpeed)
yRef = interpolate.splev(xRef, tckRef, der=0)
energyLost = integrate.simps(yRef, dx=binSpeed) - integrate.simps(yEst, dx=binSpeed)
fig1 = plt.figure()
ax1 = fig1.add_subplot(1, 1, 1)
ax1.set_ylim(0, 1.05*nominalPower)
ax1.set_xlim(minSpeed-1, 1.1*speed.max())
ax1.set_xlabel(r'$Speed (m/s)$')
ax1.set_ylabel(r'$Power (KW)$')
ax1.scatter(speed, power)
ax1.plot(xEst, yEst, color='r', linewidth=3)
ax1.plot(xRef, yRef, color='g', linewidth=3)
ax1.text(15, 1100, 'Lost: ' + str(round(energyLost/1000,2)) + '(MW)', fontsize=14)
plt.show()
示例11: ExpectedProduction
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def ExpectedProduction():
if len(ep.EpmDatasetPens.SelectedPens) != 2:
ep.showMsgBox('EPM Python Plugin - Demo Tools', 'Please select Power and Speed pens before applying this function!', 'Warning')
return 0
global minSpeed
global nominalPower
global supplierCurveFile
runDialogMinSpeedNomPowerSupplier()
minSpeed = float(minSpeed)
nominalPower = float(nominalPower)
rawSpeed, rawPower = getSpeedPowerValues(ep.EpmDatasetPens.SelectedPens[0], ep.EpmDatasetPens.SelectedPens[1])
speed, power = cleanSpeedPowerData(rawSpeed, rawPower, minSpeed, nominalPower )
speedRef, powerRef = readFromCsv(fileName=supplierCurveFile, delimiter=';')
#idx = []
#for item in speed:
# idx.append(find_nearest(speedRef, item)
idx = [find_nearest(speedRef, item) for item in speed]
expected = [powerRef[index] for index in idx]
#TODO: Calculo de perdas
#lost = sum(expected - power)
#print lost
fig, ax = plt.subplots()
line1 = ax.plot(power, label='Realized')
line2 = ax.plot(expected, label='Expected')
plt.ylabel('Power (Kw)')
plt.xlabel('Time Unit')
ax.legend(loc='lower right')
plt.show()
示例12: xyzScatter3DPlugin
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def xyzScatter3DPlugin():
"""
Apresenta gráficos de dispersão comparando 3 variáves entre si duas a duas e as 3 simultaneamente.
Os dados das 3 variáveis devem estar igualmente espaçados.
"""
if len(ep.EpmDatasetPens.SelectedPens) != 3:
ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select 3 pens before applying this function!', 'Warning')
return 0
epmDataX = ep.EpmDatasetPens.SelectedPens[0].Values['Value']
Xlabel = ep.EpmDatasetPens.SelectedPens[0].Name
epmDataY = ep.EpmDatasetPens.SelectedPens[1].Values['Value']
Ylabel = ep.EpmDatasetPens.SelectedPens[1].Name
epmDataZ = ep.EpmDatasetPens.SelectedPens[2].Values['Value']
Zlabel = ep.EpmDatasetPens.SelectedPens[2].Name
fig = plt.figure(figsize=(15, 8))
ax1 = plt.subplot2grid((3, 3), (0, 0))
ax2 = plt.subplot2grid((3, 3), (0, 1))
ax3 = plt.subplot2grid((3, 3), (0, 2))
ax4 = plt.subplot2grid((3, 3), (1, 0), colspan=3, rowspan=3, projection='3d')
x = (epmDataX-epmDataX.mean())/epmDataX.std()
y = (epmDataY-epmDataY.mean())/epmDataY.std()
z = (epmDataZ-epmDataZ.mean())/epmDataZ.std()
ax1.scatter(x, y)
ax1.set_xlabel(Xlabel, fontsize=10)
ax1.set_ylabel(Ylabel, fontsize=10)
ax2.scatter(x, z)
ax2.set_xlabel(Xlabel, fontsize=10)
ax2.set_ylabel(Zlabel, fontsize=10)
ax3.scatter(y, z)
ax3.set_xlabel(Ylabel, fontsize=10)
ax3.set_ylabel(Zlabel, fontsize=10)
#ax4.scatter(x, y, z, cmap='hot')
ax4.scatter(x, y, z)
ax4.set_xlabel(Xlabel, fontsize=10)
ax4.set_ylabel(Ylabel, fontsize=10)
ax4.set_zlabel(Zlabel, fontsize=10)
plt.tight_layout(pad=0.5, w_pad=0.5, h_pad=1.0)
plt.show()
示例13: fiveDaysProfilePlugin
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import showMsgBox [as 别名]
def fiveDaysProfilePlugin():
"""
Gráfico de área do perfil diário médio da variável a partir de dados de 5 dias.
Dados devem corresponder a uma consulta de 5 dias (úteis) com valores médios a cada hora.
"""
if len(ep.EpmDatasetPens.SelectedPens) != 1:
ep.showMsgBox('EPM Python Plugin - Demo Power', 'Please select a single pen before applying this function!', 'Warning')
return 0
def cc(arg): return colorConverter.to_rgba(arg, alpha=0.6)
epmDataValue = ep.EpmDatasetPens.SelectedPens[0].Values['Value']
epmAvg = np.vstack((epmDataValue[0:24], epmDataValue[24:2*24], epmDataValue[2*24:3*24], epmDataValue[3*24:4*24], epmDataValue[4*24:5*24]))
epmAvg = epmAvg.mean(axis=0)
epmAvg[0], epmAvg[-1] = 0,0
ys = np.arange(1, 25)
zs = [0., 1., 2., 3., 4., 5.]
profileList = []
profileList.append( list(zip(ys, epmAvg)))
ini = 0
end = 24
for i in range(5):
dataPeriod = epmDataValue[ini:end]
dataPeriod[0], dataPeriod[-1] = 0,0
profileList.append( list(zip(ys, dataPeriod)))
ini += 24
end += 24
poly = PolyCollection(profileList, facecolors=[cc('k'), cc('r'), cc('g'), cc('b'), cc('y'), cc('c')])
fig = plt.figure(figsize=(15, 8))
ax = fig.gca(projection='3d')
poly.set_alpha(0.7)
ax.add_collection3d(poly, zs=zs, zdir='y')
ax.set_xlabel('hour')
ax.set_xlim3d(1, 24)
ax.set_ylabel('day')
ax.set_ylim3d(-1, 6)
ax.set_zlabel('power')
ax.set_zlim3d(epmDataValue.min(), epmDataValue.max())
plt.show()