Ask Your Question
0

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

asked 2020-07-31 13:07:27 -0500

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-08-22 20:28:12 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2020-07-31 13:07:27 -0500

Seen: 325 times

Last updated: Aug 22 '20