ASC to ASC: Difference between revisions

Content deleted Content added
Line 97:
==Convert==
'''"-conv"'''<br>
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.<br>
ExampleExamples:<br>
<ol>
<li><tt>asc_to_asc.exe -conv *.flt</tt><br>
<li>Converts all .flt grids to .asc format.<br>
<tt>asc_to_asc.exe -conv *.flt</tt>
<br>
<li><tt>asc_to_asc.exeConverts -convthe file "DEM_M01.asc</tt>" for .flt format.<br>
Converts<tt>asc_to_asc.exe the-conv file "DEM_M01.asc" for .flt format.</tt>
</ol>
 
==Maximum==
Line 109 ⟶ 110:
Determines the maximum value in all the input .asc files. Two output grids are created:<br>
*A numerical grid containing the maximum value.<br>
*A classified grid with the name _src.asc which contains the source grid for the maximum value.<br>
Examples:<br>
<li><tt>asc_to_asc.exe -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc</tt><br>
<ol>
Creates a new grid containing the maximum of the 3 input water level grids.</li>
<li>Creates a new grid containing the maximum of the 3 input water level grids.<br>
<li><tt>asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc</tt><br>
<tt>asc_to_asc.exe -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc</tt><br>
As per item 2 above, but specifies the output name "Q100_Max_Levels.asc".</li>
<li>As per item 2 above, but specifies the output name "Q100_Max_Levels.asc".<br>
<li><tt>asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_*min_h.asc</tt><br>
<tt>asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc</tt><br>
Wildcard character "*" is supported in filenames.</li><br>
<li>Wildcard character "*" is supported in filenames.<br>
<tt>asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_*min_h.asc</tt>
</ol>
 
==Difference==
Line 122 ⟶ 126:
Two .asc grids are output:
*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.
*A second grid with a “_wd” suffix is output to indicate which .asc grid cells were once wet and are now dry (value -99) or once dry and are now wet (value +99 with first .asc to be the developed case and second .asc to be the existing case). 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.<br>
Example:
<li><tt>asc_to_asc.exe -out difference.asc -dif after_h.asc before_h.asc</tt><br>
<ol>
Creates new grids comparing the differences in flood levels and extents for: "difference.asc" = "after_h.asc" - "before_h.asc"</li>
<li>Creates new grids comparing the differences in flood levels and extents for: "difference.asc" = "after_h.asc" - "before_h.asc"<br>
<tt>asc_to_asc.exe -out difference.asc -dif after_h.asc before_h.asc</tt>
</ol>
Secondary options (only one can be used):
*"-nowetdry" does not carry out a wet/dry test. If both cells are active a difference is calculated.
Line 134 ⟶ 141:
*If only one grid is specified this grid is processed.<br>
*If two grids are specified, the first value is used for setting the cutoff depth and the values from the second grid are processed.<br>
*If three grids are specified, the third grid is used for setting the filename for the output grid. This is ignored if the "-out" option is used.<br>
Examples:
<li><tt>asc_to_asc.exe -cd0.1 depth.asc</tt><br>
<ol>
Creates a new depth grid only where the depth is greater than 0.1m.</li>
<li>Creates a new depth grid only where the depth is greater than 0.1m.<br>
<li><tt>asc_to_asc.exe -cd0.1 depth.asc levels.asc</tt><br>
<tt>asc_to_asc.exe -cd0.1 depth.asc</tt>
Creates a new level grid only where the depth is greater than 0.1m.</li>
<li>Creates a new level grid only where the depth is greater than 0.1m.<br>
<li><tt>asc_to_asc.exe -cd0.1 -out filtered_levels.asc depths.asc levels.asc</tt><br>
<tt>asc_to_asc.exe -cd0.1 depth.asc levels.asc</tt>
As per the example above, but sets the output name as "filtered_levels.asc".</li>
<li>As per the example above, but sets the output name as "filtered_levels.asc".<br>
<tt>asc_to_asc.exe -cd0.1 -out filtered_levels.asc depths.asc levels.asc</tt>
</ol>
 
