Python Library TUFLOW Results: Difference between revisions
Content deleted Content added
m Par moved page Python Library TUFLOW Results 2016 to Python Library TUFLOW Results: Renamed library |
|||
Line 154:
=Examples=
These examples
==Plot Flow in Channel==
<pre>
Line 161:
import matplotlib.pyplot as plt
import TUFLOW_results
input_res = r'C:\TUFLOW\Models\Tutorials\QGIS\Complete_Model\TUFLOW\results\M04\2d\plot\M04_5m_001.tpc'
# initialise the results class
Line 178 ⟶ 180:
#Get flow data
chan_id = 'ds3' # this is the channel ID to use
found, results, message = res.
if found:
print
# plot data
ax1.plot(res.times,results,color='b',label='Flow - '+chan_id)
else:
print
sys.exit()
Line 214 ⟶ 216:
#Get water level data
for node_id in node_ids: #for each node in the list above
found, results, message = res.
if found:
print
# plot data
ax1.plot(res.times,results,label='Level - '+node_id)
else:
print
sys.exit()
Line 248 ⟶ 250:
#Get flow data
found, results, message = res.
if found:
print
ax1.plot(res.times,results,color='b',label='Flow - '+chan_id)
else:
print
sys.exit()
#Get velocity data
found, results, message = res.
if found:
print
ax2.plot(res.times,results,color='r',label='Velocity - '+chan_id)
else:
print
sys.exit()
Line 289 ⟶ 291:
error, message = res.LP_getConnectivity(us_chan,ds_chan)
if error:
print
sys.exit()
else:
print
print
error, message = res.LP_getStaticData()
if error:
print
sys.exit()
else:
print
#create plot
| |||