bluemath_tk.topo_bathy package

Submodules

bluemath_tk.topo_bathy.OCSMod module

bluemath_tk.topo_bathy.mesh_utils module

bluemath_tk.topo_bathy.profiles module

bluemath_tk.topo_bathy.profiles.biparabolic(h0: float, hsig: float, omega_surf_list: float | ndarray, TR: float) ndarray[source]

Generate a biparabolic profile based on Bernabeu et al. 2013.

This function creates a bathymetric profile with two parabolic sections separated by a discontinuity point, suitable for mixed-sediment beaches.

Parameters:
  • h0 (float) – Offshore water level (m)

  • hsig (float) – Significant wave height (m)

  • omega_surf_list (float or np.ndarray) – Intertidal dimensionless fall velocity (1 <= omega_surf <= 5)

  • TR (float) – Tidal range (m)

Returns:

Depth data values representing the biparabolic profile (m)

Return type:

np.ndarray

Notes

The biparabolic profile consists of: - Lower section: parabolic profile for fine sediments - Upper section: parabolic profile for coarse sediments - Discontinuity point: transition between the two sections - The profile is centered on mean tide level

The empirical parameters A, B, C, D are adjusted based on the dimensionless fall velocity parameter.

bluemath_tk.topo_bathy.profiles.custom_profile(dx: float, emsl: float, xs: List[float] | ndarray, ys: List[float] | ndarray) ndarray[source]

Generate a custom N-point profile from user-defined coordinates.

This function creates a bathymetric profile by interpolating between user-specified x,y coordinate pairs.

Parameters:
  • dx (float) – Bathymetry mesh resolution at x axes (m)

  • emsl (float) – Mean sea level (m) - used for reference but not directly applied

  • xs (list or np.ndarray) – X coordinate values (m)

  • ys (list or np.ndarray) – Y coordinate values (m) - positive values represent elevation above MSL

Returns:

Depth data values representing the custom profile (m)

Return type:

np.ndarray

Notes

The function uses linear interpolation between the provided points. The output depths are negative values (below sea level) as is conventional for bathymetric data.

The xs and ys arrays must have the same length and be sorted in increasing x order for proper interpolation.

bluemath_tk.topo_bathy.profiles.linear(dx: float, h0: float, bCrest: float, m: float, Wfore: float) ndarray[source]

Generate a simple linear profile (y = m * x + n).

This function creates a bathymetric profile with a constant slope from offshore to the beach crest.

Parameters:
  • dx (float) – Bathymetry mesh resolution at x axes (m)

  • h0 (float) – Offshore depth (m)

  • bCrest (float) – Beach height (m)

  • m (float) – Profile slope (dimensionless)

  • Wfore (float) – Flume length before slope toe (m)

Returns:

Depth data values representing the linear profile (m)

Return type:

np.ndarray

Notes

The profile consists of: - Fore section: constant depth at offshore level - Main slope: linear slope from offshore to beach - Beach slope: linear slope from sea level to beach crest - Plane beach: gentle slope for overtopping dissipation

bluemath_tk.topo_bathy.profiles.parabolic(dx: float, h0: float, A: float, xBeach: float, bCrest: float) ndarray[source]

Generate a parabolic profile (y = A * x^(2/3)).

This function creates a bathymetric profile following the equilibrium beach profile theory with a parabolic shape.

Parameters:
  • dx (float) – Bathymetry mesh resolution at x axes (m)

  • h0 (float) – Offshore depth (m)

  • A (float) – Parabola coefficient (m^(1/3))

  • xBeach (float) – Beach length (m)

  • bCrest (float) – Beach height (m)

Returns:

Depth data values representing the parabolic profile (m)

Return type:

np.ndarray

Notes

The profile follows the equilibrium beach profile theory where depth varies as x^(2/3) from the shoreline to the closure depth. The beach section is linear from the shoreline to the beach crest.

bluemath_tk.topo_bathy.profiles.reef(dx: float, h0: float, Slope1: float, Slope2: float, Wreef: float, Wfore: float, bCrest: float, emsl: float) ndarray[source]

Generate a reef morphologic profile based on Pearson et al. 2017.

This function creates a bathymetric profile for reef environments with distinct sections: fore reef, reef slope, reef flat, and inner slope.

Parameters:
  • dx (float) – Bathymetry mesh resolution at x axes (m)

  • h0 (float) – Offshore depth (m)

  • Slope1 (float) – Fore shore slope (dimensionless)

  • Slope2 (float) – Inner shore slope (dimensionless)

  • Wreef (float) – Reef bed width (m)

  • Wfore (float) – Flume length before fore toe (m)

  • bCrest (float) – Beach height (m)

  • emsl (float) – Mean sea level (m)

Returns:

Depth data values representing the reef profile (m)

Return type:

np.ndarray

Notes

The profile consists of several sections: - Fore reef: constant depth at offshore level - Reef slope: linear slope from offshore to reef flat - Reef flat: constant depth at mean sea level - Inner slope: linear slope from reef flat to beach - Plane beach: gentle slope for overtopping dissipation

bluemath_tk.topo_bathy.swan_grid module

bluemath_tk.topo_bathy.swan_grid.generate_grid_parameters(bathy_data: DataArray) dict[source]

Generate the grid parameters for the SWAN model.

Parameters:

bathy_data (xr.DataArray) – Bathymetry data. Must have the following dimensions: - lon: longitude - lat: latitude

Returns:

  • dict – Grid parameters for the SWAN model.

  • Contact @bellidog on GitHub for more information.

Module contents

Project: BlueMath_tk Sub-Module: topo_bathy Author: GeoOcean Research Group, Universidad de Cantabria Repository: https://github.com/GeoOcean/BlueMath_tk.git Status: Under development (Working)