ASC to ASC: Difference between revisions

Content deleted Content added
Line 108:
*A classified grid with the name _src.asc which contains the source grid for the maximum value.<br>
Examples:<br>
*Creates a new grid containing the maximum of the 3 input water level grids.<br>
<ol>
:<tt>asc_to_asc.exe -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc</tt><br>
<li>Creates a new grid containing the maximum of the 3 input water level grids.<br>
*As per item 2 above, but specifies the output name "Q100_Max_Levels.asc".<br>
<tt>asc_to_asc.exe -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_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>
<li>As per item 2 above, but specifies the output name "Q100_Max_Levels.asc".<br>
*Wildcard character "*" is supported in filenames.<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>
:<tt>asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_*min_h.asc</tt>
<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 124 ⟶ 122:
*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:
*Creates new grids comparing the differences in flood levels and extents for: "difference.asc" = "after_h.asc" - "before_h.asc"<br>
<ol>
:<litt>Createsasc_to_asc.exe new-out grids comparing the differences in flood levels and extents for: "difference.asc" =-dif "after_h.asc" - "before_h.asc"<br/tt>
 
<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 139 ⟶ 136:
*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:
*Creates a new depth grid only where the depth is greater than 0.1m.<br>
<ol>
:<tt>asc_to_asc.exe -cd0.1 depth.asc</tt>
<li>Creates a new depth grid only where the depth is greater than 0.1m.<br>
*Creates a new level grid only where the depth is greater than 0.1m.<br>
<tt>asc_to_asc.exe -cd0.1 depth.asc</tt>
:<tt>asc_to_asc.exe -cd0.1 depth.asc levels.asc</tt>
<li>Creates a new level grid only where the depth is greater than 0.1m.<br>
*As per the example above, but sets the output name as "filtered_levels.asc".<br>
<tt>asc_to_asc.exe -cd0.1 depth.asc levels.asc</tt>
:<tt>asc_to_asc.exe -cd0.1 -out filtered_levels.asc depths.asc levels.asc</tt>
<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 154 ⟶ 149:
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:
*Creates a new 10m DEM (DEM_10m.asc) based on the the 2m DEM using an averaging approach.<br>
<ol>
:<tt>asc_to_asc.exe -resize5 -out DEM_10m.asc DEM_2m.asc</tt>
<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:
*Creates a new 10m DEM (DEM_10m_min.asc) based on the the 2m DEM using an minimum approach.<br>
<ol>
:<litt>Createsasc_to_asc.exe a-resize5 new-rm_min 10m-out DEM (DEM_10m_min.asc) based on the the 2m DEM using an minimum approachDEM_2m.asc<br/tt>
<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:
*Creates a new 10m DEM (DEM_10m_max.asc) based on the the 2m DEM using an maximum approach.<br>
<ol>
:<litt>Createsasc_to_asc.exe a-resize5 new-rm_max 10m-out DEM (DEM_10m_max.asc) based on the the 2m DEM using an maximum approachDEM_2m.asc<br/tt>
<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:
*Multiplies all values by 0.3048.<br>
<ol>
:<litt>Multipliesasc_to_asc.exe all values by 0-trans_m0.3048 DEM.asc<br/tt>
*Multiplies all values by 0.3048 and then adds 10.0.<br>
<tt>asc_to_asc.exe -trans_m0.3048 DEM.asc</tt>
:<tt>asc_to_asc.exe -trans_m0.3048 -trans_c10 DEM.asc</tt>
<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:
*Converts all .flt grids to .asc format with 5 decimal spaces.<br>
<ol>
:<tt>asc_to_asc.exe -conv -decimal5 *.flt</tt>
<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 206 ⟶ 191:
|2.0|| 1.0 to 2.0
|}
 
<br>
Examples:
*Outputs a classified grid, based on the cut off values and names in the "classifications.csv".<br>
<ol>
:<tt>asc_to_asc.exe -classify classifications.csv results_VMax.asc</tt>
<li>Outputs a classified grid, based on the cut off values and names in the "classifications.csv".<br>
*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 -classify classifications.csv results_VMax.asc</tt>
:<tt>asc_to_asc.exe -RGB -grc -classify depth_classify.csv results_dMax.asc</tt><br>
<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"
 
! style="background-color:#005581; font-weight:bold; color:white;" width=20% | Cutoff Value
Line 234 ⟶ 217:
[[File:TUFLOW Utilities GRC01.jpeg|600px]]<br>
<br>
</ol>
 
==Extract Breaklines from DEM==
Line 247 ⟶ 229:
'''NOTE:''' For the output GIS file, the '''dz''' attribute is set to 0.0 regardless of the value set in the input field. <br>
Example:
*<tt>asc_to_asc.exe -brkline 2d_zsh_breaklines_L.shp DEM.asc</tt>
<ol>
<li><tt>asc_to_asc.exe -brkline 2d_zsh_breaklines_L.shp DEM.asc</tt>
<br>
</ol>
 