==Resize==
Line 146 ⟶ 156:
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:
===Average (default)===
This is the defualt processing method, which can also be specified with the '''-rm_avg''' (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.<br>
Example:
<li><tt>asc_to_asc.exe -resize5 -out DEM_10m.asc DEM_2m.asc</tt><br>
<ol>
Creates a new 10m DEM (DEM_10m.asc) based on the the 2m DEM using an averaging approach.</li>
<li>Creates a new 10m DEM (DEM_10m.asc) based on the the 2m DEM using an averaging approach.<br>
<tt>asc_to_asc.exe -resize5 -out DEM_10m.asc DEM_2m.asc</tt>
</ol>
 
===Minimum===
Alternative processing method for resize, specified with the '''-rm_min''' (resize method - minimum) flag. At each output grid the values is the minimum of the values in the input grid.<br>
Example:
<li><tt>asc_to_asc.exe -resize5 -rm_min -out DEM_10m_min.asc DEM_2m.asc</tt><br>
<ol>
Creates a new 10m DEM (DEM_10m_min.asc) based on the the 2m DEM using an minimum approach.</li>
<li>Creates a new 10m DEM (DEM_10m_min.asc) based on the the 2m DEM using an minimum approach.<br>
<tt>asc_to_asc.exe -resize5 -rm_min -out DEM_10m_min.asc DEM_2m.asc</tt>
</ol>
 
===Maximum===
Alternative processing method for resize, specified with the '''-rm_max''' (resize method - maximum) flag. At each output grid the values is the maximum of the values in the input grid.<br>
Example:
<li><tt>asc_to_asc.exe -resize5 -rm_max -out DEM_10m_max.asc DEM_2m.asc</tt><br>
<ol>
Creates a new 10m DEM (DEM_10m_max.asc) based on the the 2m DEM using an maximum approach.</li>
<li>Creates a new 10m DEM (DEM_10m_max.asc) based on the the 2m DEM using an maximum approach.<br>
<tt>asc_to_asc.exe -resize5 -rm_max -out DEM_10m_max.asc DEM_2m.asc</tt>
</ol>
 
==Transform==
Transforms the values using a simple y = mx + c approach the multiplier (m) is specified with flag '''-trans_m<value>'''. The add value (c)'''-trans_c<value>'''. Only one values is required to be specified.<br>
Examples:
<li><tt>asc_to_asc.exe -trans_m0.3048 DEM.asc</tt><br>
<ol>
Multiplies all values by 0.3048.</li>
<li>Multiplies all values by 0.3048.<br>
<li><tt>asc_to_asc.exe -trans_m0.3048 -trans_c10 DEM.asc</tt><br>
<tt>asc_to_asc.exe -trans_m0.3048 DEM.asc</tt>
Multiplies all values by 0.3048 and then adds 10.0.</li><br>
<li>Multiplies all values by 0.3048 and then adds 10.0.<br>
<tt>asc_to_asc.exe -trans_m0.3048 -trans_c10 DEM.asc</tt>
</ol>
 
==Decimal==
Converts .flt to .asc format with specified number of decimal spaces. ASC format created directly from TUFLOW comes only with three decimal spaces, FLT format has more decimal spaces.<br>
Example:
<li><tt>asc_to_asc.exe -conv -decimal5 *.flt</tt><br>
<ol>
Converts all .flt grids to .asc format with 5 decimal spaces.
<li>Converts all .flt grids to .asc format with 5 decimal spaces.<br>
<tt>asc_to_asc.exe -conv -decimal5 *.flt</tt>
</ol>
 
==Classify==
Line 183 ⟶ 210:
|2.0|| 1.0 to 2.0
|}
<br>
 
Examples:
<li><tt>asc_to_asc.exe -classify classifications.csv results_VMax.asc</tt><br>
<ol>
Outputs a classified grid, based on the cut off values and names in the "classifications.csv".</li><br>
<li>Outputs a classified grid, based on the cut off values and names in the "classifications.csv".<br>
 
<tt>asc_to_asc.exe -classify classifications.csv results_VMax.asc</tt>
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.<br>
<br>
<li><tt>asc_to_asc.exe -RGB -grc -classify depth_classify.csv results_dMax.asc</tt><br>
<li>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.<br>
<tt>asc_to_asc.exe -RGB -grc -classify depth_classify.csv results_dMax.asc</tt><br>
 
{| class="wikitable"
Line 203 ⟶ 232:
|-
|2.0|| 1.0 to 2.0 || 0 || 0 || 64
|}<br>
 
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.<br>
<br>
 
[[File:TUFLOW Utilities GRC01.jpeg|600px]]<br>
<br>
</ol>
 
==Extract Breaklines from DEM==
Line 218 ⟶ 249:
* If the width is greater than 1.5 times the DEM cell size, at each vertex a buffer region (search radius) 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, if '''"-check"''' switch is specified in the batch command.<br>
If a '''dz''' value is specified this can be used to control the spacing of vertices along the line. If a '''dz''' 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.<br>
'''NOTE:''' For the output GIS file, the '''dz''' attribute is set to 0.0 regardless of the value set in the input field. <br>
<li><tt>asc_to_asc.exe -brkline 2d_zsh_breaklines_L.shp DEM.asc</tt><br>
<br><br>
 
==Fuzzy Map==
Line 227 ⟶ 259:
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.<br>
This can be useful for quantifying the sensitivity of the model to parameters.<br>
Examples:
<li><tt>asc_to_asc.exe -fuzzy *_d_Max.flt</tt><br>
<ol>
Create a fuzzy map from all maximum depth grids in the directory.
<li>Create a fuzzy map from all maximum depth grids in the directory.<br>
<tt>asc_to_asc.exe -fuzzy *_d_Max.flt</tt>
</ol>
 
==Histogram==
Line 275 ⟶ 310:
|Above 5.0|| Above 5.0 || 973 || 0.06
|}
<li><tt>asc_to_asc_w64.exe –histogram histogram_bins.csv results_d_Max.asc</tt></li>
<br><br>
 
