topo_smooth v3.2.3¶
Mercurial revision 5827:6131e4c94bf4 | 2026-09-18
Description¶
topo_smooth is a tool designed to smooth bathymetry data (either globally or within a specified polygon) using median or LOESS filters. It allows for fine-tuning of depth values and scaling adjustments to refine the bathymetric surface.
Usage¶
topo_smooth [OPTIONS] -b <bathymetry_file>
Options¶
Input/Output Options¶
Option |
Description |
|---|---|
|
Display help and exit. |
|
Required. Path to the input bathymetry file. |
|
Output rootname (default: |
|
Output format: |
Filtering Options¶
Option |
Description |
|---|---|
|
Path to a closed polygon file defining the area where the filter will be applied. |
`–filter=[median |
loess]` |
|
Radius of the filter (in degrees). |
Depth Adjustment Options¶
Option |
Description |
|---|---|
|
Minimum depth for filtered bathymetry (default: |
|
Maximum depth for filtered bathymetry (default: |
|
Invert depth/altitude on the selected area. Equivalent to |
|
Scale factor to apply on the selected area and smooth edges to merge with surroundings. |
Note:
-invand-scalecannot be used together. The last one specified will override the previous.
Examples¶
Basic Smoothing with LOESS Filter¶
Smooth the entire bathymetry file using the default LOESS filter:
topo_smooth -b bathymetry.grd
Smooth a Specific Polygon Area¶
Apply LOESS smoothing to a specific polygon area:
topo_smooth -b bathymetry.grd -p polygon.txt -r 0.1
Smooth with Median Filter¶
Use the median filter for smoothing:
topo_smooth -b bathymetry.grd --filter=median -r 0.05
Set Depth Range for Smoothing¶
Smooth only depths between -1000 and -100 meters:
topo_smooth -b bathymetry.grd -zmin -1000 -zmax -100
Invert Depth Values¶
Invert depth/altitude values in the selected area:
topo_smooth -b bathymetry.grd -p polygon.txt -inv
Scale Depth Values¶
Apply a scale factor of 1.5 to the selected area:
topo_smooth -b bathymetry.grd -p polygon.txt -scale 1.5
Custom Output Format and Rootname¶
Save the smoothed bathymetry in xyz format with a custom rootname:
topo_smooth -b bathymetry.grd -o smoothed_bathy -f xyz
Combine Filtering and Depth Range¶
Apply a median filter with a radius of 0.2 degrees and restrict smoothing to depths between -2000 and -50:
topo_smooth -b bathymetry.grd --filter=median -r 0.2 -zmin -2000 -zmax -50
Environment Variables¶
topo_smooth does not rely on specific environment variables. However, ensure your system has sufficient memory and disk space for large bathymetry files.
Notes¶
Input File:
The
-boption is mandatory to specify the input bathymetry file.
Polygon File:
The polygon file (
-p) must define a closed polygon (e.g., a shapefile or ASCII file with coordinates).
Filter Selection:
The default filter is LOESS. Use
--filter=medianto switch to median filtering.
Depth Range:
The
-zminand-zmaxoptions define the depth range for filtering. Values outside this range will not be smoothed.
Scaling and Inversion:
-invand-scaleare mutually exclusive. The last one specified will override the other.-invis equivalent to-scale -1.
Output:
If no output rootname (
-o) is provided, the default isout.Supported output formats:
grd,grd-float,nectdf,xyz.
Deprecated Options:
Previously, adding a file to the command without options was interpreted as a trusted bathymetry file for outlier removal. This is no longer supported.
See Also¶
NetCDF Tools (for
nectdfformat)Generic Mapping Tools (GMT) (for
grdandxyzformats)