PyTuflow: Difference between revisions
Content deleted Content added
Ellis Symons (talk | contribs) |
Ellis Symons (talk | contribs) No edit summary |
||
Line 102:
|''float'' Maximum Value
|-
|rowspan='3'|<b>[[#maximumTimestepChange|maximumTimestepChange]] (</b> ''str'' Element, ''str'' Result Type, [optional] ''str'' Domain <b>)</b>
|rowspan='3'|Returns the maximum change in result value in one timestep for the given element (RL elements supported only) for the given result type. If there are duplicate names between 1D, PO, or RL elements it will give priority return to 1D elements first, PO elements second, and lastly RL elements unless 'domain' variable is explicitly specified (domain options: '1D', '2D', 'RL')
|''bool'' Error
Line 992:
# print to console
print('Max water level at {0} is {1} mRL'.format(node, maximum)
else:
# did not load correctly, print error message to console
print(message)
</pre>
==maximumTimestepChange==
<b>maximumTimestepChange (</b> Element, Result Type, [optional] Domain <b>)</b><br>
Returns the maximum change in result value in one timestep for the given element (RL elements supported only) for the given result type. If there are duplicate names between 1D, PO, or RL elements it will give priority return to 1D elements first, PO elements second, and lastly RL elements unless 'domain' variable is explicitly specified (domain options: '1D', '2D', 'RL')<br>
;Parameters:
: '''Element:''' ''str''
:: RL element to get maximum change in a single timestep for. Currently RL elements are the only supported type.
: '''Result Type:''' ''str''
:: Result type e.g. 'H'
: '''Domain:''' ''str''
:: Optional input to specify which domain the Element belongs in. If left as default (None) and there are duplicate names between 1D, PO, or RL elements it will give priority return to 1D elements first, PO elements second, and lastly RL elements.
;Returns:
: '''Error:''' ''bool''
:: Returns False on success, True when an error occurred
: '''Message:''' ''str''
:: Accompanying error message if an error occurred
: '''Maximum''' ''float''
:: Maximum change in any given timestep
'''Example'''<br>
<pre>
import pytuflow as tu
# Initialise result class
res = tu.ResData()
# load .tpc result file
path = r'C:\TUFLOW\results\M04_5m_001.tpc'
err, message = res.load(path)
# check results were loaded successfully before calling function
if not err:
loc = 'Reporting Location 1'
tsMaximum = res.maximum(channel, 'Q')
# print to console
print('Max flow change in any given timestep at {0} is {1} m3/s'.format(loc, tsMaximum)
else:
# did not load correctly, print error message to console
| |||