Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to extract out file and plot with matplotlib

Hi all,

I have some issue to plot out file with matplotlib. Here is the code i've used.

outfile=tk.askopenfilename(title="Select a .out file",filetypes=(("PSS/E outfile",".out"),("all files",".*")))

Run dyntools to extract the data

chnfobj = dyntools.CHNF(outfile)

shorttitle, chaniddict, chandatadict = chnfobj.getdata()

Extract time as a variable

time = chandata_dict ['time']

f = chandata_dict['freq']

Here is the error Traceback (most recent call last): File "C:\Users\dyntoolstest.py", line 34, in <module> f = chandata_dict['freq'] KeyError: 'freq'

What should i put in [] of f ?

Thank you in advance.

click to hide/show revision 2
No.2 Revision

how to extract out file and plot with matplotlib

Hi all,

I have some issue to plot out file with matplotlib. Here is the code i've used.

outfile=tk.askopenfilename(title="Select a .out file",filetypes=(("PSS/E outfile",".out"),("all files",".*")))

outfile","*.out"),("all files","*.*")))

### Run dyntools to extract the data

data### chnfobj = dyntools.CHNF(outfile) short_title, chanid_dict, chandata_dict = chnfobj.get_data()

chnfobj = dyntools.CHNF(outfile)

shorttitle, chaniddict, chandatadict = chnfobj.getdata()

### Extract time as a variable

variable### time = chandata_dict ['time']

['time']

f = chandata_dict['freq']

chandata_dict['freq']

Here is the error error

Traceback (most recent call last):
  File "C:\Users\dyntoolstest.py", line 34, in <module>
    f = chandata_dict['freq']
KeyError: 'freq'

'freq'

What should i put in [] of f ?

Thank you in advance.