mesh2node v3.2.3¶
Mercurial revision 5786:5c8b45563631 | 2026-08-04
Description¶
mesh2node performs nearest-neighbor interpolation of simulation outputs from a full mesh onto another grid’s nodes. It is useful for extracting data from a high-resolution mesh to specific points or nodes defined in a separate grid file.
Usage¶
mesh2node [OPTIONS] file
Options¶
Option |
Description |
|---|---|
|
Display this help message and exit. |
|
Mesh file: Path to the input mesh file (required). |
|
Node file: Path to the input node file (required). |
|
Mask value: Value to use for masked (invalid) data points. |
Deprecated Options
Option
Description
-z <zone>Pre-set zone to limit the interpolation area. This option is deprecated and no longer supported.
Examples¶
Basic Interpolation¶
Interpolate data from input.s2r using mesh.nc and nodes.nc:
mesh2node -m mesh.nc -n nodes.nc input.s2r
Interpolate with Custom Mask Value¶
Use a mask value of -999.9 for invalid points:
mesh2node -m mesh.nc -n nodes.nc -s -999.9 input.s2r
Interpolate Vector Data (V2R Format)¶
Interpolate vector data (e.g., velocity components) from input.v2r:
mesh2node -m mesh.nc -n nodes.nc input.v2r
Interpolate Complex Data (S2C Format)¶
Interpolate complex harmonic constants (e.g., tidal elevation) from input.s2c:
mesh2node -m mesh.nc -n nodes.nc input.s2c
Interpolate Complex Vector Data (V2C Format)¶
Interpolate complex vector data (e.g., tidal currents) from input.v2c:
mesh2node -m mesh.nc -n nodes.nc input.v2c
Environment Variables¶
mesh2node does not rely on specific environment variables. However, ensure your system has sufficient resources (memory, CPU) for large mesh or node files.
Notes¶
Input Files:
The mesh file (
-m) and node file (-n) are required for interpolation.Supported input file formats:
.s2r,.s2c,.v2r,.v2c.
Output:
The output file is automatically named as
<input_file>.extraction.For example, if the input file is
data.s2r, the output will bedata.s2r.extraction.
Masking:
The
-soption sets the value for masked (invalid) data points. The default mask value is999.9.Masked values are assigned to nodes that fall outside the mesh or cannot be interpolated.
Interpolation Method:
Uses linear interpolation within the mesh elements to estimate values at the target nodes.
If a node falls outside the mesh, the mask value is assigned.
Performance:
For large meshes or node files, ensure sufficient memory is available.
The tool is optimized for nearest-neighbor interpolation and may not be suitable for high-order interpolation schemes.
See Also¶
NetCDF Tools (for handling mesh and node files)
Mog2D Simulation Tools (for related simulation outputs)