<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tuflow.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Par</id>
	<title>Tuflow - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tuflow.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Par"/>
	<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/Special:Contributions/Par"/>
	<updated>2026-04-29T08:56:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3002&amp;diff=45878</id>
		<title>TUFLOW Message 3002</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3002&amp;diff=45878"/>
		<updated>2026-04-22T00:45:37Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 3002 - Non-CUDA_SUCCESS code returned ERROR 3002: Check that you have the correct NVIDIA driver installed &amp;lt;br&amp;gt;&lt;br /&gt;
|alt_msg= ERROR 3002 - HPC has reported an error - see .hpc.tlf&amp;lt;br&amp;gt;&lt;br /&gt;
|type=[[ERROR]] &lt;br /&gt;
|message_desc=The GPU driver appears to be installed, but one of the following has occurred:&lt;br /&gt;
* The GPU driver failed to initialise.&lt;br /&gt;
* A compute context could not be created on the selected device.&lt;br /&gt;
* The ptx code could not be compiled for the selected device. (TUFLOW 2025 and earlier)&lt;br /&gt;
&lt;br /&gt;
|suggestions=&lt;br /&gt;
* Check that the .ptx files (TUFLOW 2025 and earlier) or .fatbin files (TUFLOW 2026 onwards) are in the same directory as the TUFLOW executable (there should be four of them). If needed, download the release again from the website.&lt;br /&gt;
* Upgrade to the latest NVidia drivers for your system from the NVIDIA website.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[3xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3704&amp;diff=45650</id>
		<title>TUFLOW Message 3704</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3704&amp;diff=45650"/>
		<updated>2026-03-25T05:29:55Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=ERROR 3704 - CATCH models require at least one groundwater layer. |alt_msg=NA |type=ERROR |message_desc=TUFLOW CATCH models require one or more groundwater layers. |suggestions=Include at least one vertical groundwater layer in the the HPC Catchment Hydraulic Model. |uplink=3xxx Messages }}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 3704 - CATCH models require at least one groundwater layer.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=TUFLOW CATCH models require one or more groundwater layers.&lt;br /&gt;
|suggestions=Include at least one vertical groundwater layer in the the HPC Catchment Hydraulic Model.&lt;br /&gt;
|uplink=[[3xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0055&amp;diff=45648</id>
		<title>TUFLOW Message 0055</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0055&amp;diff=45648"/>
		<updated>2026-03-25T03:55:20Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=WARNING 0055 - ulimit is low and this could SIGSEGV issues to occur. |alt_msg=NA |type=WARNING &amp;lt;br&amp;gt;  |message_desc=This message only occurs for TUFLOW on Linux.&amp;lt;br&amp;gt; When running on Linux, TUFLOW checks the stack size limits.  If the soft limit is less than 100MB TUFLOW will issue WARNING 0055. On Windows a stack size for the executable is set at 100MB. |suggestions=If the soft stack limit is too small, this can TUFLOW to crash with SI...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 0055 - ulimit is low and this could SIGSEGV issues to occur.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[WARNING]] &amp;lt;br&amp;gt; &lt;br /&gt;
|message_desc=This message only occurs for TUFLOW on Linux.&amp;lt;br&amp;gt;&lt;br /&gt;
When running on Linux, TUFLOW checks the stack size limits.  If the soft limit is less than 100MB TUFLOW will issue WARNING 0055. On Windows a stack size for the executable is set at 100MB.&lt;br /&gt;
|suggestions=If the soft stack limit is too small, this can TUFLOW to crash with SIGSEGV (segmentation fault) to occur.  If this occurs, raise the stack limit by increasing the ulimit.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2629&amp;diff=45647</id>
		<title>TUFLOW Message 2629</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2629&amp;diff=45647"/>
		<updated>2026-03-25T03:17:27Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=ERROR 2629 - Counted no rainfall hyetographs. |alt_msg=NA |type=ERROR |message_desc=This error message only occurs if using a TUFLOW Rainfall Control File (.trfc). When reading rainfall hyetographs from &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read GIS RF Polygons&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; and &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read GIS RF Points&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; no hyetographs were found. |suggestions=Ensure the rainfall hyetographs have been specified with either 2d_rf point or po...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 2629 - Counted no rainfall hyetographs.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=This error message only occurs if using a TUFLOW Rainfall Control File (.trfc). When reading rainfall hyetographs from &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read GIS RF Polygons&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; and &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read GIS RF Points&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; no hyetographs were found.&lt;br /&gt;
|suggestions=Ensure the rainfall hyetographs have been specified with either 2d_rf point or polygon objects.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2628&amp;diff=45646</id>
		<title>TUFLOW Message 2628</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2628&amp;diff=45646"/>
		<updated>2026-03-25T03:13:20Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 2628 - Rainfall polygons contain a mix of named and non named.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=This error message only occurs if using a TUFLOW Rainfall Control File (.trfc) with &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Poly&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;. If all rainfall polygons contain names, then rainfall points are not used. If all rainfall polygons are have blank names then rainfall points are used.  However, mixing named and non named rainfall polygons is not possible - this causes ERROR 2628 to be issued.&lt;br /&gt;
|suggestions=Either apply names to all polygons and use polygon attributes, or set all polygons to blank names and use rainfall points.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2627&amp;diff=45645</id>
		<title>TUFLOW Message 2627</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2627&amp;diff=45645"/>
		<updated>2026-03-25T03:09:05Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 2627 - Using Rainfall Polygons attributes and ignoring points.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=This warning message only occurs if using a TUFLOW Rainfall Control File (.trfc) with &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Poly&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;. If all rainfall polygons contain names, then rainfall points are not used and WARNING 2627 is issued.&lt;br /&gt;
|suggestions=Rainfall points are not required or used when rainfall polygons with attributes are specified and these can be removed from the .trfc file.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2627&amp;diff=45644</id>
		<title>TUFLOW Message 2627</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2627&amp;diff=45644"/>
		<updated>2026-03-25T03:06:07Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 2627 - Using Rainfall Polygons attributes and ignoring points.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[CHECK]]&lt;br /&gt;
|message_desc=This warning message only occurs if using a TUFLOW Rainfall Control File (.trfc) with &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Poly&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;. If all rainfall polygons contain names, then rainfall points are not used and WARNING 2627 is issued.&lt;br /&gt;
|suggestions=Rainfall points are not required or used when rainfall polygons with attributes are specified and these can be removed from the .trfc file.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2626&amp;diff=45643</id>
		<title>TUFLOW Message 2626</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2626&amp;diff=45643"/>
		<updated>2026-03-25T03:02:57Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=CHECK 2626 - Rainfall polygon names are blank, will use point attributes for names and rf factors.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[CHECK]]&lt;br /&gt;
|message_desc=This check message only occurs if using a TUFLOW Rainfall Control File (.trfc) with &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Poly&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;. If all rainfall polygons contain blank names, then rainfall points attributes (Name, F1 and F2) are used and any polygon attributes (e.g. F1 and F2) are ignored and CHECK 2626 is issued.&lt;br /&gt;
|suggestions=Review that using rainfall point data is intended.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2625&amp;diff=45642</id>
		<title>TUFLOW Message 2625</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2625&amp;diff=45642"/>
		<updated>2026-03-25T02:02:55Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=ERROR 2625 - No polygons read for &amp;quot;RF Interpolation Method == Poly&amp;quot; |alt_msg=ERROR 2625 - No triangles read for &amp;quot;RF Interpolation Method == TIN&amp;quot; |type=ERROR |message_desc=These ERROR messages are issued when insufficient data is specified in the TUFLOW rainfall control file (.trfc).  If using &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Poly&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;quot; then v...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 2625 - No polygons read for &amp;quot;RF Interpolation Method == Poly&amp;quot;&lt;br /&gt;
|alt_msg=ERROR 2625 - No triangles read for &amp;quot;RF Interpolation Method == TIN&amp;quot;&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=These ERROR messages are issued when insufficient data is specified in the TUFLOW rainfall control file (.trfc).  If using &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Poly&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;quot; then valid rainfall polygons must be read in with the command &amp;quot;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read GIS RF Polygons&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;&amp;lt;gis layer&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Likewise, if using &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;RF Interpolation Method&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;TIN&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;quot; then valid triangles must be read with the command &amp;quot;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read GIS RF Triangles&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;&amp;lt;gis layer&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Review the inputs and ensure that valid polygons or triangles are specified for the RF Interpolation Method.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2624&amp;diff=45641</id>
		<title>TUFLOW Message 2624</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2624&amp;diff=45641"/>
		<updated>2026-03-25T01:54:02Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=CHECK 2624 - &amp;quot;Maximum RF Location&amp;quot; command is no longer used. |alt_msg=CHECK 2624 - &amp;quot;Maximum Hyetograph Point&amp;quot; command is no longer used. |type=CHECK  |message_desc=Prior to the 2026 release of TUFLOW the rainfall control file (.trfc) commands &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Maximum RF Location&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; and &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Maximum Hyetograph Point&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; could be used to control the memory allocated for reading and processing of...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=CHECK 2624 - &amp;quot;Maximum RF Location&amp;quot; command is no longer used.&lt;br /&gt;
|alt_msg=CHECK 2624 - &amp;quot;Maximum Hyetograph Point&amp;quot; command is no longer used.&lt;br /&gt;
|type=[[CHECK ]]&lt;br /&gt;
|message_desc=Prior to the 2026 release of TUFLOW the rainfall control file (.trfc) commands &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Maximum RF Location&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; and &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Maximum Hyetograph Point&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; could be used to control the memory allocated for reading and processing of rainfalls.  From the 2026 release onwards this is no longer required as the these are dynamically allocated based on the input files.&amp;lt;br&amp;gt;&lt;br /&gt;
These commands are ignored from the 2026 release onwards.&lt;br /&gt;
|suggestions=These commands can be removed from the .trfc if the model will not be simulated with versions of TUFLOW prior to 2026.0.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2623&amp;diff=45640</id>
		<title>TUFLOW Message 2623</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2623&amp;diff=45640"/>
		<updated>2026-03-25T01:44:37Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 2623 - Overlapping rainfall areas - overwriting.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=This message is only produced for a rainfall control file (.trfc) with &amp;quot;RF Interpolation Method == Poly&amp;quot;. When processing rainfalls from a .trfc, rainfall grids are produced.  Each raster pixel in the output rainfall is assigned a rainfall based on the polygon that it falls within.  If overlapping polygons occur then WARNING 2623 is produced and the subsequent polygon with overwrite the previous polygons for that location.&amp;lt;br&amp;gt;&lt;br /&gt;
|suggestions=Ensure that rainfall polygons do not contain overlapping areas.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0934&amp;diff=45634</id>
		<title>TUFLOW Message 0934</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0934&amp;diff=45634"/>
		<updated>2026-03-24T05:13:55Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 0934 - Unable to load CodeMeter Runtime Library, please ensure it is installed.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]] &amp;lt;br&amp;gt; &lt;br /&gt;
|message_desc=When using CodeMeter WIBU dongles, the CodeMeter Runtime needs to be installed.  ERROR 0934 indictaes that TUFLOW has not been able to successfully load the CodeMeter Runtime.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Check that the CodeMeter Runtime is installed, see [[Wibu_Dongles#Installation_of_CodeMeter_RunTime_Kit|Installation of CodeMeter Runtime Kit for further instructions.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0934&amp;diff=45633</id>
		<title>TUFLOW Message 0934</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0934&amp;diff=45633"/>
		<updated>2026-03-24T05:13:45Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 0934 - Unable to load CodeMeter Runtime Library, please ensure it is installed.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]] &amp;lt;br&amp;gt; &lt;br /&gt;
