Bay-Delta SELFE Tools

Table Of Contents

Previous topic

Model time conversion

Next topic

Post-processing

Assigning bathymetry

Converting a 2dm file to gr3

Convert a *.2dm SMS mesh to a *.gr3 SELFE mesh.

usage: sms2gr3 [-h] [--elev2depth] [--outfile OUTFILE] infile
Positional arguments:
infile name of input file
Options:
--elev2depth=False
 SMS geometry is in terms of elevation and should be flipped in sign.
--outfile name of output file

Assigning depths from prioritized DEMs

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] 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
Options:
--elev2depth=False
 Convert elevation to depth by flipping sign. This is typical when using gr3 format, less so with 2dm.

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 min-max curvature flow (Malladi and Sethian) to impose a minimum length scale of change for contours, essentially unraveling the features that are most contorted. This script will be released soon.

Optimizing depths for volume

A mesh draped over noisy bathymetry data does not necessarily represent important moments (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’s 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] [--detailed_outputs]
                [--prefix PREFIX] [--boundary_list BOUNDARY_LIST]
                [--remove_boundary_faces] [--polygon_file POLYGON_FILE]
                [--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
Options:
--optfile= name for the gr3 file for the optimized results
--detailed_outputs=False
 whether to write detailed optimization results to files, default=False
--prefix= prefix used for output files when –detailed_outputs flag is set
--boundary_list=
 boundary node list information (in csv format) when missing from .2dm or .gr3 file, generated from Kijins script
--remove_boundary_faces=False
 whether to remove faces along the land boundaries, default=False
--polygon_file=None
 polygon definition file used to specify the area for partial grid optimization
--solver=L-BFGS-B
 solver used for optimization, either L-BFGS-B (default) or lsqr