# 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 ```bash 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 ` | Specify the **output file name**. | --- ### **Input Options** | Option | Description | | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `-w ` | Targeted wave if the input contains multiple waves. | | `-f ` | 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 `, `--input-variables ` | Specify **input variable names** for amplitude and phase (default: `Ha` and `Hg`). | | `-ig `, `--input-grid ` | Input grid file. Defaults to the input file. | | `-igv `, `--input-grid-variable ` | Grid variable name in the input grid file. Defaults to the amplitude variable. | --- ### **Output Grid Options** | Option | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `-xmin `, `-xmax `, `-ymin `, `-ymax ` | Grid span parameters in **degrees**. Default: input grid span. | | `-dx `, `-dy ` | 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 ` | Output grid file. Defaults to the input grid. | | `-v ` | 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 ` | Mask file to apply to the input data. | | `-b ` | Topography file. Useful as an alternative to the mask file. | | `-s ` | Smoothing factor in **meters**. Default: No smoothing. | | `-average` | Use **averaging interpolation** (default: pointwise). | | `-pointwise` | Use **pointwise interpolation** (default). | | `-deflate ` | Set the **compression level** for NetCDF output. | --- ## Examples ### **Convert a NetCDF Atlas to BMG Format** ```bash tides-converter input.nc -f netcdf -bmg -o output.bimg ``` ### **Convert an ASCII Atlas with Custom Variables** ```bash tides-converter input.asc -f ascii -iv Ha Hg -o output.nc ``` ### **Interpolate to a New Grid** ```bash tides-converter input.nc -g new_grid.nc -dx 0.1 -dy 0.1 -o output.nc ``` ### **Apply Smoothing to the Atlas** ```bash tides-converter input.nc -s 10000 -o smoothed_output.nc ``` ### **Convert TPXO Format to NetCDF** ```bash tides-converter input_tpxo.nc -f tpxo -o output.nc ``` ### **Use a Mask File** ```bash tides-converter input.nc -m mask.nc -o masked_output.nc ``` ### **Convert with Averaging Interpolation** ```bash tides-converter input.nc -average -o averaged_output.nc ``` ### **Convert a Multi-Wave Input for a Specific Wave** ```bash tides-converter input.nc -w M2 -o M2_output.nc ``` ### **Convert Units from Centimeters to Meters** ```bash 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`. 2. **Output Formats:** - If `-bmg` is specified, the output will be in **BMG format**. - Otherwise, the output defaults to **NetCDF** unless another format is specified. 3. **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. 4. **Smoothing:** - The smoothing factor (`-s`) is specified in **meters** and applies a spatial smoothing to the tidal data. 5. **Interpolation Modes:** - `-average`: Uses averaging interpolation for smoother transitions. - `-pointwise`: Uses pointwise interpolation (default). 6. **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 - [`gridit-cdf`](https://www.comodo-ocean.fr/) (for grid manipulation) - [NetCDF Documentation](https://www.unidata.ucar.edu/software/netcdf/) - [BMG Format Documentation](https://www.comodo-ocean.fr/)