ASC to ASC

From Tuflow
Revision as of 10:25, 10 September 2011 by tuflow>Par (Created page with "=Introduction= asc_to_asc.exe is a utility used for generating the difference between two .asc (ESRI ASCII grid) files. <br> This utility is useful for comparing and processing T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

asc_to_asc.exe is a utility used for generating the difference between two .asc (ESRI ASCII grid) files.
This utility is useful for comparing and processing TUFLOW outputs from different .2dm meshes, which can;t be compared with the dat_to_dat.exe.
The input grids are generally processed using the TUFLOW_to_GIS utility described here. Both .asc files must be of the same row/column dimensions.

Options (switches

A list of the available switches is provided in the table below:

Switch Description
"-b" 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.
"-dif" 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.

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 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.
"-out <output grid name>" Specify the output filename for the new grid. This overwrites the a third grid if using the -dif option described above.
Note: a space is required between the -out and the filename.
"-max" Determines the maximum value in all the input .asc files. Two output grids are created:
  • A numerical grid containing the maximum value.
  • A classified grid with the name _src.asc which contains the source grid for the maximum value.
"-cd<cutoff value>" Outputs a new file only where the value is greater than the cutoff value.
  • If only one grid is specified this grid is processed.
  • If two grids are specified, the first value is used for setting the cutoff depth and the second grid is processed.
  • 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.

Examples

    Difference Examples

  1. asc_to_asc.exe -out difference.asc -dif after_h.asc before_h.asc
    Creates new grids comparing the differences in flood levels and extents for:
    "difference.asc" = "after_h.asc" - "before_h.asc"

  2. Maximum Example

  3. asc_to_asc.exe -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc
    Creates a new grid containing the maximum of the 3 input water level grids.
  4. asc_to_asc.exe -out Q100_Max_Levels.asc -max Q100_30min_h.asc Q100_45min_h.asc Q100_60min_h.asc
    As per item 2 above, but specifies the output name "Q100_Max_Levels.asc".

  5. Cutoff Value Examples

  6. asc_to_asc.exe -cd0.1 depth.asc
    Creates a new depth grid only where the depth is greater than 0.1m.

  7. asc_to_asc.exe -cd0.1 depth.asc. levels.asc
    Creates a new level grid only where the depth is greater than 0.1m.

  8. asc_to_asc.exe -cd0.1 -out filtered_levels.asc. depths.asc levels.asc
    As per Example 3, but outputs to "filtered_levels.asc".