PyTuflow: Difference between revisions
Content deleted Content added
Ellis Symons (talk | contribs) |
Ellis Symons (talk | contribs) No edit summary |
||
Line 66:
|''tuple'' Profile Data ( ''list'' x values, ''list'' y values )
|-
|rowspan='2'|<b>[[#
|rowspan='2'|Returns the time of maximum water level along the current profile. Note getLongProfileData method must be called prior to calling this method
|''list'' x values
Line 178:
|''float'' Time (hrs)
|-
|rowspan='3'|<b>[[#timeOfMaximumTimestepChange|timeOfMaximumTimestepChange]] (</b> ''str'' Element, ''str'' Result Type, [optional] ''str'' Domain <b>)</b>
|rowspan='3'|Returns the time of maximum for 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 577:
</pre>
==getLongProfileTimeOfMaximum==
<b>
Returns the time of maximum water level along the current profile. Note getLongProfileData method must be called prior to calling this method<br>
;Parameters:
Line 1,521:
# print to console
print('Time of max water level at {0} is {1} hrs'.format(channel, tom)
else:
# did not load correctly, print error message to console
print(message)
</pre>
==timeOfMaximumTimestepChange==
<b>timeOfMaximumTimestepChange (</b> Element, Result Type, [optional] Domain <b>)</b><br>
Returns the time of maximum for 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 time of 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''
:: Time of maximum value change
'''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'
tom_ts = res.timeOfMaximumTimestepChange(channel, 'Q')
# print to console
print('Time of max flow change in any given timestep at {0} is {1} hrs'.format(loc, tom_ts)
else:
# did not load correctly, print error message to console
| |||