Python Scrpit to Compute the Maximum Mass Flux

import TecUtil

import TecVals

from TecVals import *

xnum = TecUtil.DialogGetSimpleText( \

"Enter the variable number for x, as shown in Data > Data Set Info...", "1")

ynum = TecUtil.DialogGetSimpleText( \

"Enter the variable number for y, as shown in Data > Data Set Info...", "2")

znum = TecUtil.DialogGetSimpleText( \

"Enter the variable number for z, as shown in Data > Data Set Info...", "3")

vnum = TecUtil.DialogGetSimpleText( \

"Enter the variable number for which the max will be determined", "25")

zonenum = TecUtil.DialogGetSimpleText("Enter the zone number", "1")

xnum = int(xnum[1])

ynum = int(ynum[1])

znum = int(znum[1])

vnum = int(vnum[1])

zonenum = int(zonenum[1])

# xnum = 1

# ynum = 2

# znum = 3

# vnum = 25

# zonenum = 1

xTec360 = TecUtil.IOrderedDataValuesGet(zonenum, xnum)

yTec360 = TecUtil.IOrderedDataValuesGet(zonenum, ynum)

zTec360 = TecUtil.IOrderedDataValuesGet(zonenum, znum)

valTec360 = TecUtil.IOrderedDataValuesGet(zonenum, vnum)

maxval = max(valTec360)

imax = valTec360.index(max(valTec360))

MaxInfo = 'Val = %(v)f at x=%(x)f, y=%(y)f, z=%(z)f' % \

{'x': xTec360[imax], 'y': yTec360[imax],'z': zTec360[imax], 'v': maxval}

Results = TecUtil.DialogMessageBox(MaxInfo, MessageBox_Information)