tides-converter v3.2.3

Mercurial revision 5770:c90c3015e72d | 2026-05-22


Description

tides-converter is a tool designed to convert and interpolate structured tidal atlases. It supports various input and output formats, allowing users to transform tidal data into different representations, apply smoothing, and adjust grid parameters.


Usage

tides-converter input [OPTIONS]

Options

General Options

Option

Description

-h, --help

Display help and exit.

-cm

Input data is in centimeters instead of meters.

-mm

Input data is in millimeters instead of meters.

-Pa

Input data is in 0.0001 meters (e.g., for Pa units).

-bmg

Set output format to BMG.

-debug

Enable debug mode when reading topography or mask files.

-o <file>

Specify the output file name.


Input Options

Option

Description

-w <wave>

Targeted wave if the input contains multiple waves.

-f <format>

Input format: bmg, ascii, netcdf, got, tpxo, otis, dtu (equivalent to ascii), eot, osu, cst, or s2c. If not specified, the format is inferred from the file extension (.nc → netcdf, .asc → ascii, otherwise bmg).

-uv

Read 2 buffers from the atlas (e.g., for U and V components). Implies ascii input format.

-iv <var1> <var2>, --input-variables <var1> <var2>

Specify input variable names for amplitude and phase (default: Ha and Hg).

-ig <file>, --input-grid <file>

Input grid file. Defaults to the input file.

-igv <var>, --input-grid-variable <var>

Grid variable name in the input grid file. Defaults to the amplitude variable.


Output Grid Options

Option

Description

-xmin <value>, -xmax <value>, -ymin <value>, -ymax <value>

Grid span parameters in degrees. Default: input grid span.

-dx <value>, -dy <value>

Output resolution parameters. Supported units: d (degrees), m (minutes), ' (minutes), s (seconds), " (arcseconds). Default: Automatically determined to keep the number of points ≥ 1440,000.

-g <file>

Output grid file. Defaults to the input grid.

-v <var>

Grid variable name for the output grid.

`-z <name

resolution>`

-extend

Add one column to repeat the 0/360 longitude boundary.


Processing Options

Option

Description

-m <file>

Mask file to apply to the input data.

-b <file>

Topography file. Useful as an alternative to the mask file.

-s <value>

Smoothing factor in meters. Default: No smoothing.

-average

Use averaging interpolation (default: pointwise).

-pointwise

Use pointwise interpolation (default).

-deflate <level>

Set the compression level for NetCDF output.


Examples

Convert a NetCDF Atlas to BMG Format

tides-converter input.nc -f netcdf -bmg -o output.bimg

Convert an ASCII Atlas with Custom Variables

tides-converter input.asc -f ascii -iv Ha Hg -o output.nc

Interpolate to a New Grid

tides-converter input.nc -g new_grid.nc -dx 0.1 -dy 0.1 -o output.nc

Apply Smoothing to the Atlas

tides-converter input.nc -s 10000 -o smoothed_output.nc

Convert TPXO Format to NetCDF

tides-converter input_tpxo.nc -f tpxo -o output.nc

Use a Mask File

tides-converter input.nc -m mask.nc -o masked_output.nc

Convert with Averaging Interpolation

tides-converter input.nc -average -o averaged_output.nc

Convert a Multi-Wave Input for a Specific Wave

tides-converter input.nc -w M2 -o M2_output.nc

Convert Units from Centimeters to Meters

tides-converter input.nc -cm -o output_in_meters.nc

Environment Variables

tides-converter does not rely on specific environment variables. However, it uses standard system libraries (e.g., NetCDF, OpenMP) that may be influenced by their respective environment variables.


Notes

  1. Input Formats:

  • If the input file extension is .nc, the default format is netcdf.

  • If the extension is .asc, the default format is ascii.

  • Otherwise, the default format is bmg.

  1. Output Formats:

  • If -bmg is specified, the output will be in BMG format.

  • Otherwise, the output defaults to NetCDF unless another format is specified.

  1. Grid Handling:

  • If no output grid is specified (-g), the input grid is used.

  • Use -xmin, -xmax, -ymin, -ymax, -dx, and -dy to define a custom grid.

  1. Smoothing:

  • The smoothing factor (-s) is specified in meters and applies a spatial smoothing to the tidal data.

  1. Interpolation Modes:

  • -average: Uses averaging interpolation for smoother transitions.

  • -pointwise: Uses pointwise interpolation (default).

  1. Multi-Buffer Input:

  • Use -uv to read two buffers (e.g., for U and V components) from the atlas. This implies the ascii input format.


See Also