|message_desc=When using CodeMeter WIBU dongles, the CodeMeter Runtime needs to be installed.  ERROR 0934 indictaes that TUFLOW has not been able to successfully load the CodeMeter Runtime.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Check that the CodeMeter Runtime is installed, see [[Wibu_Dongles#Installation_of_CodeMeter_RunTime_Kit|Installation of CodeMeter Runtime Kit for further instructions.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0054&amp;diff=45632</id>
		<title>TUFLOW Message 0054</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0054&amp;diff=45632"/>
		<updated>2026-03-24T05:13:29Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=CHECK 0054 - ulimit not set to maximum. |alt_msg=NA |type=CHECK &amp;lt;br&amp;gt;  |message_desc=This message only occurs for TUFLOW on Linux.&amp;lt;br&amp;gt; When running on Linux TUFLOW checks the soft and hard stack size limits.  If the soft limit is less than hard limit then CHECK 0054 is issued. By default TUFLOW will attempt to raise the soft limit to the hard limit, unless the command line argument &amp;lt;tt&amp;gt;-nua&amp;lt;/tt&amp;gt; is specified. |suggestions=If the soft s...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=CHECK 0054 - ulimit not set to maximum.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[CHECK]] &amp;lt;br&amp;gt; &lt;br /&gt;
|message_desc=This message only occurs for TUFLOW on Linux.&amp;lt;br&amp;gt;&lt;br /&gt;
When running on Linux TUFLOW checks the soft and hard stack size limits.  If the soft limit is less than hard limit then CHECK 0054 is issued. By default TUFLOW will attempt to raise the soft limit to the hard limit, unless the command line argument &amp;lt;tt&amp;gt;-nua&amp;lt;/tt&amp;gt; is specified.&lt;br /&gt;
|suggestions=If the soft stack limit is too small, this can TUFLOW to crash with SIGSEGV (segmentation fault) to occur.  If this occurs, raise the ulimit.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0934&amp;diff=45631</id>
		<title>TUFLOW Message 0934</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0934&amp;diff=45631"/>
		<updated>2026-03-24T04:51:01Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=ERROR 0934 - Unable to load CodeMeter Runtime Library, please ensure it is installed. |alt_msg=NA |type=ERROR &amp;lt;br&amp;gt;  |message_desc=When using CodeMeter WIBU dongles, the CodeMeter Runtime needs to be installed.  ERROR 0934 indictaes that TUFLOW has not been able to successfully load the CodeMeter Runtime.  |suggestions=Check that the CodeMeter Runtime is installed, see Wibu_Dongles#Installation_of_CodeMeter_RunTime_Kit|Installation o...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 0934 - Unable to load CodeMeter Runtime Library, please ensure it is installed.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]] &amp;lt;br&amp;gt; &lt;br /&gt;
|message_desc=When using CodeMeter WIBU dongles, the CodeMeter Runtime needs to be installed.  ERROR 0934 indictaes that TUFLOW has not been able to successfully load the CodeMeter Runtime.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Check that the CodeMeter Runtime is installed, see [[Wibu_Dongles#Installation_of_CodeMeter_RunTime_Kit|Installation of CodeMeter Runtime Kit for further instructions.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[3xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3056&amp;diff=45630</id>
		<title>TUFLOW Message 3056</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3056&amp;diff=45630"/>
		<updated>2026-03-24T03:51:10Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=ERROR 3056 - Unable to load CUDA libraries. Check that you have NVidia GPU driver installed |alt_msg=NA |type=ERROR &amp;lt;br&amp;gt;  |message_desc=When using GPU hardware to run simulations, the GPU driver is only loaded when required (lazy loaded).  ERROR 3056 indictaes that TUFLOW has not been able to successfully load the NVidia driver.  |suggestions=Check that running on Nvidia GPU hardware is desired, i.e. the computer has an NVidia GPU. &amp;lt;b...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 3056 - Unable to load CUDA libraries. Check that you have NVidia GPU driver installed&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]] &amp;lt;br&amp;gt; &lt;br /&gt;
|message_desc=When using GPU hardware to run simulations, the GPU driver is only loaded when required (lazy loaded).  ERROR 3056 indictaes that TUFLOW has not been able to successfully load the NVidia driver.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Check that running on Nvidia GPU hardware is desired, i.e. the computer has an NVidia GPU.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Check that NVidia drivers are installed, an easy check for this is to type &amp;quot;nvidia-smi&amp;quot; into the Command Prompt or Powershell on Windows or a Terminal shell on Linux&amp;lt;br&amp;gt;&lt;br /&gt;
This should produce an output like the below:&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Example nvidia-smi output.png|600px]]&lt;br /&gt;
&lt;br /&gt;
If an nvidia GPU is present but nvidia-smi is unable to be found then the drivers may need to be installed.&amp;lt;br&amp;gt;&lt;br /&gt;
Check the the CUDA version is at least 12.9.&amp;lt;br&amp;gt;&lt;br /&gt;
If running Linux on WSL then the WSL lib location may need to be added to the $LD_LIBRARY_PATH environment variable.  For example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[3xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=File:Example_nvidia-smi_output.png&amp;diff=45629</id>
		<title>File:Example nvidia-smi output.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=File:Example_nvidia-smi_output.png&amp;diff=45629"/>
		<updated>2026-03-24T03:42:11Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Output from nvidia-smi on linux&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2801&amp;diff=43633</id>
		<title>TUFLOW Message 2801</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2801&amp;diff=43633"/>
		<updated>2025-06-02T04:56:40Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 2801 - Unable to allocate memory for Quadtree cell centres.&lt;br /&gt;
|alt_msg=Numerous with the form &amp;quot;ERROR 2801 - Unable to allocate memory for Quadtree ...&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=TUFLOW was unable to allocate memory required for storing Quadtree data.&lt;br /&gt;
|suggestions=Review the console or log file output, prior to the ERROR should be an indicating of the amount of memory required.  For example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;Allocating memory for Quadtree mesh data, memory required &amp;lt;value&amp;gt;kB.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 2801 - Unable to allocate memory for Quadtree cell centres&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
Use Windows Task Manager to see how much memory is free.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2582&amp;diff=43632</id>
		<title>TUFLOW Message 2582</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2582&amp;diff=43632"/>
		<updated>2025-06-02T04:45:51Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 2582 - Calibration points not supported for this build - please notify [mailto:support@tuflow.com support@tuflow.com].&lt;br /&gt;
|alt_msg=NA&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=Feedback on the calibration point feature indicated that this was not being used, when the GIS formats were extended to include SHP and GPKG this feature was not implemented. &lt;br /&gt;
|suggestions=If you are attempting to use this functionality, please contact [mailto:support@tuflow.com support@tuflow.com] so that we look to implement this.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2582&amp;diff=43581</id>
		<title>TUFLOW Message 2582</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2582&amp;diff=43581"/>
		<updated>2025-05-29T02:27:53Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 2582 - Calibration points not supported for this build - please notify [mailto:support@tuflow.com support@tuflow.com].&lt;br /&gt;
|alt_msg=NA&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=Feedback on the calibration point feature indicated that this was not being used, when the GIS formats were extended to include SHP and GPKG this feature was not implemented. &lt;br /&gt;
|suggestions=If you are attempting to use this functionality, please contact [mailto:support@tuflow.com support@tuflow.com].&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_1430&amp;diff=43563</id>
		<title>TUFLOW Message 1430</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_1430&amp;diff=43563"/>
		<updated>2025-05-28T10:34:09Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 1430 - XF file is not a CSV XF file.  Re-reading csv file.&lt;br /&gt;
|alt_msg=ERROR 1430 - Could not find 1D Node for NA Table. Please check if all QT bc lines have selected active 2D cells.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[WARNING]]&amp;lt;br&amp;gt;[[ERROR]]&lt;br /&gt;
|message_desc=These are two separate and unrelated errors.  This will be fixed in a future version.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING 1430 - XF file is not a CSV XF file.  Re-reading csv file. Indicates that an .xf file that is being read from a input .csv is not in the correct format and the original input file is being read.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 1430 - Could not find 1D Node for NA Table. Please check if all QT bc lines have selected active 2D cells. Can occur when a 2D QT boundary does not select any 2D cells.&lt;br /&gt;
&lt;br /&gt;
|suggestions=&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING 1430 - XF file is not a CSV XF file.  Re-reading csv file. After issuing this message TUFLOW should re-create the .xf file so future simulations do not have the same issue. However, if this message is repeated over numerous simulations, please contact [mailto:support@tuflow.com support@tuflow.com].&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 1430 - Could not find 1D Node for NA Table. Please check the location of QT boundaries to ensure that have active 2D cells.  &lt;br /&gt;
&lt;br /&gt;
|uplink=[[1xxx_TUFLOW_Messages|1xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0253&amp;diff=43556</id>
		<title>TUFLOW Message 0253</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0253&amp;diff=43556"/>
		<updated>2025-05-28T06:07:43Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 0253 - Failed to read coordinates for an object in a GIS layer.&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=When reading in an objects coordinates from a GIS layer TUFLOW has been unable to read these.  This could be null or corrupt geometries stored in the file.  If using the Geopackage file format, the message will also include &amp;quot;GPKG row no: &amp;lt;row number&amp;gt;&amp;quot; to allow the object to be easily found.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Find and remove null geometry objects from the layer, by deleting the reported row number, or select in GIS e.g. using the &#039;remove null geometry tool&#039; in QGIS.  Another option is to select all objects within the model area using a selection tool like &#039;Select Features by Area&#039; and saving the selection as a new layer.  The selection tool should only select objects with valid geometry.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If the issue persists, please contact [mailto:support@tuflow.com support@tuflow.com], with the log file (.tlf) and the GIS layer.&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0621&amp;diff=43511</id>
		<title>TUFLOW Message 0621</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0621&amp;diff=43511"/>
		<updated>2025-05-27T23:46:24Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 0621 - Unable to get location of program data. Return status:&amp;lt;&amp;gt;.&lt;br /&gt;
|alt_msg=WARNING 0621 - Unable to get program data location, from environment variable.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING 0621 - Unable to get username, supressing default simulation log folder.&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=TUFLOW uses the Windows Environment variables &amp;quot;USERNAME&amp;quot; and &amp;quot;PROGRAMDATA&amp;quot;. These are used for the determining the &amp;quot;TUFLOW Licence Settings file&amp;quot; search paths and also for setting the output location of the &amp;quot;Simulations Log Folder&amp;quot;. This message indicates that TUFLOW has received an ERROR from Windows when trying to get  this information.&lt;br /&gt;
|suggestions=As TUFLOW has been unable to get this information, the licence settings and simulations log folder may not be working as expected. &amp;lt;br&amp;gt;&lt;br /&gt;
Refer to Section &amp;quot;Running Simulations&amp;quot; &amp;lt;u&amp;gt;[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]&amp;lt;/u&amp;gt; for information on the TUFLOW Licence Settings (.lcf).&amp;lt;br&amp;gt;&lt;br /&gt;
Refer to TCF Appendix of the &amp;lt;u&amp;gt;[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]&amp;lt;/u&amp;gt; for information on the &amp;quot;Simulations Log Folder&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
Please contact [mailto:support@tuflow.com support@tuflow.com] TUFLOW log file and information on Windows version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0620&amp;diff=43510</id>
		<title>TUFLOW Message 0620</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0620&amp;diff=43510"/>
		<updated>2025-05-27T23:22:57Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 0620 - Issue setting console title. Please contact support@tuflow.com.&lt;br /&gt;
|alt_msg=WARNING 0620 - Issue freeing console. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING 0622 - Issue setting console title. Please contact support@tuflow.com.&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=When running TUFLOW sets the console window title to include the TUFLOW Version, the simulation name and the hardware. This message indicates that there was an error returned from Windows when TUFLOW tried to set the title. &lt;br /&gt;
|suggestions=This is very rare message!  This should not affect the TUFLOW simulation or results. However, please contact &amp;lt;u&amp;gt;[mailto:support@tuflow.com support@tuflow.com]&amp;lt;/u&amp;gt; with information on the Windows version and TUFLOW log file so that we can investigate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0622&amp;diff=43509</id>
		<title>TUFLOW Message 0622</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0622&amp;diff=43509"/>
		<updated>2025-05-27T23:22:17Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 0622 - Issue setting console title. Please contact [mailto:support@tuflow.com support@tuflow.com].&lt;br /&gt;
|alt_msg=NA&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=This is a duplicate message, please see [[TUFLOW_Message_0620| WARNING 0620]]&lt;br /&gt;
|suggestions=This is a duplicate message, please see [[TUFLOW_Message_0620| WARNING 0620]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0620&amp;diff=43508</id>
		<title>TUFLOW Message 0620</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0620&amp;diff=43508"/>
		<updated>2025-05-27T23:20:38Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 0620 - Issue setting console title. Please contact support@tuflow.com.&lt;br /&gt;
|alt_msg=WARNING 0620 - Issue freeing console. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=When running TUFLOW sets the console window title to include the TUFLOW Version, the simulation name and the hardware. This message indicates that there was an error returned from Windows when TUFLOW tried to set the title. &lt;br /&gt;
|suggestions=This is very rare message!  This should not affect the TUFLOW simulation or results. However, please contact &amp;lt;u&amp;gt;[mailto:support@tuflow.com support@tuflow.com]&amp;lt;/u&amp;gt; with information on the Windows version and TUFLOW log file so that we can investigate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0627&amp;diff=43507</id>
		<title>TUFLOW Message 0627</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0627&amp;diff=43507"/>
		<updated>2025-05-27T23:13:55Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 0627 - CSV file appears to contain multiple data blocks... skipping xf file generation.&lt;br /&gt;
|alt_msg=NA&amp;lt;br&amp;gt;&lt;br /&gt;
|type=[[WARNING]]&lt;br /&gt;
|message_desc=CSV files in TUFLOW can support multiple data blocks, one after the other in the file.  This was done as prior to 2007 Excel (.xls) had a column limit of 256 in a single worksheet.  To get around this, large datasets could be written with data split into vertical blocks in a file, like the schematic below:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Msg_0627_csv_xf_unsupported.JPG|200px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
After Excel increased the limit on the number of columns (in the .xlsx format) this style of .csv is rarely used. Whilst it is still supported in TUFLOW, it is not supported with the xf file format.&lt;br /&gt;
|suggestions=There are a number of ways to overcome this:&lt;br /&gt;
* Turning off XF files for the model (with the .tcf command &amp;quot;XF Files == OFF&amp;quot;. Refer to TCF Appendix of the &amp;lt;u&amp;gt;[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]&amp;lt;/u&amp;gt;&lt;br /&gt;
* Turning off XF files for the boundary data (with the .tcf command &amp;quot;XF Files Boundaries == OFF&amp;quot;. Refer to TCF Appendix of the &amp;lt;u&amp;gt;[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]&amp;lt;/u&amp;gt;&lt;br /&gt;
* Changing the format of the .csv file so that all data appears in the same data block, as per the schematic below.  The last option is the preferred option, as this will allow the model to use XF files speeding up the initialisation. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Msg_0627_csv_xf_supported.JPG|400px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=File:Msg_0627_csv_xf_supported.JPG&amp;diff=43506</id>
		<title>File:Msg 0627 csv xf supported.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=File:Msg_0627_csv_xf_supported.JPG&amp;diff=43506"/>
		<updated>2025-05-27T22:58:34Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=File:Msg_0627_csv_xf_unsupported.JPG&amp;diff=43505</id>
		<title>File:Msg 0627 csv xf unsupported.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=File:Msg_0627_csv_xf_unsupported.JPG&amp;diff=43505"/>
		<updated>2025-05-27T22:56:41Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0623&amp;diff=43477</id>
		<title>TUFLOW Message 0623</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0623&amp;diff=43477"/>
		<updated>2025-05-27T05:07:16Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=CHECK 0623 - No write permission for: &amp;lt;filepath and filename&amp;gt;. Skipping.&lt;br /&gt;
|alt_msg=NA&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[CHECK]]&lt;br /&gt;
|message_desc=TUFLOW has been not been able to open a file with write permission.  This can only occur for some output files, with the most common file being the &amp;quot;_ All TUFLOW Simulations.log&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
There could be a number of reasons that TUFLOW is unable access the file in write mode including:&amp;lt;br&amp;gt;&lt;br /&gt;
* User does not have write permissions for that location or file.&amp;lt;br&amp;gt;&lt;br /&gt;
* Another TUFLOW simulation (or another process) currently has the file open.&amp;lt;br&amp;gt;&lt;br /&gt;
This check message can not occur for files such as the .tlf which are unique for each simulation and must be written, for example the .tlf file. As TUFLOW has been unable to open the file, no entry will be written for the simulation, but the simulation will still run.&lt;br /&gt;
|suggestions=&lt;br /&gt;
Check the user has write permissions in the location.&amp;lt;br&amp;gt;&lt;br /&gt;
If the user has the correct permissions, the most likely reason is that numerous simulations are started at the exact same time causing conflicts.  To prevent this, avoid batch files that start multiple simulations at the same time (in a batch file the command timeout &amp;lt;number of seconds&amp;gt;, e.g. to create a 10 second delay use &amp;quot;timeout 10&amp;quot;).&amp;lt;br&amp;gt;&lt;br /&gt;
If the simulations log file is not required this can be turned off with the .tcf command &amp;quot;SIMULATIONS LOG FOLDER == Do not use&amp;quot;. Refer to TCF Appendix of the &amp;lt;u&amp;gt;[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]&amp;lt;/u&amp;gt;&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2937&amp;diff=43441</id>
		<title>TUFLOW Message 2937</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2937&amp;diff=43441"/>
		<updated>2025-05-26T06:13:17Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=WARNING 2937 - &amp;quot;BED RESISTANCE DEPTH INTERPOLATION&amp;quot; only used for HQ curves in HPC solver.&amp;lt;br&amp;gt; |alt_msg=NA |type=WARNING&amp;lt;br&amp;gt; |message_desc...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=WARNING 2937 - &amp;quot;BED RESISTANCE DEPTH INTERPOLATION&amp;quot; only used for HQ curves in HPC solver.&amp;lt;br&amp;gt;&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[WARNING]]&amp;lt;br&amp;gt;&lt;br /&gt;
|message_desc=Bed Resistance Depth Interpolation is not used in TUFLOW HPC (including Quadtree). When depth varying Manning&#039;s n values are used in HPC, interpolation between depths is linear.  When using HQ curves that are calculated based on specified slope, the Bed Resistance Depth Interpolation setting is used.&lt;br /&gt;
|suggestions= Review whether command should be used in the model.&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2320&amp;diff=43440</id>
		<title>TUFLOW Message 2320</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2320&amp;diff=43440"/>
		<updated>2025-05-26T06:03:49Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 2320 - FC commands not yet supported in HPC or GPU solver.&lt;br /&gt;
|alt_msg=ERROR 2320 - Read TGF command not yet supported in HPC or GPU solver.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 2320 - Read TGA command not yet supported in HPC or GPU solver.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 2320 - TUFLOW 2016-03 GPU Solver does not support 1D links.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 2320 - GLO commands not yet supported in HPC or GPU solver.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 2320 - &amp;quot;Bed Resistance Values == CHEZY&amp;quot; not supported in HPC solver.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 2320 - &amp;quot;Bed Resistance Values == MANNING M&amp;quot; not supported in HPC solver.&amp;lt;br&amp;gt;&lt;br /&gt;
WARNING 2320 - HPC or GPU Solver ignoring Read GIS Objects/Receptors commands.&amp;lt;br&amp;gt;&lt;br /&gt;
|type=[[WARNING]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[ERROR]]&amp;lt;br&amp;gt;&lt;br /&gt;
|message_desc= Some TUFLOW Classic functionalities are not supported by the TUFLOW HPC solver. &lt;br /&gt;
&lt;br /&gt;
|suggestions= &lt;br /&gt;
&lt;br /&gt;
* If using a 2d_fc layer, change to a 2d_lfcsh layer which is supported by TUFLOW HPC.&lt;br /&gt;
* The 2016-03 TUFLOW GPU solver is a legacy feature, TUFLOW HPC (on GPU hardware) should be used instead. &lt;br /&gt;
* GLO commands are supported in TUFLOW HPC from the 2023-03-AD build and onwards. &lt;br /&gt;
* Read GIS Objects/Receptors commands are supported in TUFLOW HPC from the 2023-03-AA build and onwards.&lt;br /&gt;
&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0250&amp;diff=43245</id>
		<title>TUFLOW Message 0250</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_0250&amp;diff=43245"/>
		<updated>2025-05-08T04:37:44Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 0250 - Too many CPU threads for model size, thread limit: &amp;lt;&amp;gt;.&lt;br /&gt;
|alt_msg=NA&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=When running HPC models (not including quadtree) over a number of processing devices (CPU threads or GPU cards) the model is split and each device gets an equal portion of the model to solve (split along the model x-dimension) .  Running very small models can mean that more compute devices than model columns are used.  &lt;br /&gt;
For example in the .tgc the following commands: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Grid Size (X,Y) &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; 2, 4&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Cell Size &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; 1&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
Creates a model with 2 columns (in the x-direction) and 4 rows (in the y-direction). Running the above model with CPU Threads == 4 would give ERROR 0250.  The minimum number of model columns for a device is 4, so a model with 10 columns could run on 2 CPU, but any more would result in ERROR 0250.  Note: there is little benefit in running small models on large numbers of threads, and this may actually cause a slow down in the simulation speed due to computational overhead.&amp;lt;br&amp;gt;&lt;br /&gt;
For Quadtree the number of threads must be less than the number of cells.&lt;br /&gt;
&lt;br /&gt;
|suggestions=Review model size definition in the TGC file. &amp;lt;br&amp;gt; &lt;br /&gt;
If model is intended to be small, the number of CPU threads may need to be reduced. E.g. set &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Hardware &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; CPU&amp;lt;/tt&amp;gt; and &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;CPU Threads &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; 1&amp;lt;/tt&amp;gt; in the TCF file. &lt;br /&gt;
&lt;br /&gt;
|uplink=[[0xxx_TUFLOW_Messages|0xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3517&amp;diff=43200</id>
		<title>TUFLOW Message 3517</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3517&amp;diff=43200"/>
		<updated>2025-05-01T05:00:10Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 3517 - Z Shape Route not supported yet in SGS. Please contact support@tuflow.com.&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
|alt_msg=ERROR 3517 - HX 2D BC not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - Interpolate ZUVH not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - ZC == MIN(ZU,ZV) not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - FC not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; or &amp;quot;Read MID Zpt&amp;quot; not supported with Quadtree.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; or &amp;quot;Read MID Zpt&amp;quot; not supported in SGS.&amp;lt;br&amp;gt;&lt;br /&gt;
etc&lt;br /&gt;
|type=[[ERROR]] &lt;br /&gt;
|message_desc=These commands/functions are not supported in either SGS or Quadtree (depending on the message received) with the used TUFLOW version. &amp;lt;br&amp;gt;&lt;br /&gt;
If the message received is &amp;quot;ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; not supported with Quadtree&amp;quot; this is because the GIS layer is cell size dependent and cannot be used in a Quadtree model, as they have multiple cell sizes.&amp;lt;br&amp;gt;&lt;br /&gt;
If the error is ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; or &amp;quot;Read MID Zpt&amp;quot; not supported in SGS&amp;quot;, this error occurs as reading data in this format only reads the cell centre (zc), cell face (zu and zv) and cell corner (zh) elevations.  Data read in RowCol are read based on the model row and column reference and does not account for sub grid sampling within a cell. This command was made redundant with the addition of direct reading of raster grids and TIN files in the 2011 version of TUFLOW.&amp;lt;br&amp;gt;&lt;br /&gt;
Note: &amp;quot;Read RowCol Zpt&amp;quot; and &amp;quot;Read MID Zpt&amp;quot; are treated identically in TUFLOW with &amp;quot;Read MID Zpt&amp;quot; being the syntax for versions prior to 2010 when GIS formats were extended to include Shapefile.&lt;br /&gt;
|suggestions=&lt;br /&gt;
Use the latest version of TUFLOW available from the TUFLOW website. Alternatively, remove these features to run in SGS (or Quadtree depending on the message).&lt;br /&gt;
&lt;br /&gt;
If the message received is &amp;quot;ERROR 3517 - &amp;quot;FC&amp;quot; not supported yet in SGS&amp;quot; this is because a GIS 2d_fcsh layer is used. Change this to a 2d_lfcsh layer which is supported when using SGS.&lt;br /&gt;
&lt;br /&gt;
If the message received is &amp;quot;ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; not supported with Quadtree&amp;quot; or &amp;quot;ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; not supported in SGS&amp;quot; use the source elevation layer that the file was originally generated from. This can be replaced with &amp;quot;Read Grid Zpt&amp;quot; if using a raster grid, or &amp;quot;Read TIN Zpt&amp;quot; if using a TIN surface.&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you have both .mid/.mif it is possible (although not recommended) to generate a raster within QGIS which can be read into TUFLOW instead. If there is no .mif file, this can be generated in TUFLOW using the following in the TGC (anywhere the zpt layer is not 99 will be the original sample points and elevations). Note that SGS must be switched off for this model run to get the .mif file created:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Set Zpts&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;99&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read MID Zpts&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;input_file.mid&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Write GIS Zpts&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;output_file.mif&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; !or .shp, .gpkg&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Stop&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[3xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3517&amp;diff=43198</id>
		<title>TUFLOW Message 3517</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_3517&amp;diff=43198"/>
		<updated>2025-05-01T04:52:53Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 3517 - Z Shape Route not supported yet in SGS. Please contact support@tuflow.com.&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
|alt_msg=ERROR 3517 - HX 2D BC not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - Interpolate ZUVH not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - ZC == MIN(ZU,ZV) not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - FC not supported yet in SGS. Please contact support@tuflow.com.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; or &amp;quot;Read MID Zpt&amp;quot; not supported with Quadtree.&amp;lt;br&amp;gt;&lt;br /&gt;
ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; or &amp;quot;Read MID Zpt&amp;quot; not supported in SGS.&amp;lt;br&amp;gt;&lt;br /&gt;
etc&lt;br /&gt;
|type=[[ERROR]] &lt;br /&gt;
|message_desc=These commands/functions are not supported in either SGS or Quadtree (depending on the message received) with the used TUFLOW version. &amp;lt;br&amp;gt;&lt;br /&gt;
If the message received is &amp;quot;ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; not supported with Quadtree&amp;quot; this is because the GIS layer is cell size dependent and cannot be used in a Quadtree model, as they have multiple cell sizes.&amp;lt;br&amp;gt;&lt;br /&gt;
If the error is ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; or &amp;quot;Read MID Zpt&amp;quot; not supported in SGS&amp;quot;, this error occurs as reading data in this format only reads the cell centre (zc), cell face (zu and zv) and cell corner (zh) elevations.  Data read in RowCol are read based on the model row and column reference and does not account for sub grid sampling within a cell. This command was made redundant with the addition of direct reading of raster grids and TIN files in the 2011 version of TUFLOW.&amp;lt;br&amp;gt;&lt;br /&gt;
Note: &amp;quot;Read RowCol Zpt&amp;quot; and &amp;quot;Read MID Zpt&amp;quot; are treated identically in TUFLOW with &amp;quot;Read MID Zpt&amp;quot; being the syntax for versions prior to 2010 when GIS formats were extended to include Shapefile.&lt;br /&gt;
|suggestions=&lt;br /&gt;
Use the latest version of TUFLOW available from the TUFLOW website. Alternatively, remove these features to run in SGS (or Quadtree depending on the message).&lt;br /&gt;
&lt;br /&gt;
If the message received is &amp;quot;ERROR 3517 - &amp;quot;FC&amp;quot; not supported yet in SGS&amp;quot; this is because a GIS 2d_fcsh layer is used. Change this to a 2d_lfcsh layer which is supported when using SGS.&lt;br /&gt;
&lt;br /&gt;
If the message received is &amp;quot;ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; not supported with Quadtree&amp;quot; or &amp;quot;ERROR 3517 - &amp;quot;Read RowCol Zpt&amp;quot; not supported in SGS&amp;quot; use the source elevation layer that the file was originally generated from. Alternatively, if you have both .mid/.mif it is possible to generate a raster within QGIS which can be read into TUFLOW instead. If there is no .mif file, this can be generated in TUFLOW using the following in the TGC (anywhere the zpt layer is not 99 will be the original sample points and elevations). Note that SGS must be switched off for this model run to get the .mif file created:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Set Zpts&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;99&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Read MID Zpts&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;input_file.mid&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Write GIS Zpts&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;== &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;output_file.mif&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; !or .shp, .gpkg&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Stop&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|uplink=[[3xxx_TUFLOW_Messages|3xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=1D_Syphons&amp;diff=39755</id>
		<title>1D Syphons</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=1D_Syphons&amp;diff=39755"/>
		<updated>2024-07-17T05:41:09Z</updated>

		<summary type="html">&lt;p&gt;Par: minor addition&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size = 18&amp;gt;Page Under Construction&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
A syphon (or siphon) is a hydraulic structure used to transfer water from one location to another, typically over an elevation difference, without the need for pumping. A syphon operates based on the principle of atmospheric pressure and gravity.&lt;br /&gt;
&lt;br /&gt;
The components of a syphon are: &lt;br /&gt;
*Inlet: Located at the higher water level, where water enters the siphon.&lt;br /&gt;
*Outlet: Positioned at the lower water level, where water exits.&lt;br /&gt;
*Riser: The vertical section that rises from the inlet to the crest of the U-shape.&lt;br /&gt;
*Downleg: The section that descends from the crest to the outlet.&lt;br /&gt;
&lt;br /&gt;
== 1D Configuration ==&lt;br /&gt;
Whilst TUFLOW does have a specific syphon channel, there are two approaches to model a syphon system in TUFLOW. &lt;br /&gt;
=== Matrix Flows ===&lt;br /&gt;
The most appropriate approach to model a syphon is to use a M channel, described in Section 5.8.1 &#039;&#039;M Channels (User Defined Flow Matrix)&#039;&#039; in the [https://downloads.tuflow.com/TUFLOW/Releases/Latest/TUFLOW%20Manual.pdf| TUFLOW user manual]. An M channel can be used to define a matrix of flows between two invert levels based on their respective depths. If this matrix of flows through the syphon can be calculated, or if they are given as part of the operational instructions, then they can be input in .csv form as below, where negative values indicate flows going from downstream to upstream. &lt;br /&gt;
&lt;br /&gt;
[[File:M channel matrix.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Storage Nodes &amp;amp; Additional Losses ===&lt;br /&gt;
Alternatively, 1d_nwk nodes can be used to account for the storage of the vertical portion of the syphon as the images shown below. This configuration essentially estimates the flows conveyed though the syphon based on the upstream and downstream water level and the hydraulic property of the bottom pipe. It is strongly recommended to calibrate the model result against measurement data to check the accuracy or if measurement data are not available, conduct sensitivity testing.&lt;br /&gt;
&lt;br /&gt;
[[File:Syphon storagenodes.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== Syphon Losses ====&lt;br /&gt;
For this method, the main losses for a syphon should be considered: &lt;br /&gt;
* entry and exit losses&lt;br /&gt;
* friction at pipe and wall &lt;br /&gt;
* bend losses &lt;br /&gt;
&lt;br /&gt;
Bend losses (or any extra loss) through the syphon can be accounted for using the Form_Loss attribute of the pipe.&amp;lt;br&amp;gt;&lt;br /&gt;
The equation used for the loss of head due to pipe bend is provided below:&lt;br /&gt;
&lt;br /&gt;
[[File:Bend loss eqn.jpg]]&lt;br /&gt;
&lt;br /&gt;
Where: &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;k&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;&#039;&#039;&#039; = co-efficient of bend &amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;v&#039;&#039;&#039; = velocity of fluid (m/s)&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;g&#039;&#039;&#039; = acceleration of gravity (9.8 m/s&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following figure provides bend coefficient values for common bend types: &lt;br /&gt;
&lt;br /&gt;
[[File:Bend losses 1.jpg |thumb|none|upright=5|Table 8-4, Fluid Mechanics: Fundamentals and Applications 4th ed.(2018)]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any further questions about syphons or any other aspect of TUFLOW functionality, please email TUFLOW support:  [mailto:support@tuflow.com?Subject=TUFLOW%201D%20weirs%20help support@tuflow.com]&lt;br /&gt;
&lt;br /&gt;
{{Tips Navigation&lt;br /&gt;
|uplink=[[ TUFLOW 1D Channels and Hydraulic Structures | Back to 1D Channels and Hydraulic Structures]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=12da_to_from_GIS&amp;diff=34802</id>
		<title>12da to from GIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=12da_to_from_GIS&amp;diff=34802"/>
		<updated>2023-10-30T04:53:42Z</updated>

		<summary type="html">&lt;p&gt;Par: Added some extra information on UTF16 conversion.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&#039;&#039;&#039;12da_to_from_GIS.exe&#039;&#039;&#039; converts .12da files from the 12D software [http://www.12d.com (www.12d.com)] to and from .mif and .shp files, the .12da file needs to be in ANSI encoding, not UTF.  If importing/exporting to/from 12D and a GIS simply specify the file that you wish to have translated.  If the file has a .12da (or a .4da) extension, the program converts it to a .mif/.mid file format.  If the file has a .mif extension, the program converts it to a .12da file.&amp;lt;br&amp;gt;&lt;br /&gt;
Note, when converting from a .12da file to a .mif file without any options, 12da_to_from_mif automatically creates a .mif/.mid file suitable for use by Read GIS Z Line.  This is useful for importing 3D breaklines (eg. of a road design) directly into TUFLOW.&amp;lt;br&amp;gt;&lt;br /&gt;
There are some very useful options as discussed in the table below.&amp;lt;br&amp;gt;&lt;br /&gt;
Of particular note is the -xs option to generate a TUFLOW 1D cross-section database from a 12D DTM.  This approach is far more preferable to extracting cross-sections manually and is much better than extracting cross-sections from a grid based DTM (eg. Vertical Mapper or Spatial Analyst) as it only extracts points where the DTM triangle sides intersect the cross-section line, thereby keeping the number of points in the cross-section profile to a minimum, and also improving the accuracy of the profile.&amp;lt;br&amp;gt;&lt;br /&gt;
The  zln option can also be very useful when the DTM river bathymetry is poor because the aerial survey is inaccurate where there is water or dense vegetation, and you need to carve a section through the DTM along the river based on a cross-section survey.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=Options (switches)=&lt;br /&gt;
&#039;&#039;&#039;TABLE 1: 12da_to_from_GIS Options (Switches)&#039;&#039;&#039;&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! Switch&lt;br /&gt;
! width=85% | Description&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| When converting from a .mif file to a .12da file&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-zln&amp;quot;|| When converting a .mif file to .12da file, if  zln is specified polylines are interpreted in the same manner as a TUFLOW 3D breakline (see Read GIS Z Line) such that any points snapped to the polyline are used to set the elevations of any vertices along the polyline that do not have points snapped to them.  The first attribute in the .mif file must be the Elevation.  (Note, when converting in reverse from a .12da file to a .mif file without any options, 12da_to_from_mif automatically creates a .mif/.mid file suitable for use by Read GIS Z Line.)&amp;lt;br&amp;gt;&lt;br /&gt;
This is useful for creating 3D polylines for 12D where an elevation does not exist at a vertice.  It is particularly useful where a river’s bathymetry in a DTM is being created from cross-section surveys, and the DTM operator wishes to use the elevations at the cross-section survey points, but needs to put more shape into the breaklines being digitised between the cross-sections so as to carve out the river’s bathymetry into the DTM.  Using 12da_to_from_mid with the  zln option will interpolate elevations at every string vertice, something that 12D does not offer (as far as we know!).&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| When converting from a .12da file to a .mif file&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-hip&amp;quot;|| When converting a .12da file to a .mif file will include any 12D hipdata polylines.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-xs&amp;quot;|| When converting a .12da file to a .mif file creates a TUFLOW cross-section database (ie. one .csv file per 3D polyline) and a 1d_xs layer (1d_tab or 1d_xs format – see Read GIS Table Links and Section 4.6.3).  This is used to extract 1D cross-sections from a DTM for use in TUFLOW.  Cross-sections generated this way can also be viewed and edited in the SMS TUFLOW Interface.&amp;lt;br&amp;gt;&lt;br /&gt;
The process to create the cross-sections from a 12D DTM is as follows:&amp;lt;br&amp;gt;&lt;br /&gt;
*Digitise the location of cross-section lines either in a GIS or in 12D.  If in a GIS, export the layer out as a .mif file and then run 12da_to_from_gis to convert the .mif file into a .12da file.  For example use:&amp;lt;br&amp;gt;&lt;br /&gt;
:&amp;lt;tt&amp;gt;12da_to_from_gis.exe xs.mif&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:to generate a file called xs.12da.  Import the .12da file into 12D.&amp;lt;br&amp;gt;&lt;br /&gt;
*In 12D drape the cross-section polylines over the DTM (your 12D operator should know how to do this!) to create 3D polylines with vertices where the cross-section line intersects a DTM triangle edge.&lt;br /&gt;
*Export the 3D draped polylines from 12D as a .12da file.&lt;br /&gt;
*Run 12da_to_from_gis using the -xs option.  For example:&amp;lt;br&amp;gt;&lt;br /&gt;
:&amp;lt;tt&amp;gt;12da_to_from_gis.exe -xs -shp xs_draped.12da&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:This will produce a 1d_xs layer in shapefile format ready for use by TUFLOW and a .csv file for each cross-section line.  Keep the 1d_xs layer and the .csv files in the same folder in the event that you move them elsewhere.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the xsGenerator.exe utility, you can also assign material values to each of the cross-section points (see &amp;lt;u&amp;gt;[[xsGenerator | this page]]&amp;lt;/u&amp;gt;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
&amp;lt;tt&amp;gt;12da_to_from_gis.exe -mif road_breaklines.12da&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
creates .mif/.mid files of the 2D and 3D breaklines in the file road_breaklines.12da.  The .mif/.mid files can be directly used by Read GIS Z Line.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;12da_to_from_gis.exe 2d_hx_lines.mif&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
creates a file 2d_hx_lines.mif.12da.  Import this file into 12D then drape these lines over the DTM and export the file, say as 2d_hx_lines_draped.12da, then execute the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;12da_to_from_gis.exe 2d_hx_lines_draped.12da&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This creates 3D breakline .mif/.mid files of the TUFLOW HX lines that can be used to ensure the 2D HX cells are set to the exact elevations along the HX lines by using the below command in the .tgc file.:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;Read GIS Z Line THICK == mi\2d_hx_lines_draped.12da.mif &amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Frequently Asked Questions (FAQ)=&lt;br /&gt;
==Why are the SHP or MIF files created by the 12da_to_from_GIS utility empty?==&lt;br /&gt;
The reason for empty output files may be that 12D (v10 or later) produces output files in UTF-16 encoding by default. This encoding is not compatible with the utility and can lead to empty SHP or MIF outputs.  The .12da can be exported from 12D into ANSI format, or readily converted in text editor from UTF16 to ANSI making it compatible with TUFLOW and TUFLOW utilities.  Instructions for both methods are below. &amp;lt;br&amp;gt;&lt;br /&gt;
In 12D, when exporting the TIN as a .12da file, make sure to select the &amp;quot;[Ansi format]&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:12da_TIN_export_screenshot.JPG|500px]] &amp;lt;br&amp;gt;&lt;br /&gt;
This change will be highlighted at the bottom of the Write 12da pop up box. See figure below. &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:12da_TIN_export_screenshot_ANSI_Format_set.JPG|500px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, an existing .12da file can  easily be converted to ANSI encoding in Notepad++, under the Encoding menu: &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Convert ANSI.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Tips Navigation&lt;br /&gt;
|uplink=[[TUFLOW_Utilities | Back to TUFLOW Utilities]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Run_TUFLOW_From_a_Batch-file&amp;diff=33843</id>
		<title>Run TUFLOW From a Batch-file</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Run_TUFLOW_From_a_Batch-file&amp;diff=33843"/>
		<updated>2023-06-23T05:38:53Z</updated>

		<summary type="html">&lt;p&gt;Par: /* Looping in a batch file up to a certain number of runs */ remove link to forum&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
TUFLOW simulations can also be started from a batch file.  Batch files are text files which contain a series of commands.  Batch files allow a large degree of flexibility in starting TUFLOW simulations, advanced batch files can be used to:&lt;br /&gt;
&lt;br /&gt;
* Run multiple simulations&lt;br /&gt;
* Set CPU priority for TUFLOW simulations&lt;br /&gt;
* Create a wait (e.g. start a simulation in 1 hour)&lt;br /&gt;
* Test simulation input&lt;br /&gt;
* Copy a TUFLOW model&lt;br /&gt;
* Package a TUFLOW model&lt;br /&gt;
* Post process results after simulation has finished.&lt;br /&gt;
Batch files are executed by double clicking the created .bat file from Windows Explorer.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
==Simple batch file==&lt;br /&gt;
To use a batch file, create a new text file in the TUFLOW\runs directory. The name is arbitrary but the file must have the extension &amp;quot;.bat&amp;quot;.  For example the file name could be &#039;&#039;&#039;_run_TUFLOW.bat&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Open this file in a text editor and add the following line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; &amp;quot;M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is the simplest command line for starting TUFLOW, the line above contains only two arguments, the first is the path to the TUFLOW executable and the second argument &amp;quot;M01_5m_001.tcf&amp;quot; is the simulation file name. Depending on the location of the executable the above command line will need to be modified.  The quotations around the TUFLOW executable and the .tcf file name are only required if there are spaces in the file names. However, it is recommended to include these to avoid problems.&lt;br /&gt;
&lt;br /&gt;
==Batch File Switches==&lt;br /&gt;
These switches are available in all batch files, they are not specific to TUFLOW.&lt;br /&gt;
&lt;br /&gt;
===Pause===&lt;br /&gt;
A second line with the text &amp;quot;pause&amp;quot; can be added, this will prompt the user to press a key at the end of the batch file.  This is useful if the DOS window disappears from the screen, before you can read the output. The pause command will keep the window open.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; &amp;quot;M01_5m_001.tcf&amp;quot;&lt;br /&gt;
pause&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Starting process in new window===&lt;br /&gt;
In order to run multiple simulations at the same time, each simulation needs be started in a new console window.  To do this begin the batch file line with the &amp;quot;Start&amp;quot; command, a for the window is then added.  For example, to start the simulation above in a new window titled &amp;quot;TUFLOW&amp;quot; the following would be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot;  &amp;quot;M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Wait===&lt;br /&gt;
If multiple simulations are to be run, it is often desirable to run these in series, i.e. the second simulation starts after the first has finished. a /wait switch can be added which makes the batch file wait until the process is finished before moving onto the next command.&amp;lt;br&amp;gt;&lt;br /&gt;
An example of this is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Start &amp;quot;TUFLOW&amp;quot; /wait &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; M01_5m_001.tcf&lt;br /&gt;
Start &amp;quot;TUFLOW&amp;quot; /wait &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; M01_2.5m_001.tcf&amp;lt;/pre&amp;gt;&lt;br /&gt;
Without the wait command, both simulations would start at the same time.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Unless there is a third simulation in the batch file the /wait command in the second line is not required, this prevents the batchfile from moving onto the third line.&lt;br /&gt;
===Setting a priority===&lt;br /&gt;
The priority of a process (such a TUFLOW simulation) can be specified within a batch file.  This can be useful for a number of reasons:&lt;br /&gt;
*Lowering the priority of a simulation to allow you to continue working;&lt;br /&gt;
*Setting a high priority for critical runs; or&lt;br /&gt;
*Making sure you runs are high priority on a shared computing resource!&lt;br /&gt;
&lt;br /&gt;
The following are valid priority switches (in increasing order of priority):&lt;br /&gt;
*/LOW&lt;br /&gt;
*/BELOWNORMAL&lt;br /&gt;
*/NORMAL&lt;br /&gt;
*/ABOVENORMAL&lt;br /&gt;
*/HIGH&lt;br /&gt;
*/REALTIME&lt;br /&gt;
&lt;br /&gt;
An example of a low priority simulation is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; /low &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; &amp;quot;M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;TIP:&#039;&#039;&#039; The priority of a TUFLOW simulation can be changed at a later stage by using the &#039;&#039;&#039;Windows Task Manager&#039;&#039;&#039;, navigate to the &#039;&#039;&#039;Processes&#039;&#039;&#039; tab and right click on the TUFLOW process (e.g. TUFLOW_iSP_w64.exe) and select the set priority option.&lt;br /&gt;
&lt;br /&gt;
===Minimising the console window===&lt;br /&gt;
Using the /min switch will keep the console window for TUFLOW models minimised, so it doesn&#039;t pop up to the front every time when the next model starts.&lt;br /&gt;
&amp;lt;pre&amp;gt;Start &amp;quot;TUFLOW&amp;quot; /wait /min &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; M01_5m_001.tcf&lt;br /&gt;
Start &amp;quot;TUFLOW&amp;quot; /wait /min &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; M01_2.5m_001.tcf&amp;lt;/pre&amp;gt;&lt;br /&gt;
==no console simulation==&lt;br /&gt;
&lt;br /&gt;
==No Console Option==&lt;br /&gt;
Using the -nc switch will run a simulation without opening a DOS console window. This option is desirable for people running simulation on the cloud. Note, if an invalid .tcf file is specified, the simulation stops and returns an error level of 1 to the operating system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Start &amp;quot;TUFLOW&amp;quot; /wait /min &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -nc M01_5m_001.tcf&lt;br /&gt;
Start &amp;quot;TUFLOW&amp;quot; /wait /min &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -nc M01_2.5m_001.tcf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TUFLOW switches in a batch file==&lt;br /&gt;
These switches are specific to TUFLOW simulations.&lt;br /&gt;
===Testing a simulation===&lt;br /&gt;
The -t (test) switch is very useful for testing the data input without running the simulation.  It is good practice to use this switch before carrying out the simulations, as this will tell you whether there are any data input problems.  The -t switch runs TUFLOW to just before it starts the hydrodynamic computations.&lt;br /&gt;
An example is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -t &amp;quot;M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Batch mode in TUFLOW===&lt;br /&gt;
The use of the –b (batch) switch which suppresses the need to press the return key at the end of a simulation.  This ensures that one simulation proceeds on to the next without any need for user input. This is required for running multiple simulations in series (one after the other).&lt;br /&gt;
An example is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -b &amp;quot;M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Automatically Create Folders in a TUFLOW model===&lt;br /&gt;
The use of the -acf (automatically create folders) switch prevents the dialog prompt from appearing when encountering non-existent folders (ie. results folders), and creates these folders automatically. If for any reason the folder can&#039;t be created, a dialog will appear. This feature was first introduced for Build 2012-05-AE and is not available for TUFLOW builds prior to this. For models simulated with Build 2013-12-AA or later, non-existent folders are now automatically created. If you would prefer to have the create folder query dialog to appear, you can specify the –qcf run time option (stands for query create folders).&amp;lt;br&amp;gt;&lt;br /&gt;
An example is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -acf &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Suppress Queries in a TUFLOW model===&lt;br /&gt;
The use of the -nq (no queries) switch prevents the termination query dialog from displaying when Ctrl+C is pressed to terminate a simulation cleanly. If –nq is specified and Ctrl-C is pressed, the simulation terminates cleanly without a query dialog to check you are certain, so be careful! This feature was first introduced for Build 2012-05-AE and is not available for TUFLOW builds prior to this.&amp;lt;br&amp;gt;&lt;br /&gt;
An example is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -nq &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copy a TUFLOW model===&lt;br /&gt;
TUFLOW can be run in copy mode, which can be useful for transferring a model to another site or for making an archive of the input data.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To copy a TUFLOW model, the &#039;&#039;&#039;-c&#039;&#039;&#039; switch must be included on the TUFLOW command line, as a minimum. The &#039;&#039;&#039;-c&#039;&#039;&#039; switch copies only the files read by TUFLOW. As such, for MapInfo users, the .mif and .mid files read by TUFLOW will be copied. The remaining MapInfo format files (.tab, .id, .dat and .map) are not read by TUFLOW and will not be copied. By default, the &#039;&#039;&#039;-c&#039;&#039;&#039; switch copies all TUFLOW inputs for the simulation into a subdirectory where the .tcf is located (generally TUFLOW\runs\).&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Additional optional flags can be added to the base &#039;&#039;&#039;-c&#039;&#039;&#039; switch, in any combination, including:&amp;lt;br&amp;gt;&lt;br /&gt;
;* “a” (all);&amp;lt;br&amp;gt;&lt;br /&gt;
: The addition of the “a” flag (e.g. -ca) copies all files of the same name for all input files (ie. same name, but different extensions). This option is particularly useful if the .tab and other associated files of a GIS layer need to be archived or delivered.&amp;lt;br&amp;gt;&lt;br /&gt;
;* “p” (path); and&amp;lt;br&amp;gt;&lt;br /&gt;
: The addition of the “p” flag (e.g. -cp) allows the user to specify an alternate path in which to copy the model. Without this flag, the location defaults to the .tcf’s location. For example, specifying the following, will place a copy of the model into a folder C:\put_model_here:&amp;lt;br&amp;gt;&lt;br /&gt;
REM &amp;lt;tt&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -cp &amp;quot;C:\put_model_here&amp;quot; &amp;quot;C:\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
;* “ncf” (no check files)&amp;lt;br&amp;gt;&lt;br /&gt;
: The addition of the “ncf” flag (e.g. -cncf) copies the essential input files and excludes all check files.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that these optional flags can be added in any combination to the base &#039;&#039;&#039;-c&#039;&#039;&#039; switch (e.g.&lt;br /&gt;
-c, -ca, -cp, -cncf, -cap, -cancf, -cpncf, -capncf).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifying &#039;&#039;&#039;-c&#039;&#039;&#039; on the TUFLOW command line creates a folder “&amp;lt;.tcf filename&amp;gt;_copy” (or “&amp;lt;.tcf filename&amp;gt;_copy_all” if the “a” flag is added) in the same location as the .tcf file. Under the folder, input files are copied (including the full folder structure), and any check files and output folders created. For example, specifying:&amp;lt;br&amp;gt;&lt;br /&gt;
: &amp;lt;tt&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -c “C:\tuflow_models\my model.tcf”&amp;lt;/tt&amp;gt; will make a copy of the TUFLOW model based on the file &amp;lt;tt&amp;gt;“my model.tcf”&amp;lt;/tt&amp;gt; in a folder &amp;lt;tt&amp;gt;&amp;quot;my model.tcf_copy&amp;quot;&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;&amp;quot;my model.tcf_copy_all&amp;quot;&amp;lt;/tt&amp;gt; if using the “a” flag.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Use the full path to the .tcf file (this is the default if running from UltraEdit or using the right click approach).&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure there is sufficient disk space (no checks for sufficient disk space are made).&lt;br /&gt;
&amp;lt;li&amp;gt;Output folders and some output files are created but these will be empty.&lt;br /&gt;
&amp;lt;li&amp;gt;Any check folder(s) are created and check files written (these can be deleted if wishing to minimise the size of the folder).&lt;br /&gt;
&amp;lt;li&amp;gt;The full path of the input files is reproduced to provide traceability and also handle inputs from other drives and URLs. Drive letters are replaced, for example, “C:” becomes a folder “C Drive”. URLs (denoted by “\\” or “//” at the beginning of the path) are replaced by a folder called “URL\”.&lt;br /&gt;
&amp;lt;li&amp;gt;To run the copied .tcf file, it will be necessary to change any non-relative pathnames according to the point above. Alternatively you can share and then map, for example, the “D Drive” folder as “D:”.&lt;br /&gt;
&amp;lt;li&amp;gt;The Check MI Save Date will need to be set to WARNING or OFF in the .tcf file if the –ca option has not been used as the .tab and other files will not have been copied.&lt;br /&gt;
&amp;lt;li&amp;gt;There is a limit of 1,000 characters (including spaces) on pathnames. As very long pathnames can result due to the above approach, if the number of characters exceeds 1,000, problems may occur.&lt;br /&gt;
&amp;lt;li&amp;gt;The -c switch automatically invokes the -t (ie. the simulation does not commence, only the input data is tested/checked).&lt;br /&gt;
&amp;lt;li&amp;gt;The -b option still applies if several models wish to be copied using a batch (.bat) file.&lt;br /&gt;
&amp;lt;/ol&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example that copies all files (-ca switch) is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -ca &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
An example that copies all files to an alternate path (-cap) is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -cap &amp;quot;C:\Copy_of_model&amp;quot; &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
An example that copies all files to an alternate path, excluding any check files, (-capncf) is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -capncf &amp;quot;C:\Copy_of_model&amp;quot; &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Package a TUFLOW model===&lt;br /&gt;
Package model function attempts to copy all input files for all events and scenarios defined in the model, if only single set of events and scenarios is required, -c is preferable. Unlike the -c option, -pm does not read and process the data during the file copy, as such it is substantially faster than -c. The package model function does not require access to a TUFLOW licence.&lt;br /&gt;
&lt;br /&gt;
Additional optional flags can be added to the base &#039;&#039;&#039;-pm&#039;&#039;&#039; switch, in any combination, including:&amp;lt;br&amp;gt;&lt;br /&gt;
;* “All”;&amp;lt;br&amp;gt;&lt;br /&gt;
: The addition of the “All” flag (e.g. -pmAll) copies all file extensions (e.g. 1d_nwk_culv_L.mif, will become 1d_nwk_culv_L.*).&amp;lt;br&amp;gt;&lt;br /&gt;
;* “L” (list); and&amp;lt;br&amp;gt;&lt;br /&gt;
: The addition of the “L” flag (e.g. -pmL) list the files to be copied into an output file, but don’t copy.&amp;lt;br&amp;gt;&lt;br /&gt;
;* “ini” (file.ini)&amp;lt;br&amp;gt;&lt;br /&gt;
: The addition of the “ini” flag (e.g. -pmini) provides a .ini file with user defined options. A .ini file can be used to overwrite the default base and destination folders, and specify events/scenarios for models with events/scenarios in filenames. Valid options should be separated by a vertical bar.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Combinations of the above are also valid, with the order of the optional switches not being important (-pmAllL would be treated the same as -pmLAll).&amp;lt;br&amp;gt;&lt;br /&gt;
When using package model the default destination folder is created in the same directory as the .tcf file, with the prefix “pm_”.  For example, C:\Projects\Modelling\TUFLOW\runs\Run_001.tcf will create a package in the folder “C:\Projects\Modelling\TUFLOW\runs\pm_Run_001\.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Three options are also available for handling of the binary processed files created by TUFLOW to speed up the simulation start.  These options are:&amp;lt;br&amp;gt;&lt;br /&gt;
;* “-xf0”;&amp;lt;br&amp;gt;&lt;br /&gt;
: Do not copy .xf files, only the original inputs are copied.&amp;lt;br&amp;gt;&lt;br /&gt;
;* “-xf1”; and&amp;lt;br&amp;gt;&lt;br /&gt;
: Copy both raw input files and .xf files.&amp;lt;br&amp;gt;&lt;br /&gt;
;* “-xf2”&amp;lt;br&amp;gt;&lt;br /&gt;
: Copy only .xf files, if xf files exist for an input only the xf will be copied.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
An example of package model that copies all files is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -pmAll &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
An example of package model that copies all files except .xf files, (-pmAll -xf0) is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -pmAll -xf0 &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
An example of package model that copies all files with specified .ini file (-pmAllini) is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -pmAllini package.ini &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
An example of .ini file to overwrite the default base and destination folders, and specify events/scenarios for models with events/scenarios in filenames:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Base Folder == &amp;lt;folder&amp;gt;&lt;br /&gt;
Copy Destination == &amp;lt;folder&amp;gt;&lt;br /&gt;
Model Scenario ~s&amp;lt;number&amp;gt;~ == &amp;lt;scenario A&amp;gt; | &amp;lt;scenario B&amp;gt; | …&lt;br /&gt;
Model Event ~e&amp;lt;number&amp;gt;~ == &amp;lt;event A&amp;gt; | &amp;lt;event B&amp;gt; | …&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GPU Module Control===&lt;br /&gt;
The -pu switch can be used to select which GPU card or cards to direct the simulation towards.  –pu must be specified once for each device.  For example, to direct the simulation to GPU devices 0 and 2, specify -pu0 -pu2.  (Note: the GPU device numbering starts a 0, not 1). For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -pu0 -pu2 &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_5m_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Event and Scenario Management===&lt;br /&gt;
The -e and -s switches can be used to manage multiple events and scenarios from a single tuflow control file. The -e and -s wildcard is replaced by the following entry specified in the batch file. For example, the following batch file commands will run two simulations in series:&lt;br /&gt;
* M01_Q050_24hr_2m_Dev_001.tcf; and&lt;br /&gt;
* M01_Q100_24hr_2m_Dev_001.tcf; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Start &amp;quot;TUFLOW&amp;quot; /wait  &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -b  -e1 Q050  -e2 24hr  -s1 2m  -s2 Dev  &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_~e1~_~e2~_~s1~_s2~_001.tcf&amp;quot;&lt;br /&gt;
Start &amp;quot;TUFLOW&amp;quot; /wait  &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot;  -b  -e1 Q100  -e2 24hr  -s1 2m  -s2 Dev  &amp;quot;C:\TUFLOW\Tutorial_Wiki\TUFLOW\runs\M01_~e1~_~e2~_~s1~_s2~_001.tcf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please be aware that the % symbol is a special character in a batch file. If the % symbol is used within a wildcard, it will not be read when searching for that wildcard in TUFLOW.&amp;lt;br&amp;gt;&lt;br /&gt;
For example if the following event wildcard is used;&amp;lt;br&amp;gt;&lt;br /&gt;
*-e 10% &amp;lt;br&amp;gt;&lt;br /&gt;
TUFLOW will search for &#039;10&#039; instead of &#039;10%&#039; as the event wildcard.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
It is recommended that modellers avoid the use of a % symbol in any wildcard values. The string &#039;pct&#039; is a great alternative for the % symbol. &amp;lt;br&amp;gt;&lt;br /&gt;
For example, using:&amp;lt;br&amp;gt;&lt;br /&gt;
*-e 10pct &amp;lt;br&amp;gt;&lt;br /&gt;
Alternatively, using the % symbol twice in a row as shown below should result in a desired wildcard value.&amp;lt;br&amp;gt;&lt;br /&gt;
*-e 10%% (TUFLOW will search for 10%)&lt;br /&gt;
&lt;br /&gt;
==Advanced Batch Files==&lt;br /&gt;
The below section shows example batch files for maximizing run efficiency,  &lt;br /&gt;
===Creating a delay===&lt;br /&gt;
====Windows 7 and newer====&lt;br /&gt;
For a Windows 7 and newer operating system a delay of a set duration can be created with the Timeout &amp;lt;seconds&amp;gt; command.  For example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Timeout 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
Will create a 10 second delay, a countdown timer is given. Press any key to continue.&lt;br /&gt;
&lt;br /&gt;
====Other Systems====&lt;br /&gt;
It is possible to create a delay of specified length in a batch file.  The best way do this is actually to create a second batch file! To do this create a text file and call it &#039;&#039;&#039;wait.bat&#039;&#039;&#039;.  Within that file enter the following text:&lt;br /&gt;
&amp;lt;pre&amp;gt;@ping 127.0.0.1 -n 2 -w 1000 &amp;gt; nul&lt;br /&gt;
@ping 127.0.0.1 -n %1% -w 1000&amp;gt; nul&amp;lt;/pre&amp;gt;&lt;br /&gt;
To create the pause we ping an address for a set time and disregard the output. Once the wait.bat has been created, it can be called from another batchfile using the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;call wait &amp;lt;time in seconds.&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example below, the first simulation is started and then 60 seconds later (using the wait.bat file) the second simulation is started.  Note there is no /wait flag specified, if there was the batchfile would wait for 60 seconds after the first simulation had finished before starting the second simulation.&lt;br /&gt;
&amp;lt;pre&amp;gt;Start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; M01_5m_001.tcf&lt;br /&gt;
call wait 60&lt;br /&gt;
Start &amp;quot;TUFLOW&amp;quot; /wait &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; M01_2.5m_001.tcf&amp;lt;/pre&amp;gt;&lt;br /&gt;
For this to work the wait.bat file needs to be in the same folder as the batchfile calling it. You can put the file in a specific location and add this path as an environment variable.  If this is done &amp;quot;call wait &amp;lt;time in seconds&amp;gt; can be added to any batch file.&amp;lt;br&amp;gt;&lt;br /&gt;
To set the environment variable, you will need to have administrator access to the machine, and add a colon (;) and then the batchfile location (e.g. &amp;quot;C:\batch_files\&amp;quot; , without the quotes) in the &#039;&#039;&#039;path&#039;&#039;&#039; system variables.  The separator character is a colon (;) this is added to specify a new path. For more details on modifying the environment please see here: [http://support.microsoft.com/kb/310519 http://support.microsoft.com/kb/310519].&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
Batch files can be easily setup so that they are more generic and easily customised when moving from one project to another.  For example, in the below a variable, TUFLOWEXE, is used to define the path to the TUFLOW exe to be used, and a variable RUN is used to incorporate options such as the /wait so that the simulations run in series (one after the other).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;set TUFLOWEXE=C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&lt;br /&gt;
set RUN=start &amp;quot;TUFLOW&amp;quot; /wait &amp;quot;%TUFLOWEXE%&amp;quot; -b&lt;br /&gt;
%RUN% MR_H99_C25_Q100.tcf&lt;br /&gt;
%RUN% MR_H99_C25_Q050.tcf&lt;br /&gt;
%RUN% MR_H99_C25_Q020.tcf&amp;lt;/pre&amp;gt;&lt;br /&gt;
The advantage of using variables is if the path to the TUFLOW exe changes, or to run a different version of TUFLOW, it is just a simple change in the .bat file.  In the above, note the use of quotes around %TUFLOWEXE% in the definition for the RUN variable – quotes are needed around file pathnames whenever they contain a space.&lt;br /&gt;
===Looping in a batch file===&lt;br /&gt;
If you have a large number of events to run using the event files a for loop can be used in a batch file. In this example we have 5 event magnitudes (-e1 input) and 5 event durations (-e2 input). The following batch file can be used to run all 25 simulations one after the other:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
REM This sets the variables as local, so you can use another batch file with A and B variables&lt;br /&gt;
SetLocal&lt;br /&gt;
&lt;br /&gt;
REM set up variables&lt;br /&gt;
set A=Q010 Q020 Q050 Q100 Q200&lt;br /&gt;
set B=10min 30min 60min 120min 270min&lt;br /&gt;
&lt;br /&gt;
REM Loop Through&lt;br /&gt;
FOR %%a in (%A%) do (&lt;br /&gt;
    FOR %%b in (%B%) DO (&lt;br /&gt;
        start &amp;quot;TUFLOW&amp;quot; /wait C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe -b -e1 %%a -e2 %%b filename.tcf&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In order to test the syntax, you can test the batch file by replacing the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;start &amp;quot;TUFLOW&amp;quot; /wait C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe -b -e1 %%a -e2 %%b filename.tcf&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;u&amp;gt;echo&amp;lt;/u&amp;gt; start &amp;quot;TUFLOW&amp;quot; /wait C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe -b -e1 %%a -e2 %%b filename.tcf&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
By using the echo in the command line, rather than starting the simulations the command line will be displayed in the DOS output. In the example above the DOS output is shown in the image below.&lt;br /&gt;
[[File:DOS nested batch output.png|frame|none]]&lt;br /&gt;
&lt;br /&gt;
Alternatively this can be achieved using the following syntax, which is essentially the same but has the for loops compressed to a single line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
setlocal&lt;br /&gt;
set A=Q010 Q020 Q050 Q100 Q200&lt;br /&gt;
set B=10min 30min 60min 120min 270min&lt;br /&gt;
&lt;br /&gt;
FOR %%a in (%A%) do FOR %%b in (%B%) do start &amp;quot;TUFLOW&amp;quot; TUFLOW_iSP_w64.exe -b -e1 %%a -e2 %%b filename_~e1~_~e2~.tcf&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This can be extended to more variables for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
setlocal&lt;br /&gt;
set A=Q010 Q020 Q050 Q100 Q200&lt;br /&gt;
set B=10min 30min 60min 120min 270min&lt;br /&gt;
set C=Exg Dev Mit&lt;br /&gt;
&lt;br /&gt;
FOR %%a in (%A%) do (&lt;br /&gt;
    FOR %%b in (%B%) do (&lt;br /&gt;
        FOR %%c in (%C%) do (&lt;br /&gt;
            start &amp;quot;TUFLOW&amp;quot; /wait TUFLOW_iSP_w64.exe -b -e1 %%a -e2 %%b -s1 %%c filename_~e1~_~e2~_~s1~.tcf&lt;br /&gt;
        )&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Looping in a batch file up to a certain number of runs===&lt;br /&gt;
The below example shows a method for controlling the number of concurrent simulations.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a brief description of the below, the &amp;quot;do_while_loop_start&amp;quot; counts the number of processes in the task manager which have &amp;quot;TUFLOW&amp;quot; in the name.  If this is greater than or equal to the variable &amp;quot;CPU_Cores&amp;quot; then the batch file waits for 60 seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ echo off&lt;br /&gt;
 &lt;br /&gt;
Set A=Q001 Q002 Q005 Q010 Q020 Q050 Q100&lt;br /&gt;
Set B=Exg Dev&lt;br /&gt;
set /a CPU_Cores=3&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
FOR %%a in (%A%) DO (               &lt;br /&gt;
    FOR %%b in (%B%) DO (&lt;br /&gt;
       call :do_while_loop_start&lt;br /&gt;
       Start &amp;quot;TUFLOW&amp;quot; &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -b -e1 %%a -s1 %%b M01_5m_~e1~_~s1~_001.tcf&lt;br /&gt;
       )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Pause&lt;br /&gt;
 &lt;br /&gt;
:do_while_loop_start&lt;br /&gt;
    set /a count=0&lt;br /&gt;
    for /f %%x in (&#039;tasklist ^| find /c &amp;quot;TUFLOW&amp;quot;&#039;) do set count=%%x&lt;br /&gt;
    if %count% geq %CPU_Cores% (&lt;br /&gt;
        PING 1.1.1.1 -n 1 -w 60000 &amp;gt;NUL&lt;br /&gt;
        goto do_while_loop_start&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to achieve the same result using IF logic is shown below. This batch file will loop through the series of 14 simulations in groups of three. The batch file will pause until the last of the three active model simulations are complete. When complete, the next series of three simulations will be started in parallel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ echo off&lt;br /&gt;
setlocal enabledelayedexpansion&lt;br /&gt;
 &lt;br /&gt;
SET A=Q001 Q002 Q005 Q010 Q020 Q050 Q100&lt;br /&gt;
SET B=Exg Dev&lt;br /&gt;
SET P=3&lt;br /&gt;
&lt;br /&gt;
SET /A Counter=0&lt;br /&gt;
FOR %%a in (%A%) DO (               &lt;br /&gt;
    FOR %%b in (%B%) DO (&lt;br /&gt;
       SET /A Counter+=1&lt;br /&gt;
       IF /i !Counter!==!P! (&lt;br /&gt;
           Start &amp;quot;TUFLOW&amp;quot; /wait &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -b -e1 %%a -s1 %%b M01_5m_~e1~_~s1~_001.tcf&lt;br /&gt;
           SET /A Counter=0&lt;br /&gt;
	) ELSE (&lt;br /&gt;
	   Start &amp;quot;TUFLOW&amp;quot;       &amp;quot;C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&amp;quot; -b -e1 %%a -s1 %%b M01_5m_~e1~_~s1~_001.tcf&lt;br /&gt;
	)&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Looping in a batch file using scenario logic===&lt;br /&gt;
Sometimes when using different scenarios, it is useful to run a specific set of events for one scenario but other events for a different scenario.&amp;lt;br&amp;gt;&lt;br /&gt;
This can be automated within looped batch files using a bit of logic.&amp;lt;br&amp;gt;&lt;br /&gt;
In the the example below there is model with defended and undefended scenarios. The defended scenario needs to be run for the 20, 100 and 200 year events but the undefended scenario is only run for the 100 year event. All models are run for the hr and 3hr critical durations.&amp;lt;br&amp;gt;&lt;br /&gt;
The below batch file also uses the looping up to a certain number of runs, as seen in the point above.&amp;lt;br&amp;gt;&lt;br /&gt;
To customize this script, alter the location of the TUFLOW executable, the name of tcf and the scenarios that you would like to run (Refer to &#039;Set A==&#039;, &#039;Set C==&#039; and &#039;Set B==&#039;). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@ echo off&lt;br /&gt;
setlocal enabledelayedexpansion&lt;br /&gt;
&lt;br /&gt;
REM ______________SET RUN VARIABLES_____________&lt;br /&gt;
set TUFLOWEXE=C:\TUFLOW\Releases\2020-10-AE\TUFLOW_iSP_w64.exe&lt;br /&gt;
set RUN=start &amp;quot;TUFLOW&amp;quot; /low &amp;quot;%TUFLOWEXE%&amp;quot; -b &lt;br /&gt;
set /a CPU_Cores=5&lt;br /&gt;
&lt;br /&gt;
set tcf=M01_5m_~s1~_~e1~_~e2~_001.tcf&lt;br /&gt;
&lt;br /&gt;
Set A=UDEF DEF&lt;br /&gt;
REM set B in loop beow &lt;br /&gt;
Set C==01hr 03hr&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REM ______________SET LOOPS____________________&lt;br /&gt;
FOR %%a in (%A%) do (&lt;br /&gt;
&lt;br /&gt;
REM _____DEFINE RUN LOGIC______&lt;br /&gt;
	IF &amp;quot;%%a&amp;quot;==&amp;quot;UDEF&amp;quot; (&lt;br /&gt;
		set B=100yr&lt;br /&gt;
	)&lt;br /&gt;
 	IF &amp;quot;%%a&amp;quot;==&amp;quot;DEF&amp;quot; (&lt;br /&gt;
 		set B=020yr 100yr 200yr&lt;br /&gt;
 	)&lt;br /&gt;
	&lt;br /&gt;
REM ______________RUN LOOPS____________________&lt;br /&gt;
	FOR %%b in (!B!) do (&lt;br /&gt;
		FOR %%c in (%C%) do (&lt;br /&gt;
			call :do_while_loop_start&lt;br /&gt;
			%RUN% -s1 %%a -e1 %%b -e2 %%c %tcf%&lt;br /&gt;
			timeout 60&lt;br /&gt;
			&lt;br /&gt;
		)&lt;br /&gt;
	)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REM ___________COUNT RUN INSTANCES______________&lt;br /&gt;
:do_while_loop_start&lt;br /&gt;
    set /a count=0&lt;br /&gt;
    for /f %%x in (&#039;tasklist ^| find /c &amp;quot;TUFLOW&amp;quot;&#039;) do set count=%%x&lt;br /&gt;
    if %count% geq %CPU_Cores% (&lt;br /&gt;
        PING 1.1.1.1 -n 1 -w 60000 &amp;gt;NUL&lt;br /&gt;
        goto do_while_loop_start&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
endlocal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Coordinating Asynchronous Simulations===&lt;br /&gt;
This batch file will set off asynchronous runs on separate threads, and then wait for all runs to finish before moving to the next process. This example kicks off 8 tuflow.exe processes and then waits before collating (in fortran) and processing the results (in python). Both “combine_therad_outputs.exe” and “Post_process.py” are dummy programs only (with dummy arguments), and are included just to demonstrate how any sort of post processing might be called after the synchronisation of all TUFLOW simulations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
:: Set local&lt;br /&gt;
setlocal&lt;br /&gt;
:: User defined variables – will need to be changed&lt;br /&gt;
set &amp;quot;for_infile=inputs_fortran.inp&amp;quot;&lt;br /&gt;
set &amp;quot;run_exe=tuflow.exe&amp;quot;&lt;br /&gt;
set &amp;quot;file_prefix=C:\temp\test&amp;quot;&lt;br /&gt;
set &amp;quot;sum_exe=combine_thread_outputs.exe&amp;quot;&lt;br /&gt;
set &amp;quot;n_threads=8&amp;quot;&lt;br /&gt;
set &amp;quot;pyt_code=Post_process.py&amp;quot;&lt;br /&gt;
set &amp;quot;pyt_infile=inputs_python.inp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:: Random lock file&lt;br /&gt;
set &amp;quot;lock=%temp%\wait%random%.lock&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:: Launch processes asynchronously, with stream 9 redirected to a lock file.&lt;br /&gt;
:: The lock file will remain locked until the individual exe instance ends.&lt;br /&gt;
:: %%a is sent to %run_exe% as an argument to set the thread to use&lt;br /&gt;
for /L %%a in (0,1,7) do (&lt;br /&gt;
start &amp;quot;&amp;quot; 9&amp;gt;&amp;quot;%lock%%%a&amp;quot; %run_exe% %for_infile% %%a&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
:: Wait for the processes to finish&lt;br /&gt;
:Waitrun&lt;br /&gt;
1&amp;gt;nul 2&amp;gt;nul ping /n %n_threads% ::1&lt;br /&gt;
for /L %%N in (0,1,7) do (&lt;br /&gt;
  (call ) 9&amp;gt;&amp;quot;%lock%%%N&amp;quot; || goto :Waitrun&lt;br /&gt;
) 2&amp;gt;nul&lt;br /&gt;
&lt;br /&gt;
:: Delete the lock files&lt;br /&gt;
del &amp;quot;%lock%*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:: Collate thread outputs&lt;br /&gt;
%sum_exe% %file_prefix% %n_threads%&lt;br /&gt;
&lt;br /&gt;
:: Make image&lt;br /&gt;
python %pyt_code% %pyt_infile%&lt;br /&gt;
&lt;br /&gt;
:: Finish up&lt;br /&gt;
echo Done.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Shutdown on Completion===&lt;br /&gt;
Often we may have a number of TUFLOW simulations going when we leave work on a Friday afternoon, if these are not going to take all weekend to run, using some of the batch file logic above you can create a batch file that will shutdown the computer when no TUFLOW simulations are running.  An example batch file for this purpose is below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo off&lt;br /&gt;
&lt;br /&gt;
:do_while_loop_start&lt;br /&gt;
    set /a count=0&lt;br /&gt;
    for /f %%x in (&#039;tasklist ^| find /c &amp;quot;TUFLOW&amp;quot;&#039;) do set count=%%x&lt;br /&gt;
    IF %count%==0 (&lt;br /&gt;
		shutdown.exe /s /t 30&lt;br /&gt;
	) ELSE (&lt;br /&gt;
        timeout 60&lt;br /&gt;
        goto do_while_loop_start&lt;br /&gt;
	)&lt;br /&gt;
pause&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This batch file counts the number of processes with &amp;quot;TUFLOW&amp;quot; in the process name and if this is greater than 0, a delay of 60 seconds is created and the loop started again.  If no &amp;quot;TUFLOW&amp;quot; simulations are running a shutdown command is issued.&amp;lt;br&amp;gt;&lt;br /&gt;
To test the batch file it is recommended that you add an &amp;quot;echo&amp;quot; in front of the &amp;lt;tt&amp;gt;shutdown.exe /s /t 30&amp;lt;/tt&amp;gt; command to ensure it is working correctly (I use this on a Windows 7 machine, but have not tested it on either XP or Windows 8).&amp;lt;br&amp;gt;&lt;br /&gt;
In order to restart the machine rather than power it off the /s can be replaced with /r.  This can be useful when a heavily utilised modelling computer needs a restart!&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=User:Par&amp;diff=33522</id>
		<title>User:Par</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=User:Par&amp;diff=33522"/>
		<updated>2023-06-01T02:39:17Z</updated>

		<summary type="html">&lt;p&gt;Par: tidied up my role&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Phillip Ryan is involved in numerical modelling projects in the flooding and coastal areas.  These include flood studies, floodplain management studies, flood impact assessments, storm tide studies, Monte Carlo analysis, wave modelling, coastal hydrodynamic and advection-dispersion modelling. Phillip is involved in TUFLOW software development, support and training.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2720&amp;diff=33521</id>
		<title>TUFLOW Message 2720</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_Message_2720&amp;diff=33521"/>
		<updated>2023-06-01T02:37:11Z</updated>

		<summary type="html">&lt;p&gt;Par: Created page with &amp;quot;{{TUFLOW_Message |tuflow_message=ERROR 2720 - With NetCDF call &amp;lt;NetCDF Library call&amp;gt;.  NetCDF: &amp;lt;Error reported by NetCDF library&amp;gt; |alt_msg=NA |type=ERROR |message_desc=The...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TUFLOW_Message&lt;br /&gt;
|tuflow_message=ERROR 2720 - With NetCDF call &amp;lt;NetCDF Library call&amp;gt;.  NetCDF: &amp;lt;Error reported by NetCDF library&amp;gt;&lt;br /&gt;
|alt_msg=NA&lt;br /&gt;
|type=[[ERROR]]&lt;br /&gt;
|message_desc=There has been an error reported in the underlying NetCDF library used by TUFLOW.  The last part of the message should contain the error message return from the NetCDF, this may give an indication as to what the issue is.  For example &#039;&#039;&#039;NetCDF: cannot delete file&#039;&#039;&#039; could occur if overwriting a file which is locked by another application. &lt;br /&gt;
|suggestions=Read the NetCDF error message to see if this explains why the error maybe occurring.  If this does not make sense, please send the .tlf file to support@tuflow.com&lt;br /&gt;
|uplink=[[2xxx_TUFLOW_Messages|2xxx Messages]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Main_Page&amp;diff=18936</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Main_Page&amp;diff=18936"/>
		<updated>2020-09-22T22:23:25Z</updated>

		<summary type="html">&lt;p&gt;Par: Changed a couple of links from http:// to https://&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&amp;lt;span&amp;gt;[[File:TUFLOWNewLogo.jpg|250px|link=https://tuflow.com/|left|top|target=&amp;quot;_blank&amp;quot;]][[File:BMT logo (PowerPoint) Logo Only.png|200px|link=https://www.bmtwbm.com.au/|right]]&lt;br /&gt;
&amp;lt;center style=font-size:290%;color:#005581;background: white&amp;gt;TUFLOW Wiki Homepage&amp;lt;/center&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
This Wiki contains information relating to the flood and coastal simulation software TUFLOW Classic and TUFLOW HPC (Heavily Parallelised Compute). It is designed to be used in conjunction with the TUFLOW [https://www.tuflow.com/Download/TUFLOW/Releases/2018-03/TUFLOW%20Manual.2018-03.pdf  Manual], [https://www.tuflow.com/forum/index.php?act=idx Forum] and [https://www.tuflow.com/Default.aspx  Website] &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of quad-table section --&amp;gt;&lt;br /&gt;
{|style=&amp;quot;width:100%; border-spacing:8px; margin:0px 0px;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Start of 1st quad-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:20%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt;TUFLOW Set-up and use&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
[[File:Wiki Homepage Start Here v2.PNG||150px|right]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;TUFLOW&amp;lt;/u&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* [[New_User_Installation_Guide| How to install TUFLOW]]&lt;br /&gt;
* [[TUFLOW_Licensing | How to configure a licence]]&lt;br /&gt;
* [[Tutorial_Model| How to build a TUFLOW model (tutorials)]]&lt;br /&gt;
* [[Running_TUFLOW | How to run a TUFLOW model]]&lt;br /&gt;
* [[TUFLOW_Utilities | Free pre/post-processing utilities]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;TUFLOW Benchmarks&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* [[TUFLOW_Benchmarking | TUFLOW Solution Accuracy Benchmarks]]&lt;br /&gt;
* [[Hardware_Benchmarking | Computer Hardware Speed Benchmarks]]&lt;br /&gt;
* [[Hardware_Benchmarking_(2018-03-AA) | Computer Hardware Speed Benchmarks - New 2018 Release Version]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Best Practice Guidance&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* [[TUFLOW_Modelling_Webinars | Webinar Recordings]]&lt;br /&gt;
* [[TUFLOW_Modelling_Guidance | Other Useful Modelling Guidance]]&lt;br /&gt;
|}&amp;lt;!-- End of 1st quad-table --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Start of 2nd quad-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:20%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt;Tutorial Models (TUFLOW Classic and HPC)&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
[[File:Wiki_Homepage_Blackboard_v2.PNG||200px|right]]&lt;br /&gt;
* [[Tutorial_Model|Tutorial Model Introduction]]&lt;br /&gt;
* [[Tutorial Module01|Module 1]]  (2D only)&lt;br /&gt;
* [[Tutorial Module02|Module 2]]  (1D Culverts)&lt;br /&gt;
* [[Tutorial Module03|Module 3]]  (2D Topography Updates)&lt;br /&gt;
* [[Tutorial Module04|Module 4]]  (1D Channel / 2D Floodplain)&lt;br /&gt;
* [[Tutorial Module05|Module 5]]  (Scenario / Logic Control)&lt;br /&gt;
* [[Tutorial Module06|Module 6]]  (Modelling Bridges)&lt;br /&gt;
* [[Tutorial Module07|Module 7]]  (Urban Pipe Modelling)&lt;br /&gt;
* [[Tutorial Module08|Module 8]]  (Direct Rainfall Modelling)&lt;br /&gt;
* [[Tutorial_Module09|Module 9]]  (Multiple Domain 2D-2D Model)&lt;br /&gt;
* [[Tutorial_Module10|Module 10]] (Managing Multiple Events)&lt;br /&gt;
* [[Tutorial_Module11|Module 11]] (Dam Break Modelling)&lt;br /&gt;
* [[Tutorial Module14|Module 14]] (Pump Modelling in 2D)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Flood_Modeller_Tutorial_Model|Flood Modeller Introduction]]&lt;br /&gt;
* [[Flood_Modeller_Tutorial_Module01|FM Module 1]]  (Linking Flood Modeller to TUFLOW)&lt;br /&gt;
* [[Flood_Modeller_Tutorial_Module02|FM Module 2]]  (Linking Flood Modeller to ESTRY)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- End of 2nd quad-table --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of 3rd quad-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:20%; border:1px solid #005581; vertical-align:top; background:#B5CBDF;&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt;TUFLOW Troubleshooting&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
[[File:Wiki Homepage Health.PNG|150px|right]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Error/Warning Message Database&amp;lt;/u&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* [[TUFLOW_Message_How_To|About This Database]]&lt;br /&gt;
* [[0xxx TUFLOW Messages]]&lt;br /&gt;
* [[1xxx TUFLOW Messages]]&lt;br /&gt;
* [[2xxx TUFLOW Messages]]&lt;br /&gt;
* [[3xxx TUFLOW Messages]]&lt;br /&gt;
* [[9xxx TUFLOW Messages]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* [[TUFLOW_Check_Files|TUFLOW Check Files]]&lt;br /&gt;
* [https://www.tuflow.com/forum/index.php?act=idx| TUFLOW Forum]&lt;br /&gt;
* [mailto:support@tuflow.com support@tuflow.com]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- End of 3rd quad-table --&amp;gt;&lt;br /&gt;
&amp;lt;!-- End of quad-table section --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- Start of new quad-table section --&amp;gt;&lt;br /&gt;
{|style=&amp;quot;width:100%; border-spacing:8px; margin:0px 0px;&amp;quot; &amp;lt;!-- Starts and separates overall section table --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of 1st quad-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:30%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:center; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt;Downloads&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-overlay&amp;quot; widths=100px heights=100px color:red&amp;gt;&lt;br /&gt;
Image:Mainpage_TUFLOW_Installer_Logo_001.PNG|[https://www.tuflow.com/Downloads.aspx DOWNLOAD TUFLOW CLICK HERE]&lt;br /&gt;
Image:Mainpage_TUFLOW_Release_Notes_001.PNG|[https://www.tuflow.com/Downloads.aspx RELEASE NOTES]&lt;br /&gt;
Image:Mainpage_TUFLOW_Manual_003.PNG|[https://www.tuflow.com/Downloads.aspx USER MANUAL]&lt;br /&gt;
Image:Wiki Homepage Free v2.PNG|[[New_User_Guide_Free_Demo_Version| TRY TUFLOW FOR FREE]]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- End of 1st quad-table --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of 2nd single-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:30%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:center; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt; Recent Wiki Updates / New Content (click image to view)&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;width:50%; vertical-align:top; color:#000; background:#B5CBDF; padding:0.2em 0.4em; font-size:92%&amp;quot;|&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed-overlay&amp;quot; widths=110px heights=110px&amp;gt;&lt;br /&gt;
Image:Quadtree_Implementation_Guide_005.jpg|[[TUFLOW_Modelling_Webinars#TUFLOW_Modelling_Webinars | Webinar: Quadtree Implementation]]&lt;br /&gt;
Image:Remap Advice LinkedIn.jpg | [[TUFLOW_Remapping | TUFLOW Remapping Tool]]&lt;br /&gt;
Image:Hardware_Configuration_001.jpg|[[Hardware_Selection_Guidance | Hardware Selection Advice]]&lt;br /&gt;
Image:TUFLOW_Output_Advice.jpg|[[TUFLOW_Modelling_Webinars | Webinar: Output Management Advice]]&lt;br /&gt;
Image:QGIS_Instalation_Guide_Youtube_Picture.jpg|[[TUFLOW_Modelling_Webinars | Webinar: QGIS Configuration and Use Advice]]&lt;br /&gt;
Image:Notepad_Webinar_Cover.PNG|[[TUFLOW_Modelling_Webinars | Webinar: Notepad++ Configuration Advice]]&lt;br /&gt;
Image:Webinar_Calibration.PNG|[[TUFLOW_Modelling_Webinars | Webinar: Model Calibration]]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- End of 2nd single-table --&amp;gt;&lt;br /&gt;
&amp;lt;!-- End of quad-table section --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Start of new quad-table section --&amp;gt;&lt;br /&gt;
{|style=&amp;quot;width:100%; border-spacing:8px; margin:0px 0px;&amp;quot; &amp;lt;!-- Starts and separates overall section table --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of 1st double-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:50%; border:1px solid #005581; vertical-align:top; color:#000; background:#B5CBDF;&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt; Tips and Tricks&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;width:50%; vertical-align:top; color:#000; background:#B5CBDF; padding:0.2em 0.4em;&amp;quot;|&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Text Editor/Spreadsheet Software&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Excel_Tips | Excel]]&lt;br /&gt;
* [[NotepadPlusPlus_Tips | Notepad ++]]&lt;br /&gt;
* [[TextPad_Tips | TextPad]]&lt;br /&gt;
* [[UltraEdit_Tips | UltraEdit]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;GIS Software&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* [[12D_Model | 12D Model]]&lt;br /&gt;
* [[ArcGis_Tips | ArcGIS]]&lt;br /&gt;
* [[Ensight_Tips | Ensight]]&lt;br /&gt;
* [[GeoRiver_Tips|GeoRiver]]&lt;br /&gt;
* [[Google_Earth_Tips | Google Earth]]&lt;br /&gt;
* [[MapInfo_Tips | MapInfo / Vertical Mapper / Encom Discover]]&lt;br /&gt;
* [[QGIS_Tips | QGIS (Previously Quantum GIS)]]&lt;br /&gt;
* [[SMS_Tips | SMS]]&lt;br /&gt;
* [[SAGA_Tips | SAGA]]&lt;br /&gt;
|style=&amp;quot;width:50%; vertical-align:top; color:#000; background:#B5CBDF; padding:0.2em 0.4em;&amp;quot;|&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Model Conversions&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* EPA SWMM to TUFLOW           (coming soon)&lt;br /&gt;
* [[FLO2D_to_TUFLOW | FLO2D to TUFLOW]] &lt;br /&gt;
* [[HEC-RAS_to_TUFLOW | HEC-RAS to TUFLOW]]&lt;br /&gt;
* [[MIKE_Flood_to_TUFLOW|MIKE Flood to TUFLOW]]&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Other&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* [[DOS_Window_Tips | DOS Window]]&lt;br /&gt;
* [[Windows_Tips|Windows]]&lt;br /&gt;
* [[TUFLOW_Utilities | TUFLOW Utilities]]&lt;br /&gt;
* [[Hardware_Selection_Advice | Hardware Selection Advice]]&lt;br /&gt;
* [[Flood Modeller-TUFLOW Linking| Flood Modeller-TUFLOW Linking]]&lt;br /&gt;
* Python (Coming Soon)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- End of 1st new quad-table --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- Start of 2nd new quad-table --&amp;gt;&lt;br /&gt;
|style=&amp;quot;width:50%; border:1px solid #005581; vertical-align:top; color:white; background:#B5CBDF;&amp;quot;| &amp;lt;!-- Stlyes following double table section --&amp;gt;&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top; background:#B5CBDF;&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#005581; font-size:120%; font-weight:bold; border:1px solid #005581; text-align:left; color:white; padding:0.2em 0.4em;&amp;quot;&amp;gt;Demo/Example Models&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||&lt;br /&gt;
{|&lt;br /&gt;
|style=&amp;quot;width:50% vertical-align:top; color:#000; background:#B5CBDF; padding:0em 1em;&amp;quot;|&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Example Models&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The example models are a set of 80 standalone&amp;lt;br&amp;gt; models that demonstrate some of the most widely&amp;lt;br&amp;gt; used features of TUFLOW. They are separated&amp;lt;br&amp;gt; into the following categories:&amp;lt;br&amp;gt;&lt;br /&gt;
* [[Example_Models_Home_page| Basic 2D model]]&lt;br /&gt;
* [[Example_Models_Home_page|Output options]]&lt;br /&gt;
* [[Example_Models_Home_page|Boundary Condition Options]]&lt;br /&gt;
* [[Example_Models_Home_page|Topography Updates]]&lt;br /&gt;
* [[Example_Models_Home_page|Loss Options]]&lt;br /&gt;
* [[Example_Models_Home_page|Scenario/Event Management]]&lt;br /&gt;
* [[Example_Models_Home_page|Bridges]]&lt;br /&gt;
* [[Example_Models_Home_page|1D/2D modelling]]&lt;br /&gt;
* [[Example_Models_Home_page|1D Operating Structures]]&lt;br /&gt;
* [[Example_Models_Home_page|2D/2D Modeling]]&lt;br /&gt;
* [[Example_Models_Home_page|TUFLOW HPC (Including GPU Hardware)]]&lt;br /&gt;
|style=&amp;quot;width:50%; vertical-align:top; horizontal-align:right color:#000; background:#B5CBDF; padding:0em 1em;&amp;quot;|&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;u&amp;gt;Floodplain Management Association Challenge Models&amp;lt;/u&amp;gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The following models were created as part of the Floodplain Management Association 2012 Annual Conference 2-D Modelling Challenge:&lt;br /&gt;
* [[FMA_Challenge_Models_Introduction | FMA Challenge Models Introduction]]&lt;br /&gt;
* [[FMA Challenge 1 (1D-2D linked)|FMA Challenge 1]] (FMA Challenge 1D-2D linked)&lt;br /&gt;
* [[FMA Challenge 2|FMA Challenge 2]] (2D only, TUFLOW and TUFLOW-GPU)&lt;br /&gt;
* [[FMA Challenge 3|FMA Challenge 3]] (1D-2D, including infiltration) &lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- End of 2nd quad-table --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{{NUMBEROFARTICLES}} pages have been created&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=ASC_to_ASC&amp;diff=15944</id>
		<title>ASC to ASC</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=ASC_to_ASC&amp;diff=15944"/>
		<updated>2018-05-14T10:49:23Z</updated>

		<summary type="html">&lt;p&gt;Par: /* Maximum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
=Introduction=&lt;br /&gt;
asc_to_asc.exe is a utility that can be used to perform a range of operations on gridded files.  The input grids can be either ESRI ASCII grid (.asc) or binary float grids (.flt), both of which can be input and output from TUFLOW.&amp;lt;br&amp;gt;&lt;br /&gt;
This utility is useful for comparing and processing TUFLOW outputs from different .2dm meshes, which can&#039;t be compared with the &amp;lt;u&amp;gt;[[RES_to_RES| res_to_res.exe]]&amp;lt;/u&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
For some options (such as processing maximums or differences) the input (.asc or .flt) files must be of the same row/column dimensions.&amp;lt;br&amp;gt;&lt;br /&gt;
The inputs can be a combination of .asc and .flt grids and the -asc or -flt options can be used to set the output type.&amp;lt;br&amp;gt;&lt;br /&gt;
For a complete list to the operations available, please see the table of contents above.&lt;br /&gt;
&lt;br /&gt;
=Operations=&lt;br /&gt;
==Convert==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-conv&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Converts between .flt and .asc format.  For this operation the output file type is based on the input, for an input .asc file the output will be in .flt format.&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -conv *.flt&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Converts all .flt grids to .asc format.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -conv DEM_M01.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Converts the file &amp;quot;DEM_M01.asc&amp;quot; for .flt format.&lt;br /&gt;
==Maximum==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-max&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Determines the maximum value in all the input .asc files. Two output grids are created:&amp;lt;br&amp;gt;&lt;br /&gt;
*A numerical grid containing the maximum value.&amp;lt;br&amp;gt;&lt;br /&gt;
*A classified grid with the name _src.asc which contains the source grid for the maximum value.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe  -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates a new grid containing the maximum of the 3 input water level grids.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
As per item 2 above,  but specifies the output name &amp;quot;Q100_Max_Levels.asc&amp;quot;.&amp;lt;/li&amp;gt;&lt;br /&gt;
Note that the wildcard character &amp;quot;*&amp;quot; is supported in filenames.  E.g.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_*min_h.asc&amp;lt;/tt&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Difference==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-dif&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Takes the difference between the first two .asc files, the second grid is subtracted from the first.  If an optional third .asc file is specified, this is used as the output file, otherwise, asc_to_asc creates its own output filename using the names of the two input .dat files.  The output is the first .asc file minus the second .asc file. &lt;br /&gt;
Two .asc grids are output:&lt;br /&gt;
*The first is the difference values between the two .asc files.  A difference value only occurs at grid cells that have a value in both grids.  If the cell has a null value (ie. the TUFLOW output was dry at that location) in either or both .asc grids, a null value is output.&lt;br /&gt;
*A second grid with a “_wd” suffix is output to indicate which .asc grid cells were either previously wet and are now dry or vica versa.  Importing this grid into Vertical Mapper creates a .grc (grid classification) grid that has two categories: “Was Wet Now Dry” and “Was Dry Now Wet”.  This grid is particularly useful for displaying areas that were previously inundated or previously flood-free.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -out difference.asc -dif after_h.asc before_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates new grids comparing the differences in flood levels and extents for:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;quot;difference.asc&amp;quot; = &amp;quot;after_h.asc&amp;quot; - &amp;quot;before_h.asc&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Cutoff Depth==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-cd&amp;lt;cutoff value&amp;gt;&amp;quot;&#039;&#039;&#039; &amp;lt;br&amp;gt;&lt;br /&gt;
Outputs a new file only where the value is greater than the cutoff value.&amp;lt;br&amp;gt;&lt;br /&gt;
*If only one grid is specified this grid is processed.&amp;lt;br&amp;gt;&lt;br /&gt;
*If two grids are specified, the first value is used for setting the cutoff depth and the values from the second grid are processed.&amp;lt;br&amp;gt;&lt;br /&gt;
*If three grids are specified, the third grid is used for setting the filename for the output grid. This is ignored if the &amp;quot;-out&amp;quot; option is used.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -cd0.1 depth.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates a new depth grid only where the depth is greater than 0.1m.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -cd0.1 depth.asc levels.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates a new level grid only where the depth is greater than 0.1m.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -cd0.1 -out filtered_levels.asc depths.asc levels.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
As per the example above, but sets the output name as &amp;quot;filtered_levels.asc&amp;quot;.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resize==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-resize&amp;lt;factor&amp;gt;&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Resize the grid based on the factor above.  The factor must be an integer (greater than 1).  The output grid has the same origin (lower left) coordinates as the input grid.  The new cell size is the factor times the old cell size.  For example if a -resize5 is used on a 2m resolution grid the output grid will be 10m.  For processing the grid three options are available&lt;br /&gt;
===Average (default)===&lt;br /&gt;
This is the defualt processing method, which can also be specified with the &#039;&#039;&#039;-rm_avg&#039;&#039;&#039; (resize method - average) input flag.  When processing for each tile in the new grid, the average of all non-null values in the input grid is taken.  For example with a resize factor of 5, the 25 values in the input grid are averaged.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -resize5 -out DEM_10m.asc DEM_2m.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates a new 10m DEM (DEM_10m.asc) based on the the 2m DEM using an averaging approach.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Minimum===&lt;br /&gt;
Alternative processing method for resize, specified with the &#039;&#039;&#039;-rm_min&#039;&#039;&#039; (resize method - minimum) flag.  At each output grid the values is the minimum of the values in the input grid.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -resize5 -rm_min -out DEM_10m_min.asc DEM_2m.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates a new 10m DEM (DEM_10m_min.asc) based on the the 2m DEM using an minimum approach.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Maximum===&lt;br /&gt;
Alternative processing method for resize, specified with the &#039;&#039;&#039;-rm_max&#039;&#039;&#039; (resize method - maximum) flag.  At each output grid the values is the maximum of the values in the input grid.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -resize5 -rm_max -out DEM_10m_max.asc DEM_2m.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Creates a new 10m DEM (DEM_10m_max.asc) based on the the 2m DEM using an maximum approach.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Transform==&lt;br /&gt;
Transforms the values using a simple y = mx + c approach the multiplier (m) is specified with flag &#039;&#039;&#039;-trans_m&amp;lt;value&amp;gt;&#039;&#039;&#039;.  The add value (c)&#039;&#039;&#039;-trans_c&amp;lt;value&amp;gt;&#039;&#039;&#039;.  Only one values is required to be specified.&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -trans_m0.3048 DEM.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Multiplies all values by 0.3048.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -trans_m0.3048 -trans_c10 DEM.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Multiplies all values by 0.3048 and then adds 10.0.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Classify==&lt;br /&gt;
Classifies the grid based on the input classifications.  The output file is a classified .asc grid.  The classification .csv file should have two columns cutoff value and name (in that order). The first line in .csv treated as a header line and ignored.  Any values over the greatest cutoff with be outputted to class &amp;quot;above&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Cutoff Value&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=50% | Name&lt;br /&gt;
|-&lt;br /&gt;
|0.5|| Less than 0.5&lt;br /&gt;
|-&lt;br /&gt;
|1.0|| 0.5 to 1.0&lt;br /&gt;
|-&lt;br /&gt;
|2.0|| 1.0 to 2.0&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -classify classifications.csv results_VMax.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Outputs a classified grid, based on the cut off values and names in the &amp;quot;classifications.csv&amp;quot;.&amp;lt;/li&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using vertical mapper the -grc option can be used to create the .asc file in classified grid format, in this format rather than storing a numerical value when interrogating an area a label is returned.  This format is not recognised by ArcMap or QGIS.  If using the grc option it is also possible to specify the desired RGB (red, green, blue) values for the output grid in the .csv file used for the classification.  The RGB values should be specified in the 3-5th columns of the .csv file.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -RGB -grc -classify depth_classify.csv results_dMax.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=20% | Cutoff Value&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=20% | Name&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=20% | R&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=20% | G&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=20% | B&lt;br /&gt;
|-&lt;br /&gt;
|0.5|| Less than 0.5 || 0 || 0 || 192&lt;br /&gt;
|-&lt;br /&gt;
|1.0|| 0.5 to 1.0  || 0 || 0 || 128&lt;br /&gt;
|-&lt;br /&gt;
|2.0|| 1.0 to 2.0 || 0 || 0 || 64&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the image below two grids are shown in MapInfo / Vertical Mapper, one is classified without the -grc option and a class number is returned for the grid.  The second grid has been created with the -grc option shown, when querying this the label is returned instead.&lt;br /&gt;
&lt;br /&gt;
[[File:TUFLOW Utilities GRC01.jpeg|600px]]&lt;br /&gt;
&lt;br /&gt;
==Extract Breaklines from DEM==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-brkline &amp;lt;gis file in 2d_zsh format&amp;gt;&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This feature was added to the 2013-06-AA version of the utility.&amp;lt;br&amp;gt;&lt;br /&gt;
Extracts elevations from a DEM for breaklines in the 2d_zsh format.  This GIS input should have four attributes, z, dz, width and shape_options, as described in the TUFLOW manual.  For the utility the &#039;&#039;&#039;dz&#039;&#039;&#039;, &#039;&#039;&#039;shape_width&#039;&#039;&#039; and the &#039;&#039;&#039;shape_options&#039;&#039;&#039; are used.  Valid shape_options are &amp;quot;Max&amp;quot; and &amp;quot;Min&amp;quot; or blank (average used). The utility will extract an elevation at each &amp;lt;u&amp;gt;vertex&amp;lt;/u&amp;gt; along the line.  Depending on the line width and DEM cell size, the following methods are used:&amp;lt;br&amp;gt;&lt;br /&gt;
* If the width is set to 0, the closest DEM value to the vertex is used.  If a &amp;quot;shape_option&amp;quot; is specified this is ignored.&lt;br /&gt;
* If the width is greater than 0, but less than 1.5 times the DEM cell size, the four DEM values surrounding the vertex are used.  If max or min is specified in the &amp;quot;shape_option&amp;quot; the max or min of the four values is used.  If max or min option is not specified (attribute is blank), the average of the four values is used.&lt;br /&gt;
* If the width is greater than 1.5 times the DEM cell size, at each vertex a buffer region is created and all non null DEM values within the buffer object are processed.  The diameter of the buffer region is equal to the width specified.  If max or min option is not specified, the average of the values within the region is used.  These buffer regions are outputted as a separate file.&amp;lt;br&amp;gt;&lt;br /&gt;
If a &#039;&#039;&#039;dz&#039;&#039;&#039; value is specified (for the 2014-01-AA version or later) this can be used to control the spacing of vertices along the line.  If a &#039;&#039;&#039;dz&#039;&#039;&#039; value of 100 is specified the maximum spacing along the line is 100 (metres or feet), if the existing vertices along the line are greater than 100 (m or ft) apart additional vertices are inserted.  The method for inserting additional vertices creates equally spaced vertices.  For example, if two vertices along a line are spaced 250m apart and a dz attribute of 100m is specified three line segments of 83.3m will be created as opposed to two segments of 100m and one segment of 50m.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; For the output GIS file, the &#039;&#039;&#039;dz&#039;&#039;&#039; attribute is set to 0.0 regardless of the value set in the input field. &lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -brkline 2d_zsh_breaklines_L.shp DEM.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fuzzy Map==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-fuzzy &amp;lt;input grids&amp;gt;&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This feature was added to the 2014-03-AB version of the utility.&amp;lt;br&amp;gt;&lt;br /&gt;
A fuzzy map can be used when comparing a large number of simulations.&amp;lt;br&amp;gt;&lt;br /&gt;
For each input grid (or scenario) the grid is classed as either 1 if the results grid is wet or 0 if dry.  The total score for each grid cell is is calculated and then divided by the total number of input grids.  A value of 1 indicates that the cell was wet in each simulation a value of 0 is dry in all simulations.  Grids with a value of 0.5 are most sensitive.&amp;lt;br&amp;gt;&lt;br /&gt;
This can be useful for quantifying the sensitivity of the model to parameters.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -fuzzy *_d_Max.flt&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Create a fuzzy map from all maximum depth grids in the directory.&lt;br /&gt;
==Histogram==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-histogram bins.csv &amp;lt;input grid&amp;gt;&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This feature was added to the 2014-03-AB version of the utility.&amp;lt;br&amp;gt;&lt;br /&gt;
Calculates the number of cells and percentage of cells that fall in each range.  Requires and input .csv file containing the bin values.&amp;lt;br&amp;gt;&lt;br /&gt;
An example inputs bin file is:&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Bin&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=50% | Label&lt;br /&gt;
|-&lt;br /&gt;
|0.25|| Less than 0.25&lt;br /&gt;
|-&lt;br /&gt;
|0.5|| 0.25 to 0.50&lt;br /&gt;
|-&lt;br /&gt;
|1.0|| 0.5 to 1.0&lt;br /&gt;
|-&lt;br /&gt;
|2.0|| 1.0 to 2.0&lt;br /&gt;
|-&lt;br /&gt;
|3.0|| 2.0 to 3.0&lt;br /&gt;
|-&lt;br /&gt;
|5.0|| 3.0 to 5.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
An example output looks like the below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Bin&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=25% | Label&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=25% | Count&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=25% | Percentage&lt;br /&gt;
|-&lt;br /&gt;
|0.25|| Less than 0.25 || 986,434 || 58.61&lt;br /&gt;
|-&lt;br /&gt;
|0.5|| 0.25 to 0.50 || 334,422 || 19.87&lt;br /&gt;
|-&lt;br /&gt;
|1.0|| 0.5 to 1.0 || 216,449 || 12.86&lt;br /&gt;
|-&lt;br /&gt;
|2.0|| 1.0 to 2.0 || 118,452 || 7.04&lt;br /&gt;
|-&lt;br /&gt;
|3.0|| 2.0 to 3.0 || 10,206 || 0.61&lt;br /&gt;
|-&lt;br /&gt;
|5.0|| 3.0 to 5.0 || 15,998 || 0.95&lt;br /&gt;
|-&lt;br /&gt;
|Above 5.0|| Above 5.0 || 973 || 0.06&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc_w64.exe –histogram histogram_bins.csv results_d_Max.asc&amp;lt;/tt&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Extract 1D Model Inputs==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-egc control_file.egc&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This allows 1D Network (1d_nwk) and/or 1D Cross-Sections to be extracted from a series of grids.&amp;lt;br&amp;gt;&lt;br /&gt;
A simple input file similar to the TUFLOW geometry control file is input into the utility.  This is nominally given the extension .egc (Estry Geometry Control).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Two input GIS layers can be used, these are the branch lines (channels) and cut lines (cross sections).  The branch line is split into the 1d_nwk layer, a new 1D channel is created for each section.  The GIS attributes of these are defined in the sections below.&lt;br /&gt;
===Branch Lines===&lt;br /&gt;
The branch lines are split into channels using the cross-section cut lines detailed below.  A number of channel characteristics can be set for branch lines.  The required attribute names and data types for branch line are as follows:&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Attribute (type)&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=80% | Description&lt;br /&gt;
|-&lt;br /&gt;
|Name (character 10)|| Sets the branch name, unique chainage identifier is added to all output channels.&lt;br /&gt;
|-&lt;br /&gt;
|n_or_nF (float)|| Sets the output &amp;quot;n_or_nF&amp;quot; attribute for all output channels in the 1d_nwk layer.&lt;br /&gt;
|-&lt;br /&gt;
|UCS (float)|| Sets the &amp;quot;UCS&amp;quot; attribute for all output channels in the 1d_nwk layer.&lt;br /&gt;
|-&lt;br /&gt;
|FLC (float)|| Sets the &amp;quot;FLC&amp;quot; attribute for all output channels in the 1d_nwk layer.  If a value of greater than 0 is specified the FLC is split between channels within the branch.  For example if 0.5 is specified and the branch is split into 10 channels, each channel will have an output &amp;quot;Form_Loss&amp;quot; of 0.05.&lt;br /&gt;
|-&lt;br /&gt;
|ChanType (character 4)|| Sets the &amp;quot;Type&amp;quot; attribute for all output channels in the 1d_nwk layer.  If left blank a default channel type of &amp;quot;S&amp;quot; is applied.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cut Lines===&lt;br /&gt;
For each line in the cut line layer a cross-section will be extracted and output into .csv file format ready for use in TUFLOW.  A number of cross section characteristics can be set for each cut line.  The required attributes for the cross-section cut line are:&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Attribute (type)&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=80% | Description&lt;br /&gt;
|-&lt;br /&gt;
|Source (character 50)|| Optional output cross-section file name.  If left blank the name and chainage of the branch the cross-section intersects is used.&lt;br /&gt;
|-&lt;br /&gt;
|Distance (float)|| Optional distance along the line for sampling from grids.  If not specified the value specified in the .egc file is used.&lt;br /&gt;
|-&lt;br /&gt;
|Split (character 1)|| &amp;quot;T&amp;quot; (True) or &amp;quot;F&amp;quot; (False) for splitting the branch, set to false and the branch will not be split (used for centre sections) &lt;br /&gt;
|-&lt;br /&gt;
|Extract_XS (character 1)|| &amp;quot;T&amp;quot; (True) or &amp;quot;F&amp;quot; (False) for cross-section extraction.  If set to &amp;quot;F&amp;quot; no cross-section is extracted for the cut line.&lt;br /&gt;
|-&lt;br /&gt;
|Extract_Method (character 50)|| Specify the method for extract the elevations from the grid (does not apply to Material grids).  Options are:&amp;lt;br&amp;gt;&lt;br /&gt;
* Min&lt;br /&gt;
* Max&lt;br /&gt;
* Average (default)&lt;br /&gt;
|-&lt;br /&gt;
|Buffer_Method (character 50)|| Optional method for extracting the elevations from the grid (does not apply to Material grids) values from grid.  Options are:&amp;lt;br&amp;gt;&lt;br /&gt;
* Point {default} - Value at the cross-section point is used.&lt;br /&gt;
* Buffer  - circular buffer region around each cross-section point is created and elevation is extracted from this, using Min, Max or Average as described above.&lt;br /&gt;
* Perpendicular - A line perpendicular to section direction is used and elevation is extracted from this, using Min, Max or Average as described above.  This can be useful if the section follows a hydraulic control (such as embankment) to ensure that the high / or low point is extracted.&lt;br /&gt;
|-&lt;br /&gt;
|Buffer_Distance (float)|| Sets the distance for when using the &amp;quot;Buffer&amp;quot; or &amp;quot;Perpendicular&amp;quot; methods above.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===EGC commands===&lt;br /&gt;
The .egc file is read in a similar manner to the .tgc (TUFLOW geometry control) file.  This file is read in a sequential order and for repeated commands the final one prevails.&amp;lt;br&amp;gt;&lt;br /&gt;
A full list of the availble .egc commands is detailed in the table below.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Attribute (type)&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=70% | Description&lt;br /&gt;
|-&lt;br /&gt;
|Read GIS Branch == &amp;lt;1d_br GIS file&amp;gt;|| Reads the branch lines, these are described above.&lt;br /&gt;
|-&lt;br /&gt;
|Read GIS XS == &amp;lt;1d_cut GIS file&amp;gt;|| Reads the cross-section cut lines, these are described above.&lt;br /&gt;
|-&lt;br /&gt;
|Read GIS FLC == &amp;lt;GIS file&amp;gt;|| Optional GIS layer of polygons that can be used to specify form loss coefficients to the 1d_nwk layer.  A single GIS (float) attribute is required.  A FLC value of greater than 0 will be split between all 1d_nwk channels within the region.  A FLC value of less than 0, will apply the absolute value to all channels within the polygon.  For example if an FLC value of -0.1 is specified, all channels that fall within the polygon will have a form_loss attribute of 0.1.  If a channel falls within multiple polygons, the form loss values will be added. &lt;br /&gt;
 Reads the polygons off losses from GIS layer.  cross-section cut lines, these are described above.&lt;br /&gt;
|-&lt;br /&gt;
|Set XS dx == &amp;lt;distance&amp;gt;|| Sets the default distance across section to extract elevations and materials data.  This can be specified on the cut lines as detailed above.&lt;br /&gt;
|-&lt;br /&gt;
|Set XS Z == &amp;lt;elevation&amp;gt;|| Sets the elevation for all points in all cross-sections.&lt;br /&gt;
|-&lt;br /&gt;
|Set XS Mat == &amp;lt;Material ID&amp;gt;|| Sets the material ID for all points in all cross-sections.&lt;br /&gt;
|-&lt;br /&gt;
|Read Grid Z == &amp;lt;grid layer of elevations&amp;gt;|| Read elevations from DEM and assign this to all cross-section extraction points that fall within active DEM pixels.&lt;br /&gt;
|-&lt;br /&gt;
|Read Grid Mat == &amp;lt;grid layer of Material IDs&amp;gt;|| Read material IDs from raster grid and assign this to all cross-section extraction points that fall within active DEM pixels.  This should be an integer grid.&lt;br /&gt;
|-&lt;br /&gt;
| Write XS == ON or &#039;&#039;&#039;OFF&#039;&#039;&#039;|| Turns on or off the writing of the 1d_xs layer.  The default is off.&lt;br /&gt;
|-&lt;br /&gt;
| Write NWK == ON or &#039;&#039;&#039;OFF&#039;&#039;&#039;|| Turns on or off the writing of the 1d_nwk layer.  The default is off.&lt;br /&gt;
|-&lt;br /&gt;
|Output XS == &amp;lt;output gis layer&amp;gt; || Sets the output GIS layer for the 1D cross-sections.&lt;br /&gt;
|-&lt;br /&gt;
|Output NWK == &amp;lt;output gis layer&amp;gt; || Sets the output GIS layer for the 1D channel cross-sections.&lt;br /&gt;
|-&lt;br /&gt;
|Output NWK == &amp;lt;output gis layer&amp;gt; || Sets the output GIS layer for the 1D channel cross-sections.&lt;br /&gt;
|-&lt;br /&gt;
|FLC per Unit Length == &amp;lt;form loss per unit length&amp;gt; || The form loss per unit length is written to the &amp;quot;exit_loss&amp;quot; attribute of all 1d_nwk channels.&lt;br /&gt;
|}&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -egc MR_1d_001.egc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
An example .egc file is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Read GIS Branch == 1d_br_MR_001.MIF&lt;br /&gt;
Read GIS XS == 1d_cut_MR_001.MIF&lt;br /&gt;
Output Nwk == 1d_nwk_MR_001.MIF&lt;br /&gt;
Output XS == 1d_xs_MR_001.MIF&lt;br /&gt;
Write NWK == ON !Write 1d_nwk layer&lt;br /&gt;
Write XS == ON !Write 1d_xs layer&lt;br /&gt;
&lt;br /&gt;
Set XS dx == 5 !set default spacing, can be specified on xs or cut line&lt;br /&gt;
&lt;br /&gt;
Set XS Mat == 1 !default Material ID of 1&lt;br /&gt;
Read Grid Mat == grid\grid_5m_2d_mat_MR_001.flt&lt;br /&gt;
&lt;br /&gt;
Set XS Z == 99&lt;br /&gt;
Read Grid Z == grid\dem_5m_regional.flt&lt;br /&gt;
Read Grid Z == grid\dem_1m_bathymetry.flt&lt;br /&gt;
Read Grid Z == grid\dem_1m_survey.flt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Extract 1D Nodal Area Tables from Grid==&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;-na &amp;lt;gis_region_file&amp;gt; &amp;lt;input grid&amp;gt;&amp;quot;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Can be used to extract nodal-area (elevation-area) tables from a DEM, and output these in a .csv file format suitable for input into the 1D domain of a TUFLOW model.&amp;lt;br&amp;gt;&lt;br /&gt;
The input GIS region file should have the same attributes as the 1d_tab file format produced by TUFLOW.  The first attribute (&amp;quot;Source&amp;quot; ) should contain a valid .csv file name.&amp;lt;br&amp;gt;&lt;br /&gt;
The out nodal area table extends from  the minimum to the maximum elevation in the DEM.  A user defined minimum value can be specified using the &amp;quot;Skew&amp;quot; attribute of the GIS region.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -na 1d_na_storgae_R.shp DEM_1m.flt&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Statistics==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;&amp;quot;-stat&amp;lt;type&amp;gt;&amp;quot;&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of the 2017-10-AA build, the ASC_to_ASC.exe utility allows the user to perform a number of statistical analyses on a group of input grids (*.flt or *.asc format). This is particularly useful when extracting information from assessments that produce multiple result files for a single event, for example, processing grids from an ensemble assessment with numerous temporal pattern arrangements.&lt;br /&gt;
&lt;br /&gt;
The available options are:&lt;br /&gt;
* Median&lt;br /&gt;
* Mean&lt;br /&gt;
* Frac&lt;br /&gt;
* Min&lt;br /&gt;
* Max&lt;br /&gt;
* All&lt;br /&gt;
* Rank&amp;lt;integer id&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The below gives a description on each option as well as an example. It is also useful to consider using wildcards in the batch file to supplement typing out each input grid file individually. Several of the examples below utilise this ability to demonstrate how it can be done.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
===&amp;quot;-statMedian&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statMedian flag outputs the median value at each grid cell from all the input grids. All the input grids are considered, regardless of if the grid cell is dry in some of the input grids (dry areas are still ranked).&lt;br /&gt;
&lt;br /&gt;
If the number of input grids is an even number, the median value is taken from the grid that is ranked &#039;&#039;n / 2 + 1&#039;&#039; (where n is the number of input grids). For example if the number of input grids is 10, at each grid cell the values are ranked lowest to highest (from 1 to 10). The result is taken from the 6th ranked grid. The median command outputs two grids:&lt;br /&gt;
* A value grid: the resulting median value&lt;br /&gt;
* An SRC grid: a grid listing which source input grid the median result value came from (a corresponding .csv file is also written as a legend)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statMedian Q100_30min_TP1_h.asc Q100_30min_TP2_h.asc Q100_30min_TP3_h.asc Q100_30min_TP4_h.asc Q100_30min_TP5_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: asc_to_asc_statsMedian_eg.PNG|1000px|]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;-statMean&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statMean flag outputs the mean value at each grid cell. Unlike the median, the mean is only calculated at grid cells that are wet (that show flooding) in all input grids. Please note that the source grid is the next grid above the mean value. The mean command outputs two grids:&lt;br /&gt;
* A value grid: the resulting value&lt;br /&gt;
* An SRC grid: a grid listing which source input grid the result value came from or was the next above (a corresponding .csv file is also written as a legend)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statMean Q100_30min_*_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;-statFrac&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statFrac flag outputs a value at each grid cell that represents the fraction of the events that the grid cell is wet in. For example, if the number of input grids is 10, and a value of 0.2 is returned, this means this grid cell experienced flooding in 2 out of the 10 events. A value of 1.0 means that the grid cell was wet in all events.&lt;br /&gt;
&lt;br /&gt;
The utility outputs one grid:&lt;br /&gt;
* A Frac grid: the resulting Fraction value&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statFrac Q100_30min_*_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;-statMin&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statMin flag outputs the minimum value at each grid cell from all the input grids.&lt;br /&gt;
&lt;br /&gt;
The utility outputs two grids:&lt;br /&gt;
* A value grid: the resulting value&lt;br /&gt;
* An SRC grid: a grid listing which source input grid the minimum result value came from (a corresponding .csv file is also written as a legend)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statMin Q100_30min_*_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;-statMax&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statMax flag outputs the maximum value at each grid cell from all the input grids. This flag is analogous with the [[#Maximum|-Max]] operation flag.&lt;br /&gt;
&lt;br /&gt;
The utility outputs two grids:&lt;br /&gt;
* A value grid: the resulting value&lt;br /&gt;
* An SRC grid: a grid listing which source input grid the maximum result value came from (a corresponding .csv file is also written as a legend)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statMax Q100_30min_*_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;-statAll&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statAll flag undertakes and creates results for all the statistic operations mentioned above.&lt;br /&gt;
&lt;br /&gt;
The utility outputs 9 grids:&lt;br /&gt;
* A median, mean, max, min and frac grid (as detailed above)&lt;br /&gt;
* An SRC grid: for the median, mean, min and max calculations (calculation of source grids as detailed above)&lt;br /&gt;
* A .csv file that contains the legend for all SRC grids&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statAll Q100_30min_*_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;-statRank&amp;lt;integer id&amp;gt;&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
The -statRank&amp;lt;integer&amp;gt; flag outputs the &#039;&#039;n&amp;lt;integer&amp;gt;&#039;&#039; ranked value at each grid cell from all the input grids. All the input grids are considered, regardless of if the grid cell is dry in some of the input grids (dry areas are still ranked). For example, if the number of input grids is 10, at each grid cell the values are ranked lowest to highest (from 1 to 10). -statRank8 will output results taken from the 8th ranked grid. In this example, -statRank1 is equivalent to &#039;&#039;Min&#039;&#039;, -statRank10 is equivalent to &#039;&#039;Max&#039;&#039;, and -statRank6 is equivalent to &#039;&#039;Median&#039;&#039;. The Rank flag allows additional functionality that lets users extract results in between those that are pre-programmed.&lt;br /&gt;
&lt;br /&gt;
The utility outputs two grids:&lt;br /&gt;
* A value grid: the resulting value&lt;br /&gt;
* An SRC grid: a grid listing which source input grid the ranked result value came from (a corresponding .csv file is also written as a legend)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;asc_to_asc.exe -statRank5 Q100_30min_*_h.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Other Options (switches)=&lt;br /&gt;
A list of the general switches is provided in the table below, these are available for all operations listed above:&amp;lt;br&amp;gt;&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot;| Switch&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=80% | Description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-b&amp;quot;|| Run the utility in batch mode, this suppresses the prompt to press enter at the end of processing.  Used in .bat files where two or more files are to be processed. The -b flag should be placed after the asc_to_asc.exe call, before the function command. For example:&amp;lt;br&amp;gt; &amp;lt;tt&amp;gt;asc_to_asc.exe   -b   -brkline   2d_zsh_breaklines_L.shp   DEM.asc&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-out &amp;lt;output grid name&amp;gt;&amp;quot;||Specify the output filename for the new grid. &amp;lt;br&amp;gt; &#039;&#039;&#039;Note:&#039;&#039;&#039; a space is required between the -out and the filename.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-flt&amp;quot;||Set the output grid format to binary float (.flt).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-asc&amp;quot;||Set the output grid format to ESRI ascii format (.asc).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;quot;-grc&amp;quot;||For use with the &amp;quot;-classify&amp;quot; option and .asc format output.  This creates a classified grid (uses name rather than number).  This is only valid if using Vertical Mapper, neither QGIS or ArcMap will recognise this format.  This can also be used with the -RGB option to specify the output colouring of your grid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
{{Tips Navigation&lt;br /&gt;
|uplink=[[TUFLOW_Utilities | Back to TUFLOW Utilities]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15931</id>
		<title>Python Library TUFLOW Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15931"/>
		<updated>2018-05-10T05:48:13Z</updated>

		<summary type="html">&lt;p&gt;Par: /* Getting the TUFLOW results python library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TUPython.png | 435px]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
For the 2016 version of TUFLOW a new output format for time-series was made available, this has the following changes from previous versions:&lt;br /&gt;
* Combines the 1D results, 2D plot outputs and new reporting location data&lt;br /&gt;
* The outputs are stored in a separate &#039;&#039;&#039;Plot&#039;&#039;&#039; folder in the TUFLOW results directory&lt;br /&gt;
* .tpc (&amp;lt;u&amp;gt;T&amp;lt;/u&amp;gt;UFLOW &amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;lot &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;ontrol file links to data in csv and gis folders&lt;br /&gt;
* Has additional Node and Channel information files contain connectivity information&lt;br /&gt;
This is the default approach for the 2016 version but can be modified with the TUFLOW command &amp;quot;&amp;lt;tt&amp;gt;Output Approach == Pre 2016&amp;lt;/tt&amp;gt;&amp;quot; (refer to the manual for more information on this command.&amp;lt;br&amp;gt;&lt;br /&gt;
To make this data easier to work with an open source python library has been created and made available.  This allows the user to load results and then interact with these.  This library does not have any plotting functionality directly, with the returns typically being arrays (e.g. time and flows) however, the examples below give some examples using common plotting libraries such as matplotlib.&amp;lt;br&amp;gt;&lt;br /&gt;
=Getting the TUFLOW results python library=&lt;br /&gt;
You can find the TUFLOW_results.py (previously TUFLOW_Results2016.py) on the QGIS plugin repository, on the TUFLOW support GitHub repository or if you have QGIS and the TUFLOW plugin installed, you will already have it on your computer. &lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;QGIS plugin repo: [https://plugins.qgis.org/plugins/tuflow/ https://plugins.qgis.org/plugins/tuflow/]&amp;lt;br&amp;gt;&lt;br /&gt;
: If you select &#039;&#039;&#039;Download Latest&#039;&#039;&#039; and save the .zip file, the TUFLOW_results.py sits inside the .zip file.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GitHub: [https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin QGIS plugin https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin]&amp;lt;br&amp;gt;&lt;br /&gt;
: If you select &#039;&#039;&#039;Clone or Download&#039;&#039;&#039; and then select &#039;&#039;&#039;Download Zip&#039;&#039;&#039; and save the .zip file, the TUFLOW_results.py sits inside the .zip file.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;QGIS&amp;lt;br&amp;gt;&lt;br /&gt;
: If you have QGIS2 with the TUFLOW plugin installed via the plugin repository, the TUFLOW_results.py sits within: C:\Users\&amp;lt;User Name&amp;gt;\.qgis2\python\plugins\tuflow&amp;lt;br&amp;gt;&lt;br /&gt;
: If you have QGIS3 with the TUFLOW plugin installed via the plugin repository, the TUFLOW_results.py sits within: C:\Users\&amp;lt;User Name&amp;gt;\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow&amp;lt;br&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
The TUFLOW python library does not need to be installed in python (through pip or otherwise) like other common modules, the TUFLOW_results.py file just needs to be in the same location as your python project.&lt;br /&gt;
&lt;br /&gt;
Note it shouldn’t matter if you’re using python 2 or python 3.&lt;br /&gt;
&lt;br /&gt;
=Dependencies=&lt;br /&gt;
The TUFLOW results library calls a number of python modules, these are:&lt;br /&gt;
* csv&lt;br /&gt;
* numpy&lt;br /&gt;
* os&lt;br /&gt;
* sys&lt;br /&gt;
Of these the csv, os and sys functionality should be available directly with the python install.  Depending on the method used to install python, numpy may need to be installed.  If installation of numpy is required, please refer to the numpy documentation [http://www.numpy.org/ http://www.numpy.org/].&lt;br /&gt;
=Compatible Python Versions=&lt;br /&gt;
The functionality has been developed for Python 2.7, but should be compatible with Python 3.5.  Other versions of python are currently untested.&lt;br /&gt;
=Usage=&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
This library is imported with the typical python syntax.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;import TUFLOW_results&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Initialise Results (ResData)==&lt;br /&gt;
The results data functionality has a class defined, this is named &#039;&#039;&#039;ResData&#039;&#039;&#039;. An instance of the results can be initialised with the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;res = TUFLOW_results.ResData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Defined Methods (Functions)==&lt;br /&gt;
The following are the defined &#039;&#039;&#039;functions&#039;&#039;&#039; in the results data class (ResData).&lt;br /&gt;
===Load Results===&lt;br /&gt;
Results are loaded in with the syntax below.&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.Load(r&#039;D:\TUFLOW\QGIS\test\plot\Plot_Example.tpc&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two return arguments are:&lt;br /&gt;
* error (logical) set to True if an error has been encountered.&lt;br /&gt;
* message (string), if an error has occurred the message string will be populated with an error message.&lt;br /&gt;
===Get Time-series===&lt;br /&gt;
Time-series at a 1D, 2D or reporting location can be returned using the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTSData(&amp;lt;ID&amp;gt;,&amp;lt;domain&amp;gt;,&amp;lt;results type&amp;gt;,&amp;lt;geometry&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;ID - The ID of the 1D, 2D or reporting location feature.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Domain - The domain to return the results for, this will be one of &#039;&#039;&#039;1D&#039;&#039;&#039;, &#039;&#039;&#039;2D&#039;&#039;&#039; or &#039;&#039;&#039;RL&#039;&#039;&#039; (for reporting location data)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Results Type - The results type to be returned.  This includes H (level), Q (flow), V (velocity), E (energy), QA (flow area) depending on the data types that have been output!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Geometry - The GIS geometry of the object, &#039;&#039;&#039;L&#039;&#039;&#039; for line, or &#039;&#039;&#039;P&#039;&#039;&#039; for point.  If unsure or unknown this can be set to a blank string such as &#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;found (logical) - Returns True if the data has been found, False if the data can not be found or an error has occurred.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;results (numpy array) - The return array for the requested data.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If the data is not found, this message string contains information.&amp;lt;/li&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTS(&#039;ds3&#039;,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Will return flow (Q) data for the 1D channel with ID ds3.  The optional &#039;L&#039; geometry indicates that this is stored on a line object in the GIS plot objects.&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; As the time data typically does not change (this is not a return argument) but can be accessed by the &amp;lt;tt&amp;gt;res.times&amp;lt;/tt&amp;gt;.  See the examples below.&lt;br /&gt;
===Long Profile Functions===&lt;br /&gt;
When dealing with 1D long profile data, if a single 1D channel is specified the data for all channels downstream will returned.  If two channels are specified, long profile data will only be returned for the channels between the specified channels.&lt;br /&gt;
&lt;br /&gt;
====Get Long Profile Connectivity (LP_getConnectivity)====&lt;br /&gt;
This determines and stores the connectivity of the specified channels.  This is used in later routines to determine the channels and nodes to plot for the long profile. The syntax is: &lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getConnectivity(&amp;lt;US Channel ID&amp;gt;,&amp;lt;US Channel ID or None&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Upstream Channel ID - The ID of the Upstream 1D channel.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Downstream Channel ID - The ID of the Downstream 1D channel, if no downstream channel is to be used this can be set to &#039;&#039;&#039;None&#039;&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,None)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines all the channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,&#039;ds3&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines the channels between &#039;&#039;&#039;FC01.40&#039;&#039;&#039; and &#039;&#039;&#039;ds3&#039;&#039;&#039;, an error will be returned if these channels are not connected.&lt;br /&gt;
====Get Long Profile Static Data (LP_getStaticData)====&lt;br /&gt;
Once the connectivity between two channels has been determined, this routine can be used to get data that does not change between time-steps.  This includes:&lt;br /&gt;
* distance information&lt;br /&gt;
* maximum data&lt;br /&gt;
* bed levels&lt;br /&gt;
The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getStaticData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are no input arguments as the channel connectivity is stored in the res.LP class. The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
====Get Long Profile Data (LP_getData)====&lt;br /&gt;
This function gets data at a specific time.  If looping through timesteps (e.g. for an animation) the channel connectivity and static data will not change between timesteps and therefore only the &#039;&#039;&#039;LP_getData&#039;&#039;&#039; will need to be repeated.  The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&amp;lt;data type&amp;gt;,&amp;lt;time&amp;gt;,&amp;lt;time search tolerance&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Data type - The results data to return, this is one of &#039;Head&#039; or &#039;Energy&#039;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time - The time in hours to get the data for.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time search tolerance - If the closest output time is greater than the time search tolerance from the specified time an error will be returned.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&#039;Head&#039;,1,0.01)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Returns the water level (head) data at time 1 hours using a search tolerance of 0.01 hours.&lt;br /&gt;
==Other Attributes==&lt;br /&gt;
Once initialised the ResData class also has a number of &#039;&#039;&#039;attributes&#039;&#039;&#039; associated with it as well as the &#039;&#039;&#039;defined functions&#039;&#039;&#039; described above, these are outlined in the table below.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Attribute Name&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Type&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=70% | Description&lt;br /&gt;
|-&lt;br /&gt;
|script_version|| string || Contains a version number of the TUFLOW results library, e.g. &#039;2016-01-AA&#039;&lt;br /&gt;
|-&lt;br /&gt;
|filename|| string|| The full filepath to the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|fpath|| string|| The path of the folder which contains the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|nTypes|| integer|| The number of data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|Types || list || A lists of the data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|LP || class (LP) || Contains Long profile information, connectivity, distances etc.&lt;br /&gt;
|-&lt;br /&gt;
|Data_1D|| class(Data_1D) || The 1D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_2D|| class(Data_2D) || The 2D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_RL|| class(Data_RL) || The reporting location results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|GIS|| class(GIS)|| This contains the information read in from the &amp;lt;tt&amp;gt;GIS Plot Layer&amp;lt;/tt&amp;gt; csv files.&lt;br /&gt;
|-&lt;br /&gt;
|formatVersion|| integer || The format version of the results as defined in the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|units || string || The units as defined in the .tpc. E.g. &amp;quot;Metric&amp;quot; or &amp;quot;English&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|displayname || string || The simulation name e.g. &amp;quot;M04_5m_001_2015&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Index || class(PlotObjects)|| This contains data read from the &amp;quot;GIS Plot Objects&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|nodes|| class(NodeInfo) || Contains information on the 1D nodes, as read from the &amp;quot;1D Node Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|Channels|| class(ChanInfo)|| Contains information on the 1D nodes, as read from the &amp;quot;1D Channel Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|times || numpy ndarray|| The active times.  This is typically static, however calls to function &#039;&#039;&#039;getTS&#039;&#039;&#039; may cause this array to be updated (if the 1D or 2D outputs have a different output interval)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
These examples work with the Tutorial Model module 4 results.  The tutorial model can be downloaded on the [https://www.tuflow.com/Tuflow%20Tutorial%20Models.aspx TUFLOW website].&lt;br /&gt;
==Plot Flow in Channel==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os						#operating system functions&lt;br /&gt;
import sys						#system functions&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import TUFLOW_results&lt;br /&gt;
&lt;br /&gt;
input_res = r&#039;C:\TUFLOW\Models\Tutorials\QGIS\Complete_Model\TUFLOW\results\M04\2d\plot\M04_5m_001.tpc&#039;&lt;br /&gt;
&lt;br /&gt;
# initialise the results class&lt;br /&gt;
res = TUFLOW_results.ResData()&lt;br /&gt;
&lt;br /&gt;
# Load the data and terminate if error returned&lt;br /&gt;
error, message = res.Load(input_res)&lt;br /&gt;
if error:&lt;br /&gt;
    print(message)&lt;br /&gt;
    sys.exit()&lt;br /&gt;
print(&#039;loaded&#039;)&lt;br /&gt;
&lt;br /&gt;
#create a figure&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
chan_id = &#039;ds3&#039; # this is the channel ID to use&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	# plot data&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - single location&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend()&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 Q Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plot Multiple Water Levels==&lt;br /&gt;
In this example, it is assumed that the results data has been loaded as per the above.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
# list of nodes to plot&lt;br /&gt;
node_ids = [&#039;FC01.14.1&#039;,&#039;FC01.15.1&#039;,&#039;FC01.16.1&#039;,&#039;FC01.17.1&#039;]&lt;br /&gt;
&lt;br /&gt;
#Get water level data&lt;br /&gt;
for node_id in node_ids: #for each node in the list above&lt;br /&gt;
	found, results, message = res.getTSData(node_id,&#039;1D&#039;,&#039;H&#039;,&#039;P&#039;)&lt;br /&gt;
	if found:&lt;br /&gt;
		print(&#039;found requested data&#039;)&lt;br /&gt;
		# plot data&lt;br /&gt;
		ax1.plot(res.times,results,label=&#039;Level - &#039;+node_id)&lt;br /&gt;
	else:&lt;br /&gt;
		print(message)&lt;br /&gt;
		sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Water Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - multiple locations&#039;)&lt;br /&gt;
ax1.set_ybound((38.,44.)) #overwrite the y axis bounds&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;lower right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 H Example 01.png|600px]]&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Dual Axis (flow and velocity) Plot==&lt;br /&gt;
In this example it is assumed the results have been loaded as per example 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# specify channel to plot&lt;br /&gt;
chan_id = &#039;ds3&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.80,0.75)) #add axis to figure&lt;br /&gt;
ax2 = ax1.twinx() #create new axis with same x properties&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
#Get velocity data&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;V&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	ax2.plot(res.times,results,color=&#039;r&#039;,label=&#039;Velocity - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax2.set_ylabel(&#039;Velocity (m/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - twin axis&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
h1, l1 = ax1.get_legend_handles_labels()&lt;br /&gt;
h2, l2 = ax2.get_legend_handles_labels()&lt;br /&gt;
ax1.legend(h1+h2, l1+l2, loc=&#039;upper left&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 QV Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
==Long Profile Peak Levels==&lt;br /&gt;
This also assumes that the data has been loaded as per example 1 above.  The long profile data for all channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039; will be plotted.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
us_chan = &#039;FC01.40&#039; #upstream channel&lt;br /&gt;
ds_chan = None&lt;br /&gt;
&lt;br /&gt;
#get connectivity between channels&lt;br /&gt;
error, message = res.LP_getConnectivity(us_chan,ds_chan)&lt;br /&gt;
if error:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print(&#039;LP connectivity determined.&#039;)&lt;br /&gt;
&lt;br /&gt;
print(&#039;Get LP static data&#039;)&lt;br /&gt;
error, message = res.LP_getStaticData()&lt;br /&gt;
if error:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print(&#039;LP static data retrieved&#039;)&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.80)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#plot data&lt;br /&gt;
# Max WL&lt;br /&gt;
ax1.plot(res.LP.dist_nodes, res.LP.Hmax,color=&#039;r&#039;,label = &#039;Max Water Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# Bed Level&lt;br /&gt;
ax1.plot(res.LP.dist_chan_inverts, res.LP.chan_inv,color=&#039;brown&#039;,linewidth = &#039;3&#039;,label = &#039;Bed Level Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Distance (m)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example Long Profile - Peak Levels&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;upper right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 LP Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Other Versions=&lt;br /&gt;
An older version of the library that is compatible with results from the 2013 version of TUFLOW (this is limited to the 1D results) is also available.  This is currently undocumented, however, if you would like this please contact support@tuflow.com.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15930</id>
		<title>Python Library TUFLOW Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15930"/>
		<updated>2018-05-10T05:28:12Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TUPython.png | 435px]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
For the 2016 version of TUFLOW a new output format for time-series was made available, this has the following changes from previous versions:&lt;br /&gt;
* Combines the 1D results, 2D plot outputs and new reporting location data&lt;br /&gt;
* The outputs are stored in a separate &#039;&#039;&#039;Plot&#039;&#039;&#039; folder in the TUFLOW results directory&lt;br /&gt;
* .tpc (&amp;lt;u&amp;gt;T&amp;lt;/u&amp;gt;UFLOW &amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;lot &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;ontrol file links to data in csv and gis folders&lt;br /&gt;
* Has additional Node and Channel information files contain connectivity information&lt;br /&gt;
This is the default approach for the 2016 version but can be modified with the TUFLOW command &amp;quot;&amp;lt;tt&amp;gt;Output Approach == Pre 2016&amp;lt;/tt&amp;gt;&amp;quot; (refer to the manual for more information on this command.&amp;lt;br&amp;gt;&lt;br /&gt;
To make this data easier to work with an open source python library has been created and made available.  This allows the user to load results and then interact with these.  This library does not have any plotting functionality directly, with the returns typically being arrays (e.g. time and flows) however, the examples below give some examples using common plotting libraries such as matplotlib.&amp;lt;br&amp;gt;&lt;br /&gt;
=Getting the TUFLOW results python library=&lt;br /&gt;
You can find the TUFLOW_results.py (previously TUFLOW_Results2016.py) on the QGIS plugin repository, on the TUFLOW support GitHub repository or if you have QGIS and the TUFLOW plugin installed, you will already have it on your computer. &lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;QGIS plugin repo: [https://plugins.qgis.org/plugins/tuflow/ https://plugins.qgis.org/plugins/tuflow/]&amp;lt;br&amp;gt;&lt;br /&gt;
: If you select &#039;&#039;&#039;Download Latest&#039;&#039;&#039; and save the .zip file, the TUFLOW_results.py sits inside the .zip file.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GitHub: [https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin QGIS plugin https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin]&amp;lt;br&amp;gt;&lt;br /&gt;
: If you select &#039;&#039;&#039;Clone or Download&#039;&#039;&#039; and then select &#039;&#039;&#039;Download Zip&#039;&#039;&#039; and save the .zip file, the TUFLOW_results.py sits inside the .zip file.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;QGIS&amp;lt;br&amp;gt;&lt;br /&gt;
If you have QGIS2 with the TUFLOW plugin installed via the plugin repository, the TUFLOW_results.py sits within: C:\Users\&amp;lt;User Name&amp;gt;\.qgis2\python\plugins\tuflow&amp;lt;br&amp;gt;&lt;br /&gt;
If you have QGIS3 with the TUFLOW plugin installed via the plugin repository, the TUFLOW_results.py sits within: C:\Users\&amp;lt;User Name&amp;gt;\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow&amp;lt;br&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
The TUFLOW python library does not need to be installed in python (through pip or otherwise) like other common modules, the TUFLOW_results.py file just needs to be in the same location as your python project.&lt;br /&gt;
&lt;br /&gt;
Note it shouldn’t matter if you’re using python 2 or python 3.&lt;br /&gt;
=Dependencies=&lt;br /&gt;
The TUFLOW results library calls a number of python modules, these are:&lt;br /&gt;
* csv&lt;br /&gt;
* numpy&lt;br /&gt;
* os&lt;br /&gt;
* sys&lt;br /&gt;
Of these the csv, os and sys functionality should be available directly with the python install.  Depending on the method used to install python, numpy may need to be installed.  If installation of numpy is required, please refer to the numpy documentation [http://www.numpy.org/ http://www.numpy.org/].&lt;br /&gt;
=Compatible Python Versions=&lt;br /&gt;
The functionality has been developed for Python 2.7, but should be compatible with Python 3.5.  Other versions of python are currently untested.&lt;br /&gt;
=Usage=&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
This library is imported with the typical python syntax.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;import TUFLOW_results&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Initialise Results (ResData)==&lt;br /&gt;
The results data functionality has a class defined, this is named &#039;&#039;&#039;ResData&#039;&#039;&#039;. An instance of the results can be initialised with the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;res = TUFLOW_results.ResData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Defined Methods (Functions)==&lt;br /&gt;
The following are the defined &#039;&#039;&#039;functions&#039;&#039;&#039; in the results data class (ResData).&lt;br /&gt;
===Load Results===&lt;br /&gt;
Results are loaded in with the syntax below.&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.Load(r&#039;D:\TUFLOW\QGIS\test\plot\Plot_Example.tpc&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two return arguments are:&lt;br /&gt;
* error (logical) set to True if an error has been encountered.&lt;br /&gt;
* message (string), if an error has occurred the message string will be populated with an error message.&lt;br /&gt;
===Get Time-series===&lt;br /&gt;
Time-series at a 1D, 2D or reporting location can be returned using the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTSData(&amp;lt;ID&amp;gt;,&amp;lt;domain&amp;gt;,&amp;lt;results type&amp;gt;,&amp;lt;geometry&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;ID - The ID of the 1D, 2D or reporting location feature.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Domain - The domain to return the results for, this will be one of &#039;&#039;&#039;1D&#039;&#039;&#039;, &#039;&#039;&#039;2D&#039;&#039;&#039; or &#039;&#039;&#039;RL&#039;&#039;&#039; (for reporting location data)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Results Type - The results type to be returned.  This includes H (level), Q (flow), V (velocity), E (energy), QA (flow area) depending on the data types that have been output!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Geometry - The GIS geometry of the object, &#039;&#039;&#039;L&#039;&#039;&#039; for line, or &#039;&#039;&#039;P&#039;&#039;&#039; for point.  If unsure or unknown this can be set to a blank string such as &#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;found (logical) - Returns True if the data has been found, False if the data can not be found or an error has occurred.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;results (numpy array) - The return array for the requested data.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If the data is not found, this message string contains information.&amp;lt;/li&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTS(&#039;ds3&#039;,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Will return flow (Q) data for the 1D channel with ID ds3.  The optional &#039;L&#039; geometry indicates that this is stored on a line object in the GIS plot objects.&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; As the time data typically does not change (this is not a return argument) but can be accessed by the &amp;lt;tt&amp;gt;res.times&amp;lt;/tt&amp;gt;.  See the examples below.&lt;br /&gt;
===Long Profile Functions===&lt;br /&gt;
When dealing with 1D long profile data, if a single 1D channel is specified the data for all channels downstream will returned.  If two channels are specified, long profile data will only be returned for the channels between the specified channels.&lt;br /&gt;
&lt;br /&gt;
====Get Long Profile Connectivity (LP_getConnectivity)====&lt;br /&gt;
This determines and stores the connectivity of the specified channels.  This is used in later routines to determine the channels and nodes to plot for the long profile. The syntax is: &lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getConnectivity(&amp;lt;US Channel ID&amp;gt;,&amp;lt;US Channel ID or None&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Upstream Channel ID - The ID of the Upstream 1D channel.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Downstream Channel ID - The ID of the Downstream 1D channel, if no downstream channel is to be used this can be set to &#039;&#039;&#039;None&#039;&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,None)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines all the channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,&#039;ds3&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines the channels between &#039;&#039;&#039;FC01.40&#039;&#039;&#039; and &#039;&#039;&#039;ds3&#039;&#039;&#039;, an error will be returned if these channels are not connected.&lt;br /&gt;
====Get Long Profile Static Data (LP_getStaticData)====&lt;br /&gt;
Once the connectivity between two channels has been determined, this routine can be used to get data that does not change between time-steps.  This includes:&lt;br /&gt;
* distance information&lt;br /&gt;
* maximum data&lt;br /&gt;
* bed levels&lt;br /&gt;
The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getStaticData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are no input arguments as the channel connectivity is stored in the res.LP class. The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
====Get Long Profile Data (LP_getData)====&lt;br /&gt;
This function gets data at a specific time.  If looping through timesteps (e.g. for an animation) the channel connectivity and static data will not change between timesteps and therefore only the &#039;&#039;&#039;LP_getData&#039;&#039;&#039; will need to be repeated.  The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&amp;lt;data type&amp;gt;,&amp;lt;time&amp;gt;,&amp;lt;time search tolerance&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Data type - The results data to return, this is one of &#039;Head&#039; or &#039;Energy&#039;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time - The time in hours to get the data for.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time search tolerance - If the closest output time is greater than the time search tolerance from the specified time an error will be returned.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&#039;Head&#039;,1,0.01)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Returns the water level (head) data at time 1 hours using a search tolerance of 0.01 hours.&lt;br /&gt;
==Other Attributes==&lt;br /&gt;
Once initialised the ResData class also has a number of &#039;&#039;&#039;attributes&#039;&#039;&#039; associated with it as well as the &#039;&#039;&#039;defined functions&#039;&#039;&#039; described above, these are outlined in the table below.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Attribute Name&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Type&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=70% | Description&lt;br /&gt;
|-&lt;br /&gt;
|script_version|| string || Contains a version number of the TUFLOW results library, e.g. &#039;2016-01-AA&#039;&lt;br /&gt;
|-&lt;br /&gt;
|filename|| string|| The full filepath to the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|fpath|| string|| The path of the folder which contains the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|nTypes|| integer|| The number of data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|Types || list || A lists of the data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|LP || class (LP) || Contains Long profile information, connectivity, distances etc.&lt;br /&gt;
|-&lt;br /&gt;
|Data_1D|| class(Data_1D) || The 1D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_2D|| class(Data_2D) || The 2D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_RL|| class(Data_RL) || The reporting location results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|GIS|| class(GIS)|| This contains the information read in from the &amp;lt;tt&amp;gt;GIS Plot Layer&amp;lt;/tt&amp;gt; csv files.&lt;br /&gt;
|-&lt;br /&gt;
|formatVersion|| integer || The format version of the results as defined in the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|units || string || The units as defined in the .tpc. E.g. &amp;quot;Metric&amp;quot; or &amp;quot;English&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|displayname || string || The simulation name e.g. &amp;quot;M04_5m_001_2015&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Index || class(PlotObjects)|| This contains data read from the &amp;quot;GIS Plot Objects&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|nodes|| class(NodeInfo) || Contains information on the 1D nodes, as read from the &amp;quot;1D Node Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|Channels|| class(ChanInfo)|| Contains information on the 1D nodes, as read from the &amp;quot;1D Channel Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|times || numpy ndarray|| The active times.  This is typically static, however calls to function &#039;&#039;&#039;getTS&#039;&#039;&#039; may cause this array to be updated (if the 1D or 2D outputs have a different output interval)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
These examples work with the Tutorial Model module 4 results.  The tutorial model can be downloaded on the [https://www.tuflow.com/Tuflow%20Tutorial%20Models.aspx TUFLOW website].&lt;br /&gt;
==Plot Flow in Channel==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os						#operating system functions&lt;br /&gt;
import sys						#system functions&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import TUFLOW_results&lt;br /&gt;
&lt;br /&gt;
input_res = r&#039;C:\TUFLOW\Models\Tutorials\QGIS\Complete_Model\TUFLOW\results\M04\2d\plot\M04_5m_001.tpc&#039;&lt;br /&gt;
&lt;br /&gt;
# initialise the results class&lt;br /&gt;
res = TUFLOW_results.ResData()&lt;br /&gt;
&lt;br /&gt;
# Load the data and terminate if error returned&lt;br /&gt;
error, message = res.Load(input_res)&lt;br /&gt;
if error:&lt;br /&gt;
    print(message)&lt;br /&gt;
    sys.exit()&lt;br /&gt;
print(&#039;loaded&#039;)&lt;br /&gt;
&lt;br /&gt;
#create a figure&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
chan_id = &#039;ds3&#039; # this is the channel ID to use&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	# plot data&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - single location&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend()&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 Q Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plot Multiple Water Levels==&lt;br /&gt;
In this example, it is assumed that the results data has been loaded as per the above.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
# list of nodes to plot&lt;br /&gt;
node_ids = [&#039;FC01.14.1&#039;,&#039;FC01.15.1&#039;,&#039;FC01.16.1&#039;,&#039;FC01.17.1&#039;]&lt;br /&gt;
&lt;br /&gt;
#Get water level data&lt;br /&gt;
for node_id in node_ids: #for each node in the list above&lt;br /&gt;
	found, results, message = res.getTSData(node_id,&#039;1D&#039;,&#039;H&#039;,&#039;P&#039;)&lt;br /&gt;
	if found:&lt;br /&gt;
		print(&#039;found requested data&#039;)&lt;br /&gt;
		# plot data&lt;br /&gt;
		ax1.plot(res.times,results,label=&#039;Level - &#039;+node_id)&lt;br /&gt;
	else:&lt;br /&gt;
		print(message)&lt;br /&gt;
		sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Water Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - multiple locations&#039;)&lt;br /&gt;
ax1.set_ybound((38.,44.)) #overwrite the y axis bounds&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;lower right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 H Example 01.png|600px]]&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Dual Axis (flow and velocity) Plot==&lt;br /&gt;
In this example it is assumed the results have been loaded as per example 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# specify channel to plot&lt;br /&gt;
chan_id = &#039;ds3&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.80,0.75)) #add axis to figure&lt;br /&gt;
ax2 = ax1.twinx() #create new axis with same x properties&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
#Get velocity data&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;V&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	ax2.plot(res.times,results,color=&#039;r&#039;,label=&#039;Velocity - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax2.set_ylabel(&#039;Velocity (m/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - twin axis&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
h1, l1 = ax1.get_legend_handles_labels()&lt;br /&gt;
h2, l2 = ax2.get_legend_handles_labels()&lt;br /&gt;
ax1.legend(h1+h2, l1+l2, loc=&#039;upper left&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 QV Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
==Long Profile Peak Levels==&lt;br /&gt;
This also assumes that the data has been loaded as per example 1 above.  The long profile data for all channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039; will be plotted.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
us_chan = &#039;FC01.40&#039; #upstream channel&lt;br /&gt;
ds_chan = None&lt;br /&gt;
&lt;br /&gt;
#get connectivity between channels&lt;br /&gt;
error, message = res.LP_getConnectivity(us_chan,ds_chan)&lt;br /&gt;
if error:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print(&#039;LP connectivity determined.&#039;)&lt;br /&gt;
&lt;br /&gt;
print(&#039;Get LP static data&#039;)&lt;br /&gt;
error, message = res.LP_getStaticData()&lt;br /&gt;
if error:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print(&#039;LP static data retrieved&#039;)&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.80)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#plot data&lt;br /&gt;
# Max WL&lt;br /&gt;
ax1.plot(res.LP.dist_nodes, res.LP.Hmax,color=&#039;r&#039;,label = &#039;Max Water Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# Bed Level&lt;br /&gt;
ax1.plot(res.LP.dist_chan_inverts, res.LP.chan_inv,color=&#039;brown&#039;,linewidth = &#039;3&#039;,label = &#039;Bed Level Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Distance (m)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example Long Profile - Peak Levels&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;upper right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 LP Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Other Versions=&lt;br /&gt;
An older version of the library that is compatible with results from the 2013 version of TUFLOW (this is limited to the 1D results) is also available.  This is currently undocumented, however, if you would like this please contact support@tuflow.com.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=TUFLOW_NetCDF_Cell_Centre_Output_Format&amp;diff=15929</id>
		<title>TUFLOW NetCDF Cell Centre Output Format</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=TUFLOW_NetCDF_Cell_Centre_Output_Format&amp;diff=15929"/>
		<updated>2018-05-10T05:06:27Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
This page contains information on the NetCDF file format used for cell centered model outputs from a TUFLOW simulation.  To specify cell centered NetCDF output from TUFLOW, the 2017 version or later must be used and &amp;quot;CC&amp;quot; must be included in the Map Output Data Formats, e.g.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Map Output Format &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; xmdf cc &amp;lt;/tt&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;! Output both xmdf and Cell Centered NetCDF formats&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
There are a range of additional NetCDF related commands, to control the output further these are:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;NetCDF Output Compression &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; OFF | {ON} | compression level &amp;lt;0 – 9&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;NetCDF Output Start Date &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; {2000-01-01 00:00} | OFF | &amp;lt;date in isodate format&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;NetCDF Output Time Unit &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; DAY | {HOUR} | MINUTE&lt;br /&gt;
&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;NetCDF Output Direction &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; {ANGLE} | BEARING&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;NetCDF Output Format &amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;==&amp;lt;/tt&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;tt&amp;gt; {FEWS} | Generic&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Please refer to the TUFLOW manual for more details on these commands.&lt;br /&gt;
&lt;br /&gt;
==Global Attributes==&lt;br /&gt;
The NetCDF file has four global attributes:&amp;lt;br&amp;gt;&lt;br /&gt;
* Title - The simulation name&lt;br /&gt;
* Source - The TUFLOW version which has been used&lt;br /&gt;
* References - The documentation of the NetCDF file, i.e. this page!&lt;br /&gt;
* Comment - A description of the output.&lt;br /&gt;
* NetCDF File Format Version - A unique value for file version, for the 2017 version this is 2.&lt;br /&gt;
* NetCDF Data Type - This is 1 for &amp;lt;u&amp;gt;[[TUFLOW_NetCDF_Raster_Output_Format | &amp;quot;NC&amp;quot; raster output]]&amp;lt;/u&amp;gt; and 2 for cell centered results.&lt;br /&gt;
An example of the &#039;&#039;&#039;Global Attributes&#039;&#039;&#039; is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Global Attributes:&lt;br /&gt;
           title      = &#039;M01_5m_002_NC2&#039;&lt;br /&gt;
           source     = &#039;TUFLOW Build: 2015-12-BB-Dev-iSP-w64&#039;&lt;br /&gt;
           references = &#039;TUFLOW NetCDF Raster Output Format (http://wiki.tuflow.com/index.php?title=TUFLOW_NetCDF_Raster_Output_Format)&#039;&lt;br /&gt;
           comment    = &#039;Contains raster TUFLOW output, TUFLOW netcdf version: 1&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dimensions==&lt;br /&gt;
The output NetCDF will have three or four dimensions depending on if the &#039;&#039;&#039;Generic&#039;&#039;&#039; or &#039;&#039;&#039;FEWS&#039;&#039;&#039; format has been specified.  These are:&lt;br /&gt;
* x - the number of x coordinates (columns of data)&lt;br /&gt;
* y - the number of y coordinates (rows of data)&lt;br /&gt;
* time - the number of outputs.  Note that this is an unlimited dimension meaning that the number of time changes each time a new output is written&lt;br /&gt;
* static_time (FEWS Format only) - This has a size of 1 and is used for storing a time for the static data (such as maximums)&lt;br /&gt;
An example of the &#039;&#039;&#039;Dimensions&#039;&#039;&#039; is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Dimensions:&lt;br /&gt;
           x           = 1946&lt;br /&gt;
           y           = 856&lt;br /&gt;
           static_time = 1&lt;br /&gt;
           time        = 161   (UNLIMITED)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Variables==&lt;br /&gt;
All outputs for the simulation are written to a single NetCDF file.  These are split into three categories:&lt;br /&gt;
* Common variables&lt;br /&gt;
* Temporal variables &lt;br /&gt;
* Non Temporal variables.  &lt;br /&gt;
For example if the model writes depths our every 10 minutes and tracking maximums is enabled (default) then two depth datasets are written: &#039;&#039;&#039;depths&#039;&#039;&#039; and &#039;&#039;&#039;maximum_depths&#039;&#039;&#039;.  These are described further below.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15928</id>
		<title>Python Library TUFLOW Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15928"/>
		<updated>2018-05-10T05:05:37Z</updated>

		<summary type="html">&lt;p&gt;Par: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TUPython.png | 435px]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
For the 2016 version of TUFLOW a new output format for time-series was made available, this has the following changes from previous versions:&lt;br /&gt;
* Combines the 1D results, 2D plot outputs and new reporting location data&lt;br /&gt;
* The outputs are stored in a separate &#039;&#039;&#039;Plot&#039;&#039;&#039; folder in the TUFLOW results directory&lt;br /&gt;
* .tpc (&amp;lt;u&amp;gt;T&amp;lt;/u&amp;gt;UFLOW &amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;lot &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;ontrol file links to data in csv and gis folders&lt;br /&gt;
* Has additional Node and Channel information files contain connectivity information&lt;br /&gt;
This is the default approach for the 2016 version but can be modified with the TUFLOW command &amp;quot;&amp;lt;tt&amp;gt;Output Approach == Pre 2016&amp;lt;/tt&amp;gt;&amp;quot; (refer to the manual for more information on this command.&amp;lt;br&amp;gt;&lt;br /&gt;
To make this data easier to work with an open source python library has been created and made available.  This allows the user to load results and then interact with these.  This library does not have any plotting functionality directly, with the returns typically being arrays (e.g. time and flows) however, the examples below give some examples using common plotting libraries such as matplotlib.&amp;lt;br&amp;gt;&lt;br /&gt;
=Getting the TUFLOW results python library=&lt;br /&gt;
You can find the TUFLOW_results.py (previously TUFLOW_Results2016.py) on our GitHub repository, QGIS plugin repository, or if you have QGIS and the TUFLOW plugin installed, you will already have it on your computer. &lt;br /&gt;
&lt;br /&gt;
GitHub: [https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin]&amp;lt;br&amp;gt;&lt;br /&gt;
QGIS plugin repo: [https://plugins.qgis.org/plugins/tuflow/ https://plugins.qgis.org/plugins/tuflow/]&amp;lt;br&amp;gt;&lt;br /&gt;
If you have QGIS2 already: C:\Users\&amp;lt;User Name&amp;gt;\.qgis2\python\plugins\tuflow&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TUFLOW python library does not need to be installed in python (through pip or otherwise) like other common modules, the TUFLOW_results.py file just needs to be in the same location as your python project.&lt;br /&gt;
&lt;br /&gt;
Note it shouldn’t matter if you’re using python 2 or python 3.&lt;br /&gt;
=Dependencies=&lt;br /&gt;
The TUFLOW results library calls a number of python modules, these are:&lt;br /&gt;
* csv&lt;br /&gt;
* numpy&lt;br /&gt;
* os&lt;br /&gt;
* sys&lt;br /&gt;
Of these the csv, os and sys functionality should be available directly with the python install.  Depending on the method used to install python, numpy may need to be installed.  If installation of numpy is required, please refer to the numpy documentation [http://www.numpy.org/ http://www.numpy.org/].&lt;br /&gt;
=Compatible Python Versions=&lt;br /&gt;
The functionality has been developed for Python 2.7, but should be compatible with Python 3.5.  Other versions of python are currently untested.&lt;br /&gt;
=Usage=&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
This library is imported with the typical python syntax.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;import TUFLOW_results&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Initialise Results (ResData)==&lt;br /&gt;
The results data functionality has a class defined, this is named &#039;&#039;&#039;ResData&#039;&#039;&#039;. An instance of the results can be initialised with the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;res = TUFLOW_results.ResData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Defined Methods (Functions)==&lt;br /&gt;
The following are the defined &#039;&#039;&#039;functions&#039;&#039;&#039; in the results data class (ResData).&lt;br /&gt;
===Load Results===&lt;br /&gt;
Results are loaded in with the syntax below.&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.Load(r&#039;D:\TUFLOW\QGIS\test\plot\Plot_Example.tpc&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two return arguments are:&lt;br /&gt;
* error (logical) set to True if an error has been encountered.&lt;br /&gt;
* message (string), if an error has occurred the message string will be populated with an error message.&lt;br /&gt;
===Get Time-series===&lt;br /&gt;
Time-series at a 1D, 2D or reporting location can be returned using the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTSData(&amp;lt;ID&amp;gt;,&amp;lt;domain&amp;gt;,&amp;lt;results type&amp;gt;,&amp;lt;geometry&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;ID - The ID of the 1D, 2D or reporting location feature.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Domain - The domain to return the results for, this will be one of &#039;&#039;&#039;1D&#039;&#039;&#039;, &#039;&#039;&#039;2D&#039;&#039;&#039; or &#039;&#039;&#039;RL&#039;&#039;&#039; (for reporting location data)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Results Type - The results type to be returned.  This includes H (level), Q (flow), V (velocity), E (energy), QA (flow area) depending on the data types that have been output!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Geometry - The GIS geometry of the object, &#039;&#039;&#039;L&#039;&#039;&#039; for line, or &#039;&#039;&#039;P&#039;&#039;&#039; for point.  If unsure or unknown this can be set to a blank string such as &#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;found (logical) - Returns True if the data has been found, False if the data can not be found or an error has occurred.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;results (numpy array) - The return array for the requested data.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If the data is not found, this message string contains information.&amp;lt;/li&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTS(&#039;ds3&#039;,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Will return flow (Q) data for the 1D channel with ID ds3.  The optional &#039;L&#039; geometry indicates that this is stored on a line object in the GIS plot objects.&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; As the time data typically does not change (this is not a return argument) but can be accessed by the &amp;lt;tt&amp;gt;res.times&amp;lt;/tt&amp;gt;.  See the examples below.&lt;br /&gt;
===Long Profile Functions===&lt;br /&gt;
When dealing with 1D long profile data, if a single 1D channel is specified the data for all channels downstream will returned.  If two channels are specified, long profile data will only be returned for the channels between the specified channels.&lt;br /&gt;
&lt;br /&gt;
====Get Long Profile Connectivity (LP_getConnectivity)====&lt;br /&gt;
This determines and stores the connectivity of the specified channels.  This is used in later routines to determine the channels and nodes to plot for the long profile. The syntax is: &lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getConnectivity(&amp;lt;US Channel ID&amp;gt;,&amp;lt;US Channel ID or None&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Upstream Channel ID - The ID of the Upstream 1D channel.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Downstream Channel ID - The ID of the Downstream 1D channel, if no downstream channel is to be used this can be set to &#039;&#039;&#039;None&#039;&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,None)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines all the channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,&#039;ds3&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines the channels between &#039;&#039;&#039;FC01.40&#039;&#039;&#039; and &#039;&#039;&#039;ds3&#039;&#039;&#039;, an error will be returned if these channels are not connected.&lt;br /&gt;
====Get Long Profile Static Data (LP_getStaticData)====&lt;br /&gt;
Once the connectivity between two channels has been determined, this routine can be used to get data that does not change between time-steps.  This includes:&lt;br /&gt;
* distance information&lt;br /&gt;
* maximum data&lt;br /&gt;
* bed levels&lt;br /&gt;
The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getStaticData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are no input arguments as the channel connectivity is stored in the res.LP class. The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
====Get Long Profile Data (LP_getData)====&lt;br /&gt;
This function gets data at a specific time.  If looping through timesteps (e.g. for an animation) the channel connectivity and static data will not change between timesteps and therefore only the &#039;&#039;&#039;LP_getData&#039;&#039;&#039; will need to be repeated.  The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&amp;lt;data type&amp;gt;,&amp;lt;time&amp;gt;,&amp;lt;time search tolerance&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Data type - The results data to return, this is one of &#039;Head&#039; or &#039;Energy&#039;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time - The time in hours to get the data for.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time search tolerance - If the closest output time is greater than the time search tolerance from the specified time an error will be returned.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&#039;Head&#039;,1,0.01)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Returns the water level (head) data at time 1 hours using a search tolerance of 0.01 hours.&lt;br /&gt;
==Other Attributes==&lt;br /&gt;
Once initialised the ResData class also has a number of &#039;&#039;&#039;attributes&#039;&#039;&#039; associated with it as well as the &#039;&#039;&#039;defined functions&#039;&#039;&#039; described above, these are outlined in the table below.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Attribute Name&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Type&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=70% | Description&lt;br /&gt;
|-&lt;br /&gt;
|script_version|| string || Contains a version number of the TUFLOW results library, e.g. &#039;2016-01-AA&#039;&lt;br /&gt;
|-&lt;br /&gt;
|filename|| string|| The full filepath to the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|fpath|| string|| The path of the folder which contains the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|nTypes|| integer|| The number of data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|Types || list || A lists of the data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|LP || class (LP) || Contains Long profile information, connectivity, distances etc.&lt;br /&gt;
|-&lt;br /&gt;
|Data_1D|| class(Data_1D) || The 1D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_2D|| class(Data_2D) || The 2D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_RL|| class(Data_RL) || The reporting location results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|GIS|| class(GIS)|| This contains the information read in from the &amp;lt;tt&amp;gt;GIS Plot Layer&amp;lt;/tt&amp;gt; csv files.&lt;br /&gt;
|-&lt;br /&gt;
|formatVersion|| integer || The format version of the results as defined in the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|units || string || The units as defined in the .tpc. E.g. &amp;quot;Metric&amp;quot; or &amp;quot;English&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|displayname || string || The simulation name e.g. &amp;quot;M04_5m_001_2015&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Index || class(PlotObjects)|| This contains data read from the &amp;quot;GIS Plot Objects&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|nodes|| class(NodeInfo) || Contains information on the 1D nodes, as read from the &amp;quot;1D Node Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|Channels|| class(ChanInfo)|| Contains information on the 1D nodes, as read from the &amp;quot;1D Channel Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|times || numpy ndarray|| The active times.  This is typically static, however calls to function &#039;&#039;&#039;getTS&#039;&#039;&#039; may cause this array to be updated (if the 1D or 2D outputs have a different output interval)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
These examples work with the Tutorial Model module 4 results.  The tutorial model can be downloaded on the [https://www.tuflow.com/Tuflow%20Tutorial%20Models.aspx TUFLOW website].&lt;br /&gt;
==Plot Flow in Channel==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os						#operating system functions&lt;br /&gt;
import sys						#system functions&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import TUFLOW_results&lt;br /&gt;
&lt;br /&gt;
input_res = r&#039;C:\TUFLOW\Models\Tutorials\QGIS\Complete_Model\TUFLOW\results\M04\2d\plot\M04_5m_001.tpc&#039;&lt;br /&gt;
&lt;br /&gt;
# initialise the results class&lt;br /&gt;
res = TUFLOW_results.ResData()&lt;br /&gt;
&lt;br /&gt;
# Load the data and terminate if error returned&lt;br /&gt;
error, message = res.Load(input_res)&lt;br /&gt;
if error:&lt;br /&gt;
    print(message)&lt;br /&gt;
    sys.exit()&lt;br /&gt;
print(&#039;loaded&#039;)&lt;br /&gt;
&lt;br /&gt;
#create a figure&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
chan_id = &#039;ds3&#039; # this is the channel ID to use&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	# plot data&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - single location&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend()&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 Q Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plot Multiple Water Levels==&lt;br /&gt;
In this example, it is assumed that the results data has been loaded as per the above.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
# list of nodes to plot&lt;br /&gt;
node_ids = [&#039;FC01.14.1&#039;,&#039;FC01.15.1&#039;,&#039;FC01.16.1&#039;,&#039;FC01.17.1&#039;]&lt;br /&gt;
&lt;br /&gt;
#Get water level data&lt;br /&gt;
for node_id in node_ids: #for each node in the list above&lt;br /&gt;
	found, results, message = res.getTSData(node_id,&#039;1D&#039;,&#039;H&#039;,&#039;P&#039;)&lt;br /&gt;
	if found:&lt;br /&gt;
		print(&#039;found requested data&#039;)&lt;br /&gt;
		# plot data&lt;br /&gt;
		ax1.plot(res.times,results,label=&#039;Level - &#039;+node_id)&lt;br /&gt;
	else:&lt;br /&gt;
		print(message)&lt;br /&gt;
		sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Water Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - multiple locations&#039;)&lt;br /&gt;
ax1.set_ybound((38.,44.)) #overwrite the y axis bounds&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;lower right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 H Example 01.png|600px]]&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Dual Axis (flow and velocity) Plot==&lt;br /&gt;
In this example it is assumed the results have been loaded as per example 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# specify channel to plot&lt;br /&gt;
chan_id = &#039;ds3&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.80,0.75)) #add axis to figure&lt;br /&gt;
ax2 = ax1.twinx() #create new axis with same x properties&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
#Get velocity data&lt;br /&gt;
found, results, message = res.getTSData(chan_id,&#039;1D&#039;,&#039;V&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print(&#039;found requested data&#039;)&lt;br /&gt;
	ax2.plot(res.times,results,color=&#039;r&#039;,label=&#039;Velocity - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax2.set_ylabel(&#039;Velocity (m/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - twin axis&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
h1, l1 = ax1.get_legend_handles_labels()&lt;br /&gt;
h2, l2 = ax2.get_legend_handles_labels()&lt;br /&gt;
ax1.legend(h1+h2, l1+l2, loc=&#039;upper left&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 QV Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
==Long Profile Peak Levels==&lt;br /&gt;
This also assumes that the data has been loaded as per example 1 above.  The long profile data for all channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039; will be plotted.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
us_chan = &#039;FC01.40&#039; #upstream channel&lt;br /&gt;
ds_chan = None&lt;br /&gt;
&lt;br /&gt;
#get connectivity between channels&lt;br /&gt;
error, message = res.LP_getConnectivity(us_chan,ds_chan)&lt;br /&gt;
if error:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print(&#039;LP connectivity determined.&#039;)&lt;br /&gt;
&lt;br /&gt;
print(&#039;Get LP static data&#039;)&lt;br /&gt;
error, message = res.LP_getStaticData()&lt;br /&gt;
if error:&lt;br /&gt;
	print(message)&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print(&#039;LP static data retrieved&#039;)&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.80)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#plot data&lt;br /&gt;
# Max WL&lt;br /&gt;
ax1.plot(res.LP.dist_nodes, res.LP.Hmax,color=&#039;r&#039;,label = &#039;Max Water Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# Bed Level&lt;br /&gt;
ax1.plot(res.LP.dist_chan_inverts, res.LP.chan_inv,color=&#039;brown&#039;,linewidth = &#039;3&#039;,label = &#039;Bed Level Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Distance (m)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example Long Profile - Peak Levels&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;upper right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 LP Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Other Versions=&lt;br /&gt;
An older version of the library that is compatible with results from the 2013 version of TUFLOW (this is limited to the 1D results) is also available.  This is currently undocumented, however, if you would like this please contact support@tuflow.com.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15926</id>
		<title>Python Library TUFLOW Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15926"/>
		<updated>2018-05-10T04:52:29Z</updated>

		<summary type="html">&lt;p&gt;Par: Par moved page Python Library TUFLOW Results 2016 to Python Library TUFLOW Results: Renamed library&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TUPython.png | 435px]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
For the 2016 version of TUFLOW a new output format for time-series was made available, this has the following changes from previous versions:&lt;br /&gt;
* Combines the 1D results, 2D plot outputs and new reporting location data&lt;br /&gt;
* The outputs are stored in a separate &#039;&#039;&#039;Plot&#039;&#039;&#039; folder in the TUFLOW results directory&lt;br /&gt;
* .tpc (&amp;lt;u&amp;gt;T&amp;lt;/u&amp;gt;UFLOW &amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;lot &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;ontrol file links to data in csv and gis folders&lt;br /&gt;
* Has additional Node and Channel information files contain connectivity information&lt;br /&gt;
This is the default approach for the 2016 version but can be modified with the TUFLOW command &amp;quot;&amp;lt;tt&amp;gt;Output Approach == Pre 2016&amp;lt;/tt&amp;gt;&amp;quot; (refer to the manual for more information on this command.&amp;lt;br&amp;gt;&lt;br /&gt;
To make this data easier to work with an open source python library has been created and made available.  This allows the user to load results and then interact with these.  This library does not have any plotting functionality directly, with the returns typically being arrays (e.g. time and flows) however, the examples below give some examples using common plotting libraries such as matplotlib.&amp;lt;br&amp;gt;&lt;br /&gt;
=Getting the TUFLOW results python library=&lt;br /&gt;
You can find the TUFLOW_results.py (previously TUFLOW_Results2016.py) on our GitHub repository, QGIS plugin repository, or if you have QGIS and the TUFLOW plugin installed, you will already have it on your computer. &lt;br /&gt;
&lt;br /&gt;
GitHub: [https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin]&amp;lt;br&amp;gt;&lt;br /&gt;
QGIS plugin repo: [https://plugins.qgis.org/plugins/tuflow/ https://plugins.qgis.org/plugins/tuflow/]&amp;lt;br&amp;gt;&lt;br /&gt;
If you have QGIS2 already: C:\Users\&amp;lt;User Name&amp;gt;\.qgis2\python\plugins\tuflow&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TUFLOW python library does not need to be installed in python (through pip or otherwise) like other common modules, the TUFLOW_results.py file just needs to be in the same location as your python project.&lt;br /&gt;
&lt;br /&gt;
Note it shouldn’t matter if you’re using python 2 or python 3.&lt;br /&gt;
=Dependencies=&lt;br /&gt;
The TUFLOW results library calls a number of python modules, these are:&lt;br /&gt;
* csv&lt;br /&gt;
* numpy&lt;br /&gt;
* os&lt;br /&gt;
* sys&lt;br /&gt;
Of these the csv, os and sys functionality should be available directly with the python install.  Depending on the method used to install python, numpy may need to be installed.  If installation of numpy is required, please refer to the numpy documentation [http://www.numpy.org/ http://www.numpy.org/].&lt;br /&gt;
=Compatible Python Versions=&lt;br /&gt;
The functionality has been developed for Python 2.7, but should be compatible with Python 3.5.  Other versions of python are currently untested.&lt;br /&gt;
=Usage=&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
This library is imported with the typical python syntax.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;import TUFLOW_results&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Initialise Results (ResData)==&lt;br /&gt;
The results data functionality has a class defined, this is named &#039;&#039;&#039;ResData&#039;&#039;&#039;. An instance of the results can be initialised with the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;res = TUFLOW_results.ResData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Defined Methods (Functions)==&lt;br /&gt;
The following are the defined &#039;&#039;&#039;functions&#039;&#039;&#039; in the results data class (ResData).&lt;br /&gt;
===Load Results===&lt;br /&gt;
Results are loaded in with the syntax below.&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.Load(r&#039;D:\TUFLOW\QGIS\test\plot\Plot_Example.tpc&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two return arguments are:&lt;br /&gt;
* error (logical) set to True if an error has been encountered.&lt;br /&gt;
* message (string), if an error has occurred the message string will be populated with an error message.&lt;br /&gt;
===Get Time-series===&lt;br /&gt;
Time-series at a 1D, 2D or reporting location can be returned using the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTSData(&amp;lt;ID&amp;gt;,&amp;lt;domain&amp;gt;,&amp;lt;results type&amp;gt;,&amp;lt;geometry&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;ID - The ID of the 1D, 2D or reporting location feature.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Domain - The domain to return the results for, this will be one of &#039;&#039;&#039;1D&#039;&#039;&#039;, &#039;&#039;&#039;2D&#039;&#039;&#039; or &#039;&#039;&#039;RL&#039;&#039;&#039; (for reporting location data)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Results Type - The results type to be returned.  This includes H (level), Q (flow), V (velocity), E (energy), QA (flow area) depending on the data types that have been output!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Geometry - The GIS geometry of the object, &#039;&#039;&#039;L&#039;&#039;&#039; for line, or &#039;&#039;&#039;P&#039;&#039;&#039; for point.  If unsure or unknown this can be set to a blank string such as &#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;found (logical) - Returns True if the data has been found, False if the data can not be found or an error has occurred.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;results (numpy array) - The return array for the requested data.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If the data is not found, this message string contains information.&amp;lt;/li&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTS(&#039;ds3&#039;,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Will return flow (Q) data for the 1D channel with ID ds3.  The optional &#039;L&#039; geometry indicates that this is stored on a line object in the GIS plot objects.&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; As the time data typically does not change (this is not a return argument) but can be accessed by the &amp;lt;tt&amp;gt;res.times&amp;lt;/tt&amp;gt;.  See the examples below.&lt;br /&gt;
===Long Profile Functions===&lt;br /&gt;
When dealing with 1D long profile data, if a single 1D channel is specified the data for all channels downstream will returned.  If two channels are specified, long profile data will only be returned for the channels between the specified channels.&lt;br /&gt;
&lt;br /&gt;
====Get Long Profile Connectivity (LP_getConnectivity)====&lt;br /&gt;
This determines and stores the connectivity of the specified channels.  This is used in later routines to determine the channels and nodes to plot for the long profile. The syntax is: &lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getConnectivity(&amp;lt;US Channel ID&amp;gt;,&amp;lt;US Channel ID or None&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Upstream Channel ID - The ID of the Upstream 1D channel.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Downstream Channel ID - The ID of the Downstream 1D channel, if no downstream channel is to be used this can be set to &#039;&#039;&#039;None&#039;&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,None)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines all the channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,&#039;ds3&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines the channels between &#039;&#039;&#039;FC01.40&#039;&#039;&#039; and &#039;&#039;&#039;ds3&#039;&#039;&#039;, an error will be returned if these channels are not connected.&lt;br /&gt;
====Get Long Profile Static Data (LP_getStaticData)====&lt;br /&gt;
Once the connectivity between two channels has been determined, this routine can be used to get data that does not change between time-steps.  This includes:&lt;br /&gt;
* distance information&lt;br /&gt;
* maximum data&lt;br /&gt;
* bed levels&lt;br /&gt;
The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getStaticData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are no input arguments as the channel connectivity is stored in the res.LP class. The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
====Get Long Profile Data (LP_getData)====&lt;br /&gt;
This function gets data at a specific time.  If looping through timesteps (e.g. for an animation) the channel connectivity and static data will not change between timesteps and therefore only the &#039;&#039;&#039;LP_getData&#039;&#039;&#039; will need to be repeated.  The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&amp;lt;data type&amp;gt;,&amp;lt;time&amp;gt;,&amp;lt;time search tolerance&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Data type - The results data to return, this is one of &#039;Head&#039; or &#039;Energy&#039;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time - The time in hours to get the data for.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time search tolerance - If the closest output time is greater than the time search tolerance from the specified time an error will be returned.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&#039;Head&#039;,1,0.01)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Returns the water level (head) data at time 1 hours using a search tolerance of 0.01 hours.&lt;br /&gt;
==Other Attributes==&lt;br /&gt;
Once initialised the ResData class also has a number of &#039;&#039;&#039;attributes&#039;&#039;&#039; associated with it as well as the &#039;&#039;&#039;defined functions&#039;&#039;&#039; described above, these are outlined in the table below.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Attribute Name&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Type&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=70% | Description&lt;br /&gt;
|-&lt;br /&gt;
|script_version|| string || Contains a version number of the TUFLOW results library, e.g. &#039;2016-01-AA&#039;&lt;br /&gt;
|-&lt;br /&gt;
|filename|| string|| The full filepath to the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|fpath|| string|| The path of the folder which contains the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|nTypes|| integer|| The number of data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|Types || list || A lists of the data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|LP || class (LP) || Contains Long profile information, connectivity, distances etc.&lt;br /&gt;
|-&lt;br /&gt;
|Data_1D|| class(Data_1D) || The 1D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_2D|| class(Data_2D) || The 2D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_RL|| class(Data_RL) || The reporting location results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|GIS|| class(GIS)|| This contains the information read in from the &amp;lt;tt&amp;gt;GIS Plot Layer&amp;lt;/tt&amp;gt; csv files.&lt;br /&gt;
|-&lt;br /&gt;
|formatVersion|| integer || The format version of the results as defined in the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|units || string || The units as defined in the .tpc. E.g. &amp;quot;Metric&amp;quot; or &amp;quot;English&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|displayname || string || The simulation name e.g. &amp;quot;M04_5m_001_2015&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Index || class(PlotObjects)|| This contains data read from the &amp;quot;GIS Plot Objects&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|nodes|| class(NodeInfo) || Contains information on the 1D nodes, as read from the &amp;quot;1D Node Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|Channels|| class(ChanInfo)|| Contains information on the 1D nodes, as read from the &amp;quot;1D Channel Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|times || numpy ndarray|| The active times.  This is typically static, however calls to function &#039;&#039;&#039;getTS&#039;&#039;&#039; may cause this array to be updated (if the 1D or 2D outputs have a different output interval)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
These examples can be downloaded in .py format along with the example results from the TUFLOW website (link required).&lt;br /&gt;
==Plot Flow in Channel==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os						#operating system functions&lt;br /&gt;
import sys						#system functions&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import TUFLOW_results&lt;br /&gt;
&lt;br /&gt;
# initialise the results class&lt;br /&gt;
res = TUFLOW_results.ResData()&lt;br /&gt;
&lt;br /&gt;
# Load the data and terminate if error returned&lt;br /&gt;
error, message = res.Load(input_res)&lt;br /&gt;
if error:&lt;br /&gt;
    print(message)&lt;br /&gt;
    sys.exit()&lt;br /&gt;
print(&#039;loaded&#039;)&lt;br /&gt;
&lt;br /&gt;
#create a figure&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
chan_id = &#039;ds3&#039; # this is the channel ID to use&lt;br /&gt;
found, results, message = res.getTS(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print &#039;found requested data&#039;&lt;br /&gt;
	# plot data&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - single location&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend()&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 Q Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plot Multiple Water Levels==&lt;br /&gt;
In this example, it is assumed that the results data has been loaded as per the above.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
# list of nodes to plot&lt;br /&gt;
node_ids = [&#039;FC01.14.1&#039;,&#039;FC01.15.1&#039;,&#039;FC01.16.1&#039;,&#039;FC01.17.1&#039;]&lt;br /&gt;
&lt;br /&gt;
#Get water level data&lt;br /&gt;
for node_id in node_ids: #for each node in the list above&lt;br /&gt;
	found, results, message = res.getTS(node_id,&#039;1D&#039;,&#039;H&#039;,&#039;P&#039;)&lt;br /&gt;
	if found:&lt;br /&gt;
		print &#039;found requested data&#039;&lt;br /&gt;
		# plot data&lt;br /&gt;
		ax1.plot(res.times,results,label=&#039;Level - &#039;+node_id)&lt;br /&gt;
	else:&lt;br /&gt;
		print message&lt;br /&gt;
		sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Water Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - multiple locations&#039;)&lt;br /&gt;
ax1.set_ybound((38.,44.)) #overwrite the y axis bounds&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;lower right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 H Example 01.png|600px]]&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Dual Axis (flow and velocity) Plot==&lt;br /&gt;
In this example it is assumed the results have been loaded as per example 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# specify channel to plot&lt;br /&gt;
chan_id = &#039;ds3&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.80,0.75)) #add axis to figure&lt;br /&gt;
ax2 = ax1.twinx() #create new axis with same x properties&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
found, results, message = res.getTS(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print &#039;found requested data&#039;&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
#Get velocity data&lt;br /&gt;
found, results, message = res.getTS(chan_id,&#039;1D&#039;,&#039;V&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print &#039;found requested data&#039;&lt;br /&gt;
	ax2.plot(res.times,results,color=&#039;r&#039;,label=&#039;Velocity - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax2.set_ylabel(&#039;Velocity (m/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - twin axis&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
h1, l1 = ax1.get_legend_handles_labels()&lt;br /&gt;
h2, l2 = ax2.get_legend_handles_labels()&lt;br /&gt;
ax1.legend(h1+h2, l1+l2, loc=&#039;upper left&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 QV Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
==Long Profile Peak Levels==&lt;br /&gt;
This also assumes that the data has been loaded as per example 1 above.  The long profile data for all channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039; will be plotted.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
us_chan = &#039;FC01.40&#039; #upstream channel&lt;br /&gt;
ds_chan = None&lt;br /&gt;
&lt;br /&gt;
#get connectivity between channels&lt;br /&gt;
error, message = res.LP_getConnectivity(us_chan,ds_chan)&lt;br /&gt;
if error:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print &#039;LP connectivity determined.&#039;&lt;br /&gt;
&lt;br /&gt;
print &#039;Get LP static data&#039;&lt;br /&gt;
error, message = res.LP_getStaticData()&lt;br /&gt;
if error:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print &#039;LP static data retrieved&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.80)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#plot data&lt;br /&gt;
# Max WL&lt;br /&gt;
ax1.plot(res.LP.dist_nodes, res.LP.Hmax,color=&#039;r&#039;,label = &#039;Max Water Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# Bed Level&lt;br /&gt;
ax1.plot(res.LP.dist_chan_inverts, res.LP.chan_inv,color=&#039;brown&#039;,linewidth = &#039;3&#039;,label = &#039;Bed Level Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Distance (m)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example Long Profile - Peak Levels&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;upper right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 LP Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Other Versions=&lt;br /&gt;
An older version of the library that is compatible with results from the 2013 version of TUFLOW (this is limited to the 1D results) is also available.  This is currently undocumented, however, if you would like this please contact support@tuflow.com.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15925</id>
		<title>Python Library TUFLOW Results</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=Python_Library_TUFLOW_Results&amp;diff=15925"/>
		<updated>2018-05-10T04:46:44Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:TUPython.png | 435px]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
For the 2016 version of TUFLOW a new output format for time-series was made available, this has the following changes from previous versions:&lt;br /&gt;
* Combines the 1D results, 2D plot outputs and new reporting location data&lt;br /&gt;
* The outputs are stored in a separate &#039;&#039;&#039;Plot&#039;&#039;&#039; folder in the TUFLOW results directory&lt;br /&gt;
* .tpc (&amp;lt;u&amp;gt;T&amp;lt;/u&amp;gt;UFLOW &amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;lot &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;ontrol file links to data in csv and gis folders&lt;br /&gt;
* Has additional Node and Channel information files contain connectivity information&lt;br /&gt;
This is the default approach for the 2016 version but can be modified with the TUFLOW command &amp;quot;&amp;lt;tt&amp;gt;Output Approach == Pre 2016&amp;lt;/tt&amp;gt;&amp;quot; (refer to the manual for more information on this command.&amp;lt;br&amp;gt;&lt;br /&gt;
To make this data easier to work with an open source python library has been created and made available.  This allows the user to load results and then interact with these.  This library does not have any plotting functionality directly, with the returns typically being arrays (e.g. time and flows) however, the examples below give some examples using common plotting libraries such as matplotlib.&amp;lt;br&amp;gt;&lt;br /&gt;
=Getting the TUFLOW results python library=&lt;br /&gt;
You can find the TUFLOW_results.py (previously TUFLOW_Results2016.py) on our GitHub repository, QGIS plugin repository, or if you have QGIS and the TUFLOW plugin installed, you will already have it on your computer. &lt;br /&gt;
&lt;br /&gt;
GitHub: [https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin https://github.com/TUFLOW-Support/QGIS-TUFLOW-Plugin]&amp;lt;br&amp;gt;&lt;br /&gt;
QGIS plugin repo: [https://plugins.qgis.org/plugins/tuflow/ https://plugins.qgis.org/plugins/tuflow/]&amp;lt;br&amp;gt;&lt;br /&gt;
If you have QGIS2 already: C:\Users\&amp;lt;User Name&amp;gt;\.qgis2\python\plugins\tuflow&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TUFLOW python library does not need to be installed in python (through pip or otherwise) like other common modules, the TUFLOW_results.py file just needs to be in the same location as your python project.&lt;br /&gt;
&lt;br /&gt;
Note it shouldn’t matter if you’re using python 2 or python 3.&lt;br /&gt;
=Dependencies=&lt;br /&gt;
The TUFLOW results library calls a number of python modules, these are:&lt;br /&gt;
* csv&lt;br /&gt;
* numpy&lt;br /&gt;
* os&lt;br /&gt;
* sys&lt;br /&gt;
Of these the csv, os and sys functionality should be available directly with the python install.  Depending on the method used to install python, numpy may need to be installed.  If installation of numpy is required, please refer to the numpy documentation [http://www.numpy.org/ http://www.numpy.org/].&lt;br /&gt;
=Compatible Python Versions=&lt;br /&gt;
The functionality has been developed for Python 2.7, but should be compatible with Python 3.5.  Other versions of python are currently untested.&lt;br /&gt;
=Usage=&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
This library is imported with the typical python syntax.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;import TUFLOW_results&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Initialise Results (ResData)==&lt;br /&gt;
The results data functionality has a class defined, this is named &#039;&#039;&#039;ResData&#039;&#039;&#039;. An instance of the results can be initialised with the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;res = TUFLOW_results.ResData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Defined Methods (Functions)==&lt;br /&gt;
The following are the defined &#039;&#039;&#039;functions&#039;&#039;&#039; in the results data class (ResData).&lt;br /&gt;
===Load Results===&lt;br /&gt;
Results are loaded in with the syntax below.&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.Load(r&#039;D:\TUFLOW\QGIS\test\plot\Plot_Example.tpc&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The two return arguments are:&lt;br /&gt;
* error (logical) set to True if an error has been encountered.&lt;br /&gt;
* message (string), if an error has occurred the message string will be populated with an error message.&lt;br /&gt;
===Get Time-series===&lt;br /&gt;
Time-series at a 1D, 2D or reporting location can be returned using the following syntax:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTSData(&amp;lt;ID&amp;gt;,&amp;lt;domain&amp;gt;,&amp;lt;results type&amp;gt;,&amp;lt;geometry&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;ID - The ID of the 1D, 2D or reporting location feature.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Domain - The domain to return the results for, this will be one of &#039;&#039;&#039;1D&#039;&#039;&#039;, &#039;&#039;&#039;2D&#039;&#039;&#039; or &#039;&#039;&#039;RL&#039;&#039;&#039; (for reporting location data)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Results Type - The results type to be returned.  This includes H (level), Q (flow), V (velocity), E (energy), QA (flow area) depending on the data types that have been output!&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Geometry - The GIS geometry of the object, &#039;&#039;&#039;L&#039;&#039;&#039; for line, or &#039;&#039;&#039;P&#039;&#039;&#039; for point.  If unsure or unknown this can be set to a blank string such as &#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;found (logical) - Returns True if the data has been found, False if the data can not be found or an error has occurred.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;results (numpy array) - The return array for the requested data.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If the data is not found, this message string contains information.&amp;lt;/li&amp;gt;&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
found, results, message = res.getTS(&#039;ds3&#039;,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Will return flow (Q) data for the 1D channel with ID ds3.  The optional &#039;L&#039; geometry indicates that this is stored on a line object in the GIS plot objects.&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039; As the time data typically does not change (this is not a return argument) but can be accessed by the &amp;lt;tt&amp;gt;res.times&amp;lt;/tt&amp;gt;.  See the examples below.&lt;br /&gt;
===Long Profile Functions===&lt;br /&gt;
When dealing with 1D long profile data, if a single 1D channel is specified the data for all channels downstream will returned.  If two channels are specified, long profile data will only be returned for the channels between the specified channels.&lt;br /&gt;
&lt;br /&gt;
====Get Long Profile Connectivity (LP_getConnectivity)====&lt;br /&gt;
This determines and stores the connectivity of the specified channels.  This is used in later routines to determine the channels and nodes to plot for the long profile. The syntax is: &lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getConnectivity(&amp;lt;US Channel ID&amp;gt;,&amp;lt;US Channel ID or None&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Upstream Channel ID - The ID of the Upstream 1D channel.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Downstream Channel ID - The ID of the Downstream 1D channel, if no downstream channel is to be used this can be set to &#039;&#039;&#039;None&#039;&#039;&#039;.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,None)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines all the channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getConnectivity(&#039;FC01.40&#039;,&#039;ds3&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Determines the channels between &#039;&#039;&#039;FC01.40&#039;&#039;&#039; and &#039;&#039;&#039;ds3&#039;&#039;&#039;, an error will be returned if these channels are not connected.&lt;br /&gt;
====Get Long Profile Static Data (LP_getStaticData)====&lt;br /&gt;
Once the connectivity between two channels has been determined, this routine can be used to get data that does not change between time-steps.  This includes:&lt;br /&gt;
* distance information&lt;br /&gt;
* maximum data&lt;br /&gt;
* bed levels&lt;br /&gt;
The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;error, message = res.LP_getStaticData()&amp;lt;/pre&amp;gt;&lt;br /&gt;
There are no input arguments as the channel connectivity is stored in the res.LP class. The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
====Get Long Profile Data (LP_getData)====&lt;br /&gt;
This function gets data at a specific time.  If looping through timesteps (e.g. for an animation) the channel connectivity and static data will not change between timesteps and therefore only the &#039;&#039;&#039;LP_getData&#039;&#039;&#039; will need to be repeated.  The syntax is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&amp;lt;data type&amp;gt;,&amp;lt;time&amp;gt;,&amp;lt;time search tolerance&amp;gt;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The inputs to this are:&lt;br /&gt;
&amp;lt;li&amp;gt;Data type - The results data to return, this is one of &#039;Head&#039; or &#039;Energy&#039;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time - The time in hours to get the data for.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Time search tolerance - If the closest output time is greater than the time search tolerance from the specified time an error will be returned.&amp;lt;/li&amp;gt;&lt;br /&gt;
The return arguments are:&lt;br /&gt;
&amp;lt;li&amp;gt;error (logical) - Returns True if an error has been encountered when detecting the connectivity between the specified channel(s).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;message (string) - If an error is returned this message string contains information on the issue.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error, message = res.LP_getData(&#039;Head&#039;,1,0.01)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Returns the water level (head) data at time 1 hours using a search tolerance of 0.01 hours.&lt;br /&gt;
==Other Attributes==&lt;br /&gt;
Once initialised the ResData class also has a number of &#039;&#039;&#039;attributes&#039;&#039;&#039; associated with it as well as the &#039;&#039;&#039;defined functions&#039;&#039;&#039; described above, these are outlined in the table below.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Attribute Name&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=15% | Type&lt;br /&gt;
! style=&amp;quot;background-color:#005581; font-weight:bold; color:white;&amp;quot; width=70% | Description&lt;br /&gt;
|-&lt;br /&gt;
|script_version|| string || Contains a version number of the TUFLOW results library, e.g. &#039;2016-01-AA&#039;&lt;br /&gt;
|-&lt;br /&gt;
|filename|| string|| The full filepath to the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|fpath|| string|| The path of the folder which contains the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|nTypes|| integer|| The number of data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|Types || list || A lists of the data types that are stored in the dataset.&lt;br /&gt;
|-&lt;br /&gt;
|LP || class (LP) || Contains Long profile information, connectivity, distances etc.&lt;br /&gt;
|-&lt;br /&gt;
|Data_1D|| class(Data_1D) || The 1D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_2D|| class(Data_2D) || The 2D results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|Data_RL|| class(Data_RL) || The reporting location results are all stored in this class.&lt;br /&gt;
|-&lt;br /&gt;
|GIS|| class(GIS)|| This contains the information read in from the &amp;lt;tt&amp;gt;GIS Plot Layer&amp;lt;/tt&amp;gt; csv files.&lt;br /&gt;
|-&lt;br /&gt;
|formatVersion|| integer || The format version of the results as defined in the .tpc file.&lt;br /&gt;
|-&lt;br /&gt;
|units || string || The units as defined in the .tpc. E.g. &amp;quot;Metric&amp;quot; or &amp;quot;English&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|displayname || string || The simulation name e.g. &amp;quot;M04_5m_001_2015&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Index || class(PlotObjects)|| This contains data read from the &amp;quot;GIS Plot Objects&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|nodes|| class(NodeInfo) || Contains information on the 1D nodes, as read from the &amp;quot;1D Node Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|Channels|| class(ChanInfo)|| Contains information on the 1D nodes, as read from the &amp;quot;1D Channel Info&amp;quot; .csv file.&lt;br /&gt;
|-&lt;br /&gt;
|times || numpy ndarray|| The active times.  This is typically static, however calls to function &#039;&#039;&#039;getTS&#039;&#039;&#039; may cause this array to be updated (if the 1D or 2D outputs have a different output interval)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
These examples can be downloaded in .py format along with the example results from the TUFLOW website (link required).&lt;br /&gt;
==Plot Flow in Channel==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os						#operating system functions&lt;br /&gt;
import sys						#system functions&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
import TUFLOW_results&lt;br /&gt;
&lt;br /&gt;
# initialise the results class&lt;br /&gt;
res = TUFLOW_results.ResData()&lt;br /&gt;
&lt;br /&gt;
# Load the data and terminate if error returned&lt;br /&gt;
error, message = res.Load(input_res)&lt;br /&gt;
if error:&lt;br /&gt;
    print(message)&lt;br /&gt;
    sys.exit()&lt;br /&gt;
print(&#039;loaded&#039;)&lt;br /&gt;
&lt;br /&gt;
#create a figure&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
chan_id = &#039;ds3&#039; # this is the channel ID to use&lt;br /&gt;
found, results, message = res.getTS(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print &#039;found requested data&#039;&lt;br /&gt;
	# plot data&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - single location&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend()&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 Q Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Plot Multiple Water Levels==&lt;br /&gt;
In this example, it is assumed that the results data has been loaded as per the above.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.75)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
# list of nodes to plot&lt;br /&gt;
node_ids = [&#039;FC01.14.1&#039;,&#039;FC01.15.1&#039;,&#039;FC01.16.1&#039;,&#039;FC01.17.1&#039;]&lt;br /&gt;
&lt;br /&gt;
#Get water level data&lt;br /&gt;
for node_id in node_ids: #for each node in the list above&lt;br /&gt;
	found, results, message = res.getTS(node_id,&#039;1D&#039;,&#039;H&#039;,&#039;P&#039;)&lt;br /&gt;
	if found:&lt;br /&gt;
		print &#039;found requested data&#039;&lt;br /&gt;
		# plot data&lt;br /&gt;
		ax1.plot(res.times,results,label=&#039;Level - &#039;+node_id)&lt;br /&gt;
	else:&lt;br /&gt;
		print message&lt;br /&gt;
		sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Water Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - multiple locations&#039;)&lt;br /&gt;
ax1.set_ybound((38.,44.)) #overwrite the y axis bounds&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;lower right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 H Example 01.png|600px]]&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Dual Axis (flow and velocity) Plot==&lt;br /&gt;
In this example it is assumed the results have been loaded as per example 1.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# specify channel to plot&lt;br /&gt;
chan_id = &#039;ds3&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.80,0.75)) #add axis to figure&lt;br /&gt;
ax2 = ax1.twinx() #create new axis with same x properties&lt;br /&gt;
&lt;br /&gt;
#Get flow data&lt;br /&gt;
found, results, message = res.getTS(chan_id,&#039;1D&#039;,&#039;Q&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print &#039;found requested data&#039;&lt;br /&gt;
	ax1.plot(res.times,results,color=&#039;b&#039;,label=&#039;Flow - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
#Get velocity data&lt;br /&gt;
found, results, message = res.getTS(chan_id,&#039;1D&#039;,&#039;V&#039;,&#039;L&#039;)&lt;br /&gt;
if found:&lt;br /&gt;
	print &#039;found requested data&#039;&lt;br /&gt;
	ax2.plot(res.times,results,color=&#039;r&#039;,label=&#039;Velocity - &#039;+chan_id)&lt;br /&gt;
else:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Time (hours)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Flow (m3/s)&#039;)&lt;br /&gt;
ax2.set_ylabel(&#039;Velocity (m/s)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example time-series - twin axis&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
h1, l1 = ax1.get_legend_handles_labels()&lt;br /&gt;
h2, l2 = ax2.get_legend_handles_labels()&lt;br /&gt;
ax1.legend(h1+h2, l1+l2, loc=&#039;upper left&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 QV Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
==Long Profile Peak Levels==&lt;br /&gt;
This also assumes that the data has been loaded as per example 1 above.  The long profile data for all channels downstream of &#039;&#039;&#039;FC01.40&#039;&#039;&#039; will be plotted.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
us_chan = &#039;FC01.40&#039; #upstream channel&lt;br /&gt;
ds_chan = None&lt;br /&gt;
&lt;br /&gt;
#get connectivity between channels&lt;br /&gt;
error, message = res.LP_getConnectivity(us_chan,ds_chan)&lt;br /&gt;
if error:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print &#039;LP connectivity determined.&#039;&lt;br /&gt;
&lt;br /&gt;
print &#039;Get LP static data&#039;&lt;br /&gt;
error, message = res.LP_getStaticData()&lt;br /&gt;
if error:&lt;br /&gt;
	print message&lt;br /&gt;
	sys.exit()&lt;br /&gt;
else:&lt;br /&gt;
	print &#039;LP static data retrieved&#039;&lt;br /&gt;
&lt;br /&gt;
#create plot&lt;br /&gt;
fig = plt.figure() #create new figure&lt;br /&gt;
ax1 = fig.add_axes((0.10, 0.15, 0.85,0.80)) #add axis to figure&lt;br /&gt;
&lt;br /&gt;
#plot data&lt;br /&gt;
# Max WL&lt;br /&gt;
ax1.plot(res.LP.dist_nodes, res.LP.Hmax,color=&#039;r&#039;,label = &#039;Max Water Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# Bed Level&lt;br /&gt;
ax1.plot(res.LP.dist_chan_inverts, res.LP.chan_inv,color=&#039;brown&#039;,linewidth = &#039;3&#039;,label = &#039;Bed Level Level&#039;)&lt;br /&gt;
&lt;br /&gt;
# manage plot&lt;br /&gt;
ax1.set_xlabel(&#039;Distance (m)&#039;)&lt;br /&gt;
ax1.set_ylabel(&#039;Level (mAHD)&#039;)&lt;br /&gt;
ax1.set_title(&#039;Example Long Profile - Peak Levels&#039;)&lt;br /&gt;
ax1.grid()&lt;br /&gt;
ax1.legend(loc=&#039;upper right&#039;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Python Results 2016 LP Example 01.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will create a figure that looks like the above.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Other Versions=&lt;br /&gt;
An older version of the library that is compatible with results from the 2013 version of TUFLOW (this is limited to the 1D results) is also available.  This is currently undocumented, however, if you would like this please contact support@tuflow.com.&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=File:Osgeo4w_matplotlib.PNG&amp;diff=15700</id>
		<title>File:Osgeo4w matplotlib.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=File:Osgeo4w_matplotlib.PNG&amp;diff=15700"/>
		<updated>2018-04-20T13:53:33Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuflow.com/w/index.php?title=File:Osgeo4w_qgis-ltr.PNG&amp;diff=15699</id>
		<title>File:Osgeo4w qgis-ltr.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuflow.com/w/index.php?title=File:Osgeo4w_qgis-ltr.PNG&amp;diff=15699"/>
		<updated>2018-04-20T13:51:03Z</updated>

		<summary type="html">&lt;p&gt;Par: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Par</name></author>
	</entry>
</feed>