Assigning Bathymetry
Converting a 2dm file to gr3 or between gr3 or 2dm and shapefile
convert_mesh
Convert a mesh from one format to another. The format is decided by the extensions automatically.
convert_mesh [OPTIONS]
Options
- --input <input>
Required Input mesh file.
- --output <output>
Required Output mesh file.
- --crs <crs>
CRS string for the projection.
- -h, --help
Show this message and exit.
Assigning depths from prioritized DEMs
These tools are used by the preprocessor but also work with functions that can be used generically and consistently with SCHISM.
stacked_dem_fill
Fill node elevations in a .2dm SMS mesh or gr3 file using a prioritized list of DEMs.
usage: stacked_dem_fill [-h] [--elev2depth] [--fill FILL] filename demfile
Positional Arguments
- filename
name of 2dm or gr3 file
- demfile
file containing list of DEMs. These can be in any form that gdal accepts, which includes ESRI ascii format and GeoTiffs
Named Arguments
- --elev2depth
Convert elevation to depth by flipping sign. This is typical when using gr3 format, less so with 2dm.
Default:
False
- --fill
Fill value for areas not covered by supplied rasters.
Default:
2.0
Smoother for complex topography
Often it is necessary to incorporate inudated marshy areas where elevations are poorly sampled and contours are tortuous. The script contour_smooth.py uses minmax curvature flow (Malladi and Sethian) to impose a minimum length scale of change for contours, essentially unraveling the features that are most contorted.
contour_smooth
Uses the min-max curvature flow algorithm of Malladi and Sethian to simplify DEM topography.
The script requires a subcommand like: $ contour_smooth.py smooth The most basic subcommand is smooth. Given limited efficiency at the moment, the script is generally run on a small area and dumps intermediate points in the processing as numpy arrays so you can view the differences using the contour_smooth.py view subcommand.
You can get subject-specific help on a subcommand by typing: $ contour_smooth.py subcommand –help
contour_smooth [OPTIONS] COMMAND [ARGS]...
Options
- -h, --help
Show this message and exit.
save
Save dumped DEM based on .npy dump and the original DEM it came from.
contour_smooth save [OPTIONS]
Options
- -h, --help
Show this message and exit.
- --dumpfile <dumpfile>
Required Dump file from smoothing (npy format).
- --original <original>
Required Original DEM (GeoTiff).
- --outfile <outfile>
Required Output file that will be saved (GeoTiff format).
smooth
Smooth the input DEM.
contour_smooth smooth [OPTIONS]
Options
- -h, --help
Show this message and exit.
- --input <input>
Required Input file name, file in tiff format.
- --scales <scales>
Scales (in multiples of DEM side length) over which to smooth. The sequence [1,2,3,4] is an example, where the smoothing is gradually introduced at 10m, 20m, 30m and 40m for a 10m DEM.
- --nstep <nstep>
Number of pseudo time steps to resolve integration. Default is 40.
- --max_time <max_time>
Pseudo time representing final time step. Default is 4.0.
- --report_interval <report_interval>
Intermediate interval at which integration will be segmented and smoothed DEMs will be dumped. For example, if –max_time is 2.0 and –report_interval is 0.1, you will get 20 intermediate reports.
view
View two versions of the smoothed DEM based on their .npy dump.
contour_smooth view [OPTIONS] FILE0 FILE1
Options
- -h, --help
Show this message and exit.
- --levels <levels>
Contour levels.
- --vmin <vmin>
Minimum elevation in color bar.
- --vmax <vmax>
Maximum elevation in color bar.
Arguments
- FILE0
Required argument
- FILE1
Required argument
Optimizing depths for volume
A mesh draped over noisy bathymetry data does not necessarily represent important moments such as volumes and vertical face areas smoothly and realistically. To better represent these facets of the geometry, we compare the volumetric quantities that come from SCHISM shape functions (which are much like a TIN) to a higher order quadrature using the DEM with bilinear interpolation. The quadrature is more accurate, and also incorporates more sample points.
Perform grid optimization with a *.2dm SMS mesh or gr3 file. An optimized gr3 file with extension _opt.gr3 will be created if only one set of optimization parameter specified.
usage: grid_opt [-h] [--optfile OPTFILE] [--solver SOLVER]
filename demfile optparm
Positional Arguments
- filename
name of 2dm or gr3 file
- demfile
file containing list of DEMs. These can be in any form that gdal accepts, which includes ESRI ascii format and GeoTiffs
- optparm
file containing optimization parameters: damp, damp_shoreline, face_coeff, volume_coeff
Named Arguments
- --optfile
name for the gr3 file for the optimized results
- --solver
solver used for optimization, either L-BFGS-B (default) or lsqr
Default:
'L-BFGS-B'