Ask Your Question

output starting channel index

asked 2020-01-16 13:38:08 -0500

Ascegan gravatar image

Is there an API to output the starting channel index in v33? It's displayed, along with CONS, STATES, etc under "elements restored" after RSTR, and I know many functions use "-1" to automatically write to the next channel #, but I'd like to obtain the channel value itself.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-01-17 07:41:08 -0500

perolofl gravatar image

updated 2020-01-17 09:26:23 -0500

There is no API in PSSE for that. I have written my own "API", as shown below:

def get_last_channel():
    """ Returns last used channel number.
    for n in range(1,999999):
        ierr, rval = psspy.chnval(n)
        if ierr == 9:
            print 'Dynamics data not present in working memory'
            return None
        if ierr > 0: break
    return n-1

You can get the number of channels with:

nchan = get_last_channel()
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


Asked: 2020-01-16 13:38:08 -0500

Seen: 49 times

Last updated: Jan 17