ocmw.domain.bathyTools module

Bathymetry manipulation tools.

load_bathy

Load bathymetry data from ASCII .xyz or.csv files, or netCDF files

interp_bathy

Interpolation of bathymetry data onto nodel nodes.

Bathymetry manipulation tools.

Chris Old IES, School of Engineering, University of Edinburgh Nov 2023

ocmw.domain.bathyTools.load_bathy(bathyfile, boffsets=[0.0, 0.0, 0.0])[source]

Load bathymetry data from ASCII .xyz or.csv files, or netCDF files

Parameters:
  • bathyfile (str) – Full path and name to the bathymery data file.

  • boffsets (list, float, optional) – Translation offsets if required. The default is [0.0,0.0,0.0].

Returns:

bathy (TYPE) – DESCRIPTION.

ocmw.domain.bathyTools.bathy_msl_offset(bathyfile, offset, outfile, delimiter=',', headerSkip=0)[source]

Function for adding MSL correction to ASCII bathymetr data. Currently only works for *.xyz and *.csv files.

Parameters:
  • bathyfile (str) – Full path and filename of ASCII bathymetry data file.

  • offset (float) – Offset in m to be applied to correct bathymetry data to MSL.

  • outfile (str) – Full path and filename of output data file for corrected bathymetry.

  • delimiter (str, optional) – Delimiter used in ASCII file. The default is ‘,’.

  • headerSkip (int, optional) – Number of header lines to copy and skip. The default is 0.

Returns:

None.

ocmw.domain.bathyTools.interp_bathy(nodes, bathy, radius)[source]

Interpolation of bathymetry data onto nodel nodes.

Parameters:
  • nodes (numpy.ndarray, float) – Mesh node coordinates [x,y].

  • bathy (numpy.ndarray, float) – Bathyemtry data [x,y,z].

  • radius (float) – Radius of influence for interpolation.

Returns:

z (numpy.array, float) – Bathymetry values at node locations.