.out output file + excel
Easy to load .out files into Excel? Not sure where to look at all. Can anyone give pointers?
I opened a .out file with Microsoft Wordpad and it was a jumble of letters and numbers and exclamation marks.
thanks ahead
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
Easy to load .out files into Excel? Not sure where to look at all. Can anyone give pointers?
I opened a .out file with Microsoft Wordpad and it was a jumble of letters and numbers and exclamation marks.
thanks ahead
You can not do it. .out is a binary file, you can not open with excel, notepad or any program different that PSSE.
PSSE has a tool to export the data to excel file.
Regards, Waltter
EDITED Example to export to excel
import os
import sys
import numpy as np
# Ajustamos las variables de entorno para el PSSE
sys.path.insert(0,r"C:\Archivos de programa\PTI\PSSE33\PSSBIN")
os.environ['PATH'] = r"C:\Archivos de programa\PTI\PSSE33\PSSBIN" + ";" + os.environ['PATH']
import excelpy
import dyntools
# Para la información de las frecuencias
contingenciaf = ["Contingencia"]
nodos = ["nodo"]
nfmin = ["fmin"]
nfmax = ["fmax"]
nffinal = ["ffinal"]
"""
Comienza a extraer la información para cada uno de los *.out
"""
OutNames = [Out1, Out2]
Ruta = os.getcwd()
for OutName in OutNames:
rootDir = Ruta + "\\"
logFile = file(rootDir + "Reporte_" + OutName + "_Din.txt", "w")
logFile1 = file(rootDir + "Errores_" + OutName + "_Din.txt", "w")
sys.stdout = logFile # Las salidas
sys.stderr = logFile1 # Los errores
outFile = dyntools.CHNF(OutName + ".out")
#Extrae información del archivo *.out
short_title, chanid_dict, chandata_dict = outFile.get_data()
# Datos de las frecuencias
freq_chanList = range(51, 62)
for freqchan in freq_chanList:
frecuencia = np.add(np.multiply(np.array(chandata_dict[freqchan]), 60), 60)
nfmin.append(frecuencia.min())
nfmax.append(frecuencia.max())
nffinal.append(frecuencia[len(frecuencia) - 1])
nodos.append(chanid_dict[freqchan])
for n in range(1,(len(freq_chanList) + 1)):
contingenciaf.append(OutName)
logFile.close()
logFile1.close()
""" Crea los reportes en formato csv """
reporte = Ruta + '\\' + u'InfoDinámica.xlsx'
xl = excelpy.workbook(xlsfile=reporte, sheet="Frecuencia",
overwritesheet=True, mode='w')
xl.show_alerts(False)
# Reporte de Frecuencias
xl.worksheet_add_end(sheet="Frecuencia")
xl.set_range(1, 'a', zip(contingenciaf))
xl.set_range(1, 'b', zip(nodos))
xl.set_range(1, 'c', zip(nfmin))
xl.set_range(1, 'd', zip(nfmax))
xl.set_range(1, 'e', zip(nffinal))
xl.save(reporte)
xl.close()
@waltterval - is there any way to read the .out with PSSE and Python?
@JervisW Yes it is. You can use the module dyntool to read the .out, then you can use excelpy to export to excel or matplotlib to graph, etc. I will edit my answer with an example.
Hello Walter, can you explain the line code: freq_chanList = range(51, 62) What's the meaning of (51, 62)? Why this values? It´s for the channel number in OUT file? And in: frecuencia = np.add(np.multiply(np.array(chandata_dict[freqchan]), 60), 60), What's the meaning of 60), 60)? Gracias ;)
Asked: 2012-11-21 05:03:26 -0500
Seen: 5,540 times
Last updated: Nov 26 '12