==Extract 1D Model Inputs==
Line 364 ⟶ 400:
|FLC per Unit Length == <form loss per unit length> || The form loss per unit length is written to the "exit_loss" attribute of all 1d_nwk channels.
|}
<li><tt>asc_to_asc.exe -egc MR_1d_001.egc</tt><br>
<br>
An example .egc file is:<br>
<pre>
Line 390 ⟶ 427:
The input GIS region file should have the same attributes as the 1d_tab file format produced by TUFLOW. The first attribute ("Source" ) should contain a valid .csv file name.<br>
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 "Skew" attribute of the GIS region.<br>
<li><tt>asc_to_asc.exe -na 1d_na_storgae_R.shp DEM_1m.flt</tt><br>
 
==Calibration Points==
Line 401 ⟶ 438:
'''"-cpmm<mm>"''' (optional)<br>
The second search radius used to search for maximum and minimum values in meters.<br>
<li><tt>asc_to_asc.exe -cp Flood_Marks.MIF -config diff_config.csv -cpsd100 -cpmm50 results_h_Max.asc</tt><br>
 
==Statistics==
Line 427 ⟶ 464:
* A value grid: the resulting median value
* 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)<br>
<li><tt>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</tt><br>
[[File: asc_to_asc_statsMedian_eg.PNG|1000px|]]<br>
 
<tt>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</tt><br>
 
[[File: asc_to_asc_statsMedian_eg.PNG|1000px|]]<br>
<br>
Note, the median value for that cell was dry (a 'NULL') value, then the output would be dry. For example, 7 out of the 10 inputs are dry at a particular location. Once they are ordered them (with NULL showing at the lowest), then the median value for this cell is 'NULL' (dry) and the source would be 8, as shown below. Therefore, at this location you would see a dry cell in the median output, and '8' in the source grid output.
<br>
Line 440 ⟶ 479:
* A value grid: the resulting value
* 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)<br>
<li><tt>asc_to_asc.exe -statMean Q100_30min_*_h.asc</tt><br><br>
 
==="-statFrac"===
Line 448 ⟶ 487:
The utility outputs one grid:
* A Frac grid: the resulting Fraction value<br>
<li><tt>asc_to_asc.exe -statFrac Q100_30min_*_h.asc</tt><br><br>
 
==="-statMin"===
Line 457 ⟶ 496:
* A value grid: the resulting value
* 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)<br>
<li><tt>asc_to_asc.exe -statMin Q100_30min_*_h.asc</tt><br><br>
 
==="-statMax"===
Line 466 ⟶ 505:
* A value grid: the resulting value
* 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)<br>
<li><tt>asc_to_asc.exe -statMax Q100_30min_*_h.asc</tt><br><br>
 
==="-statAll"===
Line 476 ⟶ 515:
* An SRC grid: for the median, mean, min and max calculations (calculation of source grids as detailed above)
* A .csv file that contains the legend for all SRC grids<br>
<li><tt>asc_to_asc.exe -statAll Q100_30min_*_h.asc</tt><br><br>
 
==="-statRank<integer id>"===
Line 485 ⟶ 524:
* A value grid: the resulting value
* 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)<br>
<li><tt>asc_to_asc.exe -statRank5 Q100_30min_*_h.asc</tt><br><br>
 
==Flood Extent==
Returns a simple grid with value of 1 where the input grid has an active, non-zero value.<br>
<li><tt>asc_to_asc.exe -fe results_dMax.asc</tt><br>
 
==Remap==
Line 498 ⟶ 537:
Sets the finer resolution DEM.<br>
The default interpolation method is TIN. But "-idw_npt<number of points>" flag can be used to change the interpolation method to IDW and set the number of points used for IDW interpolation (default is 12).<br>
<ol>
<li><tt>asc_to_asc.exe -remap -wl lowres_h.asc -dem DEM_highres.asc</tt><br>
<li>The utility can also remap additional map output grids (e.g. velocity, hazard and others) to the resolution of the DEM file, e.g.<br>
<li><tt>asc_to_asc.exe -remap -wl lowres_h.asc -dem DEM_highres.asc lowres_v.asc lowres_hazard.asc</tt><br>
<li>The utility can also apply a buffer distance or add freeboard. For example, the below applies a buffer distance of 20m, and adds a freeboard of 0.2m to the original water level grid.<br>
<li><tt>asc_to_asc.exe -remap -fb0.2 -bd20 -wl lowres_h.asc -dem DEM_highres.asc lowres_v.asc lowres_hazard.asc</tt><br>
<li><tt>asc_to_asc.exe -remap -fb0.2 -bd20 -wl lowres_h.asc -dem DEM_highres.asc</tt>
<br>
</ol>
Note that, for any output types other than depth, this utility does NOT interpolate the result from the coarser grid to the finer grid, but only extends/reduces the output extent to the dry/wet extent. More discussions on this function is documented here [[TUFLOW_Remapping | TUFLOW Remapping Tool]].<br><br>
 
Note that, for any output types other than depth, this utility does NOT interpolate the result from the coarser grid to the finer grid, but only extends/reduces the output extent to the dry/wet extent. More discussions on this function is documented here [[TUFLOW_Remapping | TUFLOW Remapping Tool]].<br>
 
=Other Options (switches)=