First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

Is there an API call to get existing Channel arrays directly into Python?

asked Jul 31 '0

bronco7TX gravatar image

I'm trying to load all existing channel data (ID, name, desc) from a snapshot into a python dictionary so it can be searched to avoid adding duplicate channels later on in my script. Is there any way to get the data from the API directly into a list or dict array?

All I've found is the following process:

psspy.report_output(2,"chan.txt",[1,0])
ierr = psspy.dlst(1,5)
# then open the text file chan.txt
# then parse the text in the report to build my list/dict manually

It would be ideal if I could avoid the cumbersome process of saving out a text report only to read it back in and split the text into a usable Python dictionary. I was hoping there was an API that had the data come out in arrays directly similar to the PSSARRAYS functions for ACCC data.

1 answer

Sort by » oldest newest most voted
0

answered Aug 23 '0

oppossumX gravatar image

There is the dyntools API. I have only used it to process that kind of data from .out files, not snapshots so I am not sure it can do exactly what you are looking for. The help(dyntools) documentation is probably worth a look.

link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Jul 31 '0

Seen: 1,078 times

Last updated: Aug 22 '20