==Fuzzy Map==
Line 258 ⟶ 237:
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>
Example:
Examples:
*Create a fuzzy map from all maximum depth grids in the directory.<br>
<ol>
:<tt>asc_to_asc.exe -fuzzy *_d_Max.flt</tt>
<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 268 ⟶ 245:
This feature was added to the 2014-03-AB version of the utility.<br>
Calculates the number of cells and percentage of cells that fall in each range. Requires and input .csv file containing the bin values.<br>
Examples:
An example inputs bin file is:<br>
*An example inputs bin file is:<br>
{| class="wikitable"
:{| class="wikitable"
 
! style="background-color:#005581; font-weight:bold; color:white;"| Bin
Line 287 ⟶ 265:
|}
 
*An example output looks like the below:
:{| class="wikitable"
 
! style="background-color:#005581; font-weight:bold; color:white;"| Bin
Line 309 ⟶ 287:
|Above 5.0|| Above 5.0 || 973 || 0.06
|}
*Example usage:
<tt>asc_to_asc_w64.exe –histogram histogram_bins.csv results_d_Max.asc</tt>
:<tt>asc_to_asc_w64.exe –histogram histogram_bins.csv results_d_Max.asc</tt>
<br><br>
 
==Extract 1D Model Inputs==
Line 399 ⟶ 377:
|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.
|}
Example usage:
<tt>asc_to_asc.exe -egc MR_1d_001.egc</tt>
*<tt>asc_to_asc.exe -egc MR_1d_001.egc</tt>
<br>
 
An example .egc file is:<br>
<pre>
Line 426 ⟶ 405:
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>
Example usage:
<tt>asc_to_asc.exe -na 1d_na_storage_R.shp DEM_1m.flt</tt><br>
*<tt>asc_to_asc.exe -na 1d_na_storage_R.shp DEM_1m.flt</tt>
 
==Calibration Points==
Line 437 ⟶ 417:
'''"-cpmm<mm>"''' (optional)<br>
The second search radius used to search for maximum and minimum values in meters.<br>
Example usage:
<tt>asc_to_asc.exe -cp Flood_Marks.MIF -config diff_config.csv -cpsd100 -cpmm50 results_h_Max.asc</tt><br>
*<tt>asc_to_asc.exe -cp Flood_Marks.MIF -config diff_config.csv -cpsd100 -cpmm50 results_h_Max.asc</tt><br>
 
==Statistics==
 
<big>'''"-stat<type>"'''</big>
 
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.
 
Line 455 ⟶ 434:
 
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.<br>
<br/>
==="-statMedian"===
 
==="-statMedian"===
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 as low e.g. Rank1, Rank2 and so on).
 
Line 463 ⟶ 441:
* 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>
Example usage:
 
*<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>
Line 474 ⟶ 452:
 
==="-statMean"===
 
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:
* 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>
Example usage:
<tt>asc_to_asc.exe -statMean Q100_30min_*_h.asc</tt><br><br>
*<tt>asc_to_asc.exe -statMean Q100_30min_*_h.asc</tt><br>
 
==="-statFrac"===
 
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.
 
The utility outputs one grid:
* A Frac grid: the resulting Fraction value<br>
Example usage:
<tt>asc_to_asc.exe -statFrac Q100_30min_*_h.asc</tt><br><br>
*<tt>asc_to_asc.exe -statFrac Q100_30min_*_h.asc</tt><br>
 
==="-statMin"===
 
The -statMin flag outputs the minimum value at each grid cell from all the input grids.
 
Line 495 ⟶ 472:
* 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>
Example usage:
<tt>asc_to_asc.exe -statMin Q100_30min_*_h.asc</tt><br><br>
*<tt>asc_to_asc.exe -statMin Q100_30min_*_h.asc</tt><br>
 
==="-statMax"===
 
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.
 
Line 504 ⟶ 481:
* 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>
Example usage:
<tt>asc_to_asc.exe -statMax Q100_30min_*_h.asc</tt><br><br>
*<tt>asc_to_asc.exe -statMax Q100_30min_*_h.asc</tt><br>
 
==="-statAll"===
 
The -statAll flag undertakes and creates results for all the statistic operations mentioned above.
 
Line 514 ⟶ 491:
* 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>
Example usage:
<tt>asc_to_asc.exe -statAll Q100_30min_*_h.asc</tt><br><br>
*<tt>asc_to_asc.exe -statAll Q100_30min_*_h.asc</tt><br>
 
==="-statRank<integer id>"===
 
The -statRank<integer> flag outputs the ''n<integer>'' 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 as low e.g. Rank1, Rank2 and so on). 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 ''Min'', -statRank10 is equivalent to ''Max'', and -statRank6 is equivalent to ''Median''. The Rank flag allows additional functionality that lets users extract results in between those that are pre-programmed.
 
Line 523 ⟶ 500:
* 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>
Example usage:
<tt>asc_to_asc.exe -statRank5 Q100_30min_*_h.asc</tt><br><br>
*<tt>asc_to_asc.exe -statRank5 Q100_30min_*_h.asc</tt><br>
 
==Flood Extent==
Returns a simple grid with value of 1 where the input grid has an active, non-zero value.<br>
Example usage:
<tt>asc_to_asc.exe -fe results_dMax.asc</tt><br>
*<tt>asc_to_asc.exe -fe results_dMax.asc</tt><br>
 
==Remap==
Line 536 ⟶ 515:
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>
Examples:
<ol>
<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>
:<tt>asc_to_asc.exe -remap -wl lowres_h.asc -dem DEM_highres.asc</tt>
<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>
:<tt>asc_to_asc.exe -remap -wl lowres_h.asc -dem DEM_highres.asc lowres_v.asc lowres_hazard.asc</tt>
<li>:<tt>asc_to_asc.exe -remap -fb0.2 -bd20 -wl lowres_h.asc -dem DEM_highres.asc</tt>
</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>