Skip to content

Wave boundaries

Wave boundary conditions. Each class writes the XBeach boundary files and sets wbctype to its id. The waves guide explains which one to use.

rompy_xbeach.data.boundary.base

Base classes and mixins for XBeach wave boundary conditions.

This module contains the foundational classes used by all wave boundary types: - WaveBoundaryParams: Base wave boundary parameters (apply to all types) - SpectralWaveBoundaryParams: Spectral-specific parameters - NonSpectralWaveBoundaryParams: Non-spectral-specific parameters - BoundaryBase, BoundaryBaseGrid, BoundaryBaseStation, BoundaryBasePoint: Data interface bases - SpectraMixin, ParamMixin, FilelistMixin: Data processing mixins

logger module-attribute

logger = logging.getLogger(__name__)

SOURCE_TIMESERIES_TYPES module-attribute

SOURCE_TIMESERIES_TYPES = Union[
    load_entry_points("rompy.source", "timeseries")
    + (SourceFile, SourceIntake, SourceDataset)
]

SOURCE_PARAM_TYPES module-attribute

SOURCE_SPECTRA_TYPES module-attribute

WaveBoundaryParams pydantic-model

WaveBoundaryParams(**data: Any)

Bases: RompyBaseModel

Base wave boundary condition parameters.

These are general parameters that apply to ALL wave boundary condition types, whether spectral (jons, swan, vardens, jonstable) or non-spectral (stat, ts_1, ts_2, ts_nonh, bichrom).

The boundary conditions affect wave generation, energy scaling, and the treatment of Stokes drift and wave group variance at the boundary.

Fields:

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

SpectralWaveBoundaryParams pydantic-model

SpectralWaveBoundaryParams(**data: Any)

Bases: WaveBoundaryParams

Spectral wave boundary condition parameters.

These parameters are specific to spectral boundary conditions (wbctype = jons, swan, vardens, jonstable). They control how wave spectra are generated and applied at the offshore boundary.

Inherits all general wave boundary parameters from WaveBoundaryParams.

Fields:

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryBase

Base class for wave boundary data interfaces.

This class provides a custom serializer that returns an empty dict, ensuring that data interface fields from parent classes (BaseDataStation, BaseDataGrid, BaseDataPoint) are not serialized to params.txt. Only wave boundary parameters from WaveBoundaryParams/SpectralWaveBoundaryParams should be serialized.

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

BoundaryBaseGrid pydantic-model

BoundaryBaseGrid(**data: Any)

Bases: BoundaryBase, BaseDataGrid

Base class to construct XBeach wave boundary from gridded data.

Fields:

model_type pydantic-field

model_type: Literal['grid'] = 'grid'

Model type discriminator

id pydantic-field

id: str = 'data'

Unique identifier for this data source

source pydantic-field

source: SOURCES

Source reader, must return a dataset with the rioxarray accessor in the open method

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['interp', 'sel'] = 'sel'

Defines which function from xarray to use for data selection: 'interp' uses interp() for interpolation, 'sel' uses sel() for selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {'method': 'nearest'}

Keyword arguments for sel_method

x_dim cached property

x_dim

Return the x dimension name.

y_dim cached property

y_dim

Return the y dimension name.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get abstractmethod

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> Dataset

Write the data source to a new location.

Parameters:

Name Type Description Default
destdir str | Path

The destination directory to write data file to.

required
grid RegularGrid

The grid to interpolate the data to.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.filter_time is True.

None

Returns:

Name Type Description
data Dataset

The dataset selected from the grid and times. This method is abstract and must be implemented by the subclass to generate the expected xbeach output.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

BoundaryBaseStation pydantic-model

BoundaryBaseStation(**data: Any)

Bases: BoundaryBase, BaseDataStation

Base class to construct XBeach wave boundary from stations type data.

Fields:

model_type pydantic-field

model_type: Literal['grid'] = 'grid'

Model type discriminator

id pydantic-field

id: str = 'data'

Unique identifier for this data source

source pydantic-field

source: SOURCES

Source reader, must return a dataset with the rioxarray accessor in the open method

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['idw', 'nearest'] = 'idw'

Defines which function from wavespectra.core.select to use for data selection: 'idw' uses sel_idw() for inverse distance weighting, 'nearest' uses sel_nearest() for nearest neighbor selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {}

Keyword arguments for sel_method

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get abstractmethod

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> Dataset

Write the data source to a new location.

Parameters:

Name Type Description Default
destdir str | Path

The destination directory to write data file to.

required
grid RegularGrid

The grid to interpolate the data to.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.filter_time is True.

None

Returns:

Name Type Description
data Dataset

The dataset selected from the grid and times. This method is abstract and must be implemented by the subclass to generate the expected xbeach output.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

validate_coords

validate_coords() -> BaseDataStation

BoundaryBasePoint pydantic-model

BoundaryBasePoint(**data: Any)

Bases: BoundaryBase, BaseDataPoint

Base class to construct XBeach wave boundary from point timeseries type data.

Fields:

model_type pydantic-field

model_type: Literal['grid'] = 'grid'

Model type discriminator

id pydantic-field

id: str = 'data'

Unique identifier for this data source

source pydantic-field

source: SOURCES_TS

Source reader, must return an xarray timeseries dataset in the open method

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get abstractmethod

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> Dataset

Write the data source to a new location.

Parameters:

Name Type Description Default
destdir str | Path

The destination directory to write data file to.

required
grid RegularGrid

The grid to interpolate the data to.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.filter_time is True.

None

Returns:

Name Type Description
data Dataset

The dataset selected from the grid and times. This method is abstract and must be implemented by the subclass to generate the expected xbeach output.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

SpectraMixin

Mixin class to calculate wave statistics from spectral data.

source pydantic-field

Dataset source reader, must support CRS and have wavespectra accessor

coords pydantic-field

coords: DatasetCoords = DatasetCoords(
    x="lon", y="lat", t="time", s="site"
)

Names of the coordinates in the dataset

ParamMixin

Mixin class to get Jonswap statistics from parameter data.

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

FilelistMixin

Mixin class for FILELIST functionality.

This mixin provides support for FILELIST operations in two contexts: 1. Writing FILELIST files when generating boundary data from external sources 2. Fetching FILELIST files when using pre-existing boundary files

For data-generating boundaries: - When filelist=True: Creates a FILELIST file that references individual bcfiles for each timestep, plus writes the individual bcfiles. The FILELIST file is specified as the bcfile parameter in params.txt. - When filelist=False: Creates a single bcfile with wave parameters interpolated at time.start.

For file-based boundaries: - When filelist=True: The source is a FILELIST file and all referenced files will be fetched from the same directory.

Example FILELIST format (as written to filelist.txt):

FILELIST
1800 0.2 jonswap1.inp
1800 0.2 jonswap1.inp
1350 0.2 jonswap2.inp
1500 0.2 jonswap3.inp
1200 0.2 jonswap2.inp
3600 0.2 jonswap4.inp
Each line contains: duration (seconds), timestep (seconds), and filename.

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

dspr_to_s

dspr_to_s(
    dspr: Union[float, ndarray],
) -> Union[float, ndarray]

Calculate the Jonswap spreading coefficient from the directional spread.

Parameters:

Name Type Description Default
dspr Union[float, ndarray]

The directional spread in degrees.

required

Returns:

Name Type Description
s float | ndarray

The Jonswap spreading coefficient.

s_to_dspr

s_to_dspr(
    s: Union[float, ndarray],
) -> Union[float, ndarray]

Calculate the directional spread from the Jonswap spreading coefficient.

Parameters:

Name Type Description Default
s Union[float, ndarray]

The Jonswap spreading coefficient.

required

Returns:

Name Type Description
dspr float | ndarray

The directional spread in degrees.

rompy_xbeach.data.boundary.nonspectral

Non-spectral wave boundary condition classes for XBeach.

This module contains boundary classes for non-spectral wave boundary types: - params: Constant wave conditions (Hrms, Trep, dir0, m), bichromatic if Tlong is set - stat_table: Time-varying parametric waves from file - ts_1: Time series at single location from file - ts_2: Time series at two locations from file - ts_nonh: Non-hydrostatic time series from file

BoundaryParams pydantic-model

BoundaryParams(**data: Any)

Bases: WaveBoundaryParams

Wave boundary conditions from bulk parameters (wbctype=params).

Defines constant wave conditions using bulk parameters (Hrms, Trep, dir0, m) without requiring any external files. XBeach generates the wave forcing internally. When Tlong is set, XBeach generates bichromatic waves with wave groups of period Tlong instead, which is only allowed with the surfbeat wave model.

Examples

Constant wave conditions:

boundary = BoundaryParams(Hrms=2.0, Trep=12.0, dir0=270.0, m=10)

Bichromatic wave groups:

boundary = BoundaryParams(Hrms=1.5, Trep=10.0, Tlong=80.0)

Fields:

id pydantic-field

id: Literal['params'] = 'params'

Boundary type identifier

model_type pydantic-field

model_type: Literal['params'] = 'params'

Model type discriminator

Hrms pydantic-field

Hrms: float

Hrms wave height (m)

Trep pydantic-field

Trep: float

Representative wave period (s)

Tlong pydantic-field

Tlong: Optional[float] = None

Wave group period (s). When set, XBeach generates bichromatic waves, which requires the surfbeat wave model (XBeach default: not set, constant wave conditions)

dir0 pydantic-field

dir0: float = 270.0

Mean wave direction, nautical convention (degrees)

m pydantic-field

m: int = 10

Power in cos^m directional distribution

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for the wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory (not used, but required for interface).

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype and wave parameters.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryStatTable pydantic-model

BoundaryStatTable(**data: Any)

Bases: WaveBoundaryParams

Time-varying parametric wave boundary from stat_table file.

Requires a file with time-varying Hrms, Tp, direction, etc. in JONSWAP table format.

Examples

from rompy_xbeach.types import XBeachDataBlob boundary = BoundaryStatTable( ... source=XBeachDataBlob(source="/path/to/stat_table.txt"), ... )

Fields:

id pydantic-field

id: Literal['stat_table'] = 'stat_table'

Boundary type identifier

model_type pydantic-field

model_type: Literal['file_stat_table'] = 'file_stat_table'

Model type discriminator

source pydantic-field

Source for stat_table boundary file

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for stat_table wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave parameters.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryTs1 pydantic-model

BoundaryTs1(**data: Any)

Bases: WaveBoundaryParams

Time series wave boundary at single location (ts_1).

Requires a bc/gen.ezs file with columns: time, zs, E. The file will be fetched to destdir/bc/ subdirectory.

Examples

from rompy_xbeach.types import XBeachDataBlob boundary = BoundaryTs1( ... source=XBeachDataBlob(source="/path/to/gen.ezs"), ... )

Fields:

id pydantic-field

id: Literal['ts_1'] = 'ts_1'

Boundary type identifier

model_type pydantic-field

model_type: Literal['file_ts_1'] = 'file_ts_1'

Model type discriminator

source pydantic-field

Source for time series boundary file (bc/gen.ezs format)

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for ts_1 wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave parameters.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryTs2 pydantic-model

BoundaryTs2(**data: Any)

Bases: WaveBoundaryParams

Time series wave boundary at two locations (ts_2).

Requires a bc/gen.ezs file with columns: time, zs, E. The file will be fetched to destdir/bc/ subdirectory.

Examples

from rompy_xbeach.types import XBeachDataBlob boundary = BoundaryTs2( ... source=XBeachDataBlob(source="/path/to/gen.ezs"), ... )

Fields:

id pydantic-field

id: Literal['ts_2'] = 'ts_2'

Boundary type identifier

model_type pydantic-field

model_type: Literal['file_ts_2'] = 'file_ts_2'

Model type discriminator

source pydantic-field

Source for time series boundary file (bc/gen.ezs format)

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for ts_2 wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave parameters.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryTsNonh pydantic-model

BoundaryTsNonh(**data: Any)

Bases: WaveBoundaryParams

Non-hydrostatic time series wave boundary (ts_nonh).

Requires a Boun_u.bcf file with columns: scalar/vector, t, U, Zs, W.

Examples

from rompy_xbeach.types import XBeachDataBlob boundary = BoundaryTsNonh( ... source=XBeachDataBlob(source="/path/to/Boun_u.bcf"), ... )

Fields:

id pydantic-field

id: Literal['ts_nonh'] = 'ts_nonh'

Boundary type identifier

model_type pydantic-field

model_type: Literal['file_ts_nonh'] = 'file_ts_nonh'

Model type discriminator

source pydantic-field

Source for non-hydrostatic time series boundary file (Boun_u.bcf format)

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for ts_nonh wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave parameters.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

rompy_xbeach.data.boundary.spectral

Spectral wave boundary condition classes for XBeach.

This module contains boundary classes for spectral wave boundary types: - JONS (JONSWAP parametric) - JONSTABLE (time-varying JONSWAP) - SWAN (2D spectral) - VARDENS (placeholder)

Each class can either: 1. Generate boundary files from external data sources (spectra or parameters) 2. Use pre-existing boundary files via XBeachDataFetch source

logger module-attribute

logger = logging.getLogger(__name__)

BoundaryJonsBase

Bases: FilelistMixin

Base class for JONS wave boundary from data sources.

This class generates JONSWAP boundary files from wave data.

id pydantic-field

id: Literal['parametric'] = 'parametric'

Boundary type identifier, the XBeach wbctype for JONSWAP spectra

fnyq pydantic-field

fnyq: Optional[float] = None

Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)

dfj pydantic-field

dfj: Optional[float] = None

Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

BoundaryJonstableBase

Base class for JONSTABLE wave boundary from data sources.

This class generates JONSTABLE boundary files from wave data.

id pydantic-field

id: Literal['jonstable'] = 'jonstable'

Boundary type identifier

default_params

default_params() -> BoundaryJonstableBase

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

BoundaryFileSpectralBase pydantic-model

BoundaryFileSpectralBase(**data: Any)

Bases: SpectralWaveBoundaryParams

Base class for file-based spectral boundaries.

This class provides common functionality for boundary classes that fetch pre-existing bcfiles.

Fields:

bcfile_source pydantic-field

bcfile_source: XBeachDataBlob

Source for the bcfile or FILELIST file

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Fetch bcfile(s) and return XBeach parameters.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryStationSpectraJons pydantic-model

BoundaryStationSpectraJons(**data: Any)

Bases: SpectraMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBaseStation

Wave boundary conditions from station type spectra dataset such as SMC.

Fields:

model_type pydantic-field

model_type: Literal["station_spectra_jons"] = (
    "station_spectra_jons"
)

Model type discriminator

id pydantic-field

id: Literal['parametric'] = 'parametric'

Boundary type identifier, the XBeach wbctype for JONSWAP spectra

source pydantic-field

Dataset source reader, must support CRS and have wavespectra accessor

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

coords: DatasetCoords = DatasetCoords(
    x="lon", y="lat", t="time", s="site"
)

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['idw', 'nearest'] = 'idw'

Defines which function from wavespectra.core.select to use for data selection: 'idw' uses sel_idw() for inverse distance weighting, 'nearest' uses sel_nearest() for nearest neighbor selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {}

Keyword arguments for sel_method

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

fnyq pydantic-field

fnyq: Optional[float] = None

Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)

dfj pydantic-field

dfj: Optional[float] = None

Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

validate_coords

validate_coords() -> BaseDataStation

BoundaryStationParamJons pydantic-model

BoundaryStationParamJons(**data: Any)

Bases: ParamMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBaseStation

Wave boundary conditions from station type parameters dataset such as SMC.

Fields:

source pydantic-field

Dataset source reader, must support CRS

model_type pydantic-field

model_type: Literal["station_param_jons"] = (
    "station_param_jons"
)

Model type discriminator

id pydantic-field

id: Literal['parametric'] = 'parametric'

Boundary type identifier, the XBeach wbctype for JONSWAP spectra

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['idw', 'nearest'] = 'idw'

Defines which function from wavespectra.core.select to use for data selection: 'idw' uses sel_idw() for inverse distance weighting, 'nearest' uses sel_nearest() for nearest neighbor selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {}

Keyword arguments for sel_method

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

fnyq pydantic-field

fnyq: Optional[float] = None

Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)

dfj pydantic-field

dfj: Optional[float] = None

Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

validate_coords

validate_coords() -> BaseDataStation

BoundaryPointParamJons pydantic-model

BoundaryPointParamJons(**data: Any)

Bases: ParamMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBasePoint

Wave boundary conditions from point timeseries type parameters dataset.

Fields:

model_type pydantic-field

model_type: Literal["point_param_jons"] = "point_param_jons"

Model type discriminator

source pydantic-field

Dataset source reader for point timeseries type data

id pydantic-field

id: Literal['parametric'] = 'parametric'

Boundary type identifier, the XBeach wbctype for JONSWAP spectra

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

fnyq pydantic-field

fnyq: Optional[float] = None

Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)

dfj pydantic-field

dfj: Optional[float] = None

Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

BoundaryGridParamJons pydantic-model

BoundaryGridParamJons(**data: Any)

Bases: ParamMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBaseGrid

Wave boundary conditions from grid type parameters dataset.

Fields:

source pydantic-field

Dataset source reader, must support CRS

model_type pydantic-field

model_type: Literal['grid_param_jons'] = 'grid_param_jons'

Model type discriminator

id pydantic-field

id: Literal['parametric'] = 'parametric'

Boundary type identifier, the XBeach wbctype for JONSWAP spectra

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['interp', 'sel'] = 'sel'

Defines which function from xarray to use for data selection: 'interp' uses interp() for interpolation, 'sel' uses sel() for selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {'method': 'nearest'}

Keyword arguments for sel_method

x_dim cached property

x_dim

Return the x dimension name.

y_dim cached property

y_dim

Return the y dimension name.

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

fnyq pydantic-field

fnyq: Optional[float] = None

Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)

dfj pydantic-field

dfj: Optional[float] = None

Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

BoundaryFileJons pydantic-model

BoundaryFileJons(**data: Any)

Bases: FilelistMixin, BoundaryFileSpectralBase

JONSWAP boundary from pre-existing bcfile(s).

Use this class when you have existing JONSWAP boundary files created outside of rompy (e.g., manually or from another tool).

If filelist=True, the source bcfile is expected to be a FILELIST file, and all files referenced within it will also be fetched from the same directory.

Examples

from rompy_xbeach.types import XBeachDataBlob

Single bcfile

boundary = BoundaryFileJons( ... bcfile_source=XBeachDataBlob(source="/path/to/bcfile"), ... )

FILELIST with multiple bcfiles

boundary = BoundaryFileJons( ... bcfile_source=XBeachDataBlob(source="/path/to/bcfile"), ... filelist=True, ... )

Fields:

id pydantic-field

id: Literal['parametric'] = 'parametric'

Boundary type identifier, the XBeach wbctype for JONSWAP spectra

model_type pydantic-field

model_type: Literal['file_jons'] = 'file_jons'

Model type discriminator

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

bcfile_source pydantic-field

bcfile_source: XBeachDataBlob

Source for the bcfile or FILELIST file

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Fetch bcfile(s) and return XBeach parameters.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

BoundaryStationSpectraJonstable pydantic-model

BoundaryStationSpectraJonstable(**data: Any)

Bases: SpectraMixin, BoundaryJonstableBase, SpectralWaveBoundaryParams, BoundaryBaseStation

Wave boundary conditions from station type spectra dataset such as SMC.

Fields:

model_type pydantic-field

model_type: Literal["station_spectra_jonstable"] = (
    "station_spectra_jonstable"
)

Model type discriminator

id pydantic-field

id: Literal['jonstable'] = 'jonstable'

Boundary type identifier

source pydantic-field

Dataset source reader, must support CRS and have wavespectra accessor

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

coords: DatasetCoords = DatasetCoords(
    x="lon", y="lat", t="time", s="site"
)

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['idw', 'nearest'] = 'idw'

Defines which function from wavespectra.core.select to use for data selection: 'idw' uses sel_idw() for inverse distance weighting, 'nearest' uses sel_nearest() for nearest neighbor selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {}

Keyword arguments for sel_method

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

validate_coords

validate_coords() -> BaseDataStation

default_params

default_params() -> BoundaryJonstableBase

BoundaryStationParamJonstable pydantic-model

BoundaryStationParamJonstable(**data: Any)

Bases: ParamMixin, BoundaryJonstableBase, SpectralWaveBoundaryParams, BoundaryBaseStation

Wave boundary conditions from station type parameters dataset such as SMC.

Fields:

source pydantic-field

Dataset source reader, must support CRS

model_type pydantic-field

model_type: Literal["station_param_jonstable"] = (
    "station_param_jonstable"
)

Model type discriminator

id pydantic-field

id: Literal['jonstable'] = 'jonstable'

Boundary type identifier

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['idw', 'nearest'] = 'idw'

Defines which function from wavespectra.core.select to use for data selection: 'idw' uses sel_idw() for inverse distance weighting, 'nearest' uses sel_nearest() for nearest neighbor selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {}

Keyword arguments for sel_method

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

validate_coords

validate_coords() -> BaseDataStation

default_params

default_params() -> BoundaryJonstableBase

BoundaryPointParamJonstable pydantic-model

BoundaryPointParamJonstable(**data: Any)

Bases: ParamMixin, BoundaryJonstableBase, SpectralWaveBoundaryParams, BoundaryBasePoint

Wave boundary conditions from point timeseries type parameters dataset.

Fields:

model_type pydantic-field

model_type: Literal["point_param_jonstable"] = (
    "point_param_jonstable"
)

Model type discriminator

source pydantic-field

Dataset source reader for point timeseries type data

id pydantic-field

id: Literal['jonstable'] = 'jonstable'

Boundary type identifier

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

default_params

default_params() -> BoundaryJonstableBase

BoundaryGridParamJonstable pydantic-model

BoundaryGridParamJonstable(**data: Any)

Bases: ParamMixin, BoundaryJonstableBase, SpectralWaveBoundaryParams, BoundaryBaseGrid

Generate XBeach JONSTABLE wave boundary conditions from gridded parameter data.

This class reads wave parameters (Hm0, Tp, Dir, Spread, Gamma) from a gridded data source, selects/interpolates the data at the offshore boundary location of the XBeach grid, and writes the time-varying parameters to a JONSTABLE format file.

Fields:

source pydantic-field

Dataset source reader, must support CRS

model_type pydantic-field

model_type: Literal["grid_param_jonstable"] = (
    "grid_param_jonstable"
)

Model type discriminator

id pydantic-field

id: Literal['jonstable'] = 'jonstable'

Boundary type identifier

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['interp', 'sel'] = 'sel'

Defines which function from xarray to use for data selection: 'interp' uses interp() for interpolation, 'sel' uses sel() for selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {'method': 'nearest'}

Keyword arguments for sel_method

x_dim cached property

x_dim

Return the x dimension name.

y_dim cached property

y_dim

Return the y dimension name.

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

hm0_var pydantic-field

hm0_var: Union[str, float]

Variable name of the significant wave height Hm0 in the source data, or alternatively a constant value to use for all times

tp_var pydantic-field

tp_var: Union[str, float]

Variable name of the peak period Tp in the source data, or alternatively a constant value to use for all times

mainang_var pydantic-field

mainang_var: Union[str, float]

Variable name of the main wave direction in the source data, or alternatively a constant value to use for all times

gammajsp_var pydantic-field

gammajsp_var: Optional[Union[str, float]] = None

Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times

dspr_var pydantic-field

dspr_var: Optional[Union[str, float]] = None

Variable name of the directional spreading in the source data, used to calculate the Jonswap spreading coefficient, or alternatively a constant value to use for all times

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

default_params

default_params() -> BoundaryJonstableBase

BoundaryFileJonstable pydantic-model

BoundaryFileJonstable(**data: Any)

Bases: BoundaryFileSpectralBase

JONSTABLE boundary from pre-existing bcfile.

Use this class when you have an existing JONSTABLE boundary file created outside of rompy (e.g., manually or from another tool).

JONSTABLE files are always single files (no FILELIST support needed).

Examples

from rompy_xbeach.types import XBeachDataBlob boundary = BoundaryFileJonstable( ... bcfile_source=XBeachDataBlob(source="/path/to/jonstable.txt"), ... )

Fields:

id pydantic-field

id: Literal['jonstable'] = 'jonstable'

Boundary type identifier

model_type pydantic-field

model_type: Literal['file_jonstable'] = 'file_jonstable'

Model type discriminator

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

bcfile_source pydantic-field

bcfile_source: XBeachDataBlob

Source for the bcfile or FILELIST file

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Fetch bcfile(s) and return XBeach parameters.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

BoundaryStationSpectraSwan pydantic-model

BoundaryStationSpectraSwan(**data: Any)

Bases: FilelistMixin, SpectraMixin, SpectralWaveBoundaryParams, BoundaryBaseStation

SWAN wave boundary from station type spectra dataset.

XBeach assumes the directional information in the SWAN file is according to the nautical convention. If the file uses the Cartesian convention for directions, the user must specify the angle in degrees to rotate the x-axis in SWAN to the x-axis in XBeach (by the Cartesian convention). This value is specified in params.txt using the keyword dthetaS_XB.

Fields:

id pydantic-field

id: Literal['swan'] = 'swan'

Boundary type identifier

model_type pydantic-field

model_type: Literal["station_spectra_swan"] = (
    "station_spectra_swan"
)

Model type discriminator

source pydantic-field

Dataset source reader, must support CRS and have wavespectra accessor

filter pydantic-field

filter: Optional[Filter]

Optional filter specification to apply to the dataset

variables pydantic-field

variables: Optional[list[str]] = []

Subset of variables to extract from the dataset

coords pydantic-field

coords: DatasetCoords = DatasetCoords(
    x="lon", y="lat", t="time", s="site"
)

Names of the coordinates in the dataset

crop_data pydantic-field

crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

buffer pydantic-field

buffer: float = 0.0

Space to buffer the grid bounding box if crop_data is True

time_buffer pydantic-field

time_buffer: list[int] = [1, 1]

Number of source data timesteps to buffer the time range if filter_time is True

ds property

ds

Return the xarray dataset for this data source.

outfile property

outfile: str

location pydantic-field

location: Literal['offshore'] = 'offshore'

Location to extract the data from the source dataset

crs cached property

crs

Return the coordinate reference system of the data source.

sel_method pydantic-field

sel_method: Literal['idw', 'nearest'] = 'idw'

Defines which function from wavespectra.core.select to use for data selection: 'idw' uses sel_idw() for inverse distance weighting, 'nearest' uses sel_nearest() for nearest neighbor selection

sel_method_kwargs pydantic-field

sel_method_kwargs: dict = {}

Keyword arguments for sel_method

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

get

get(
    destdir: str | Path,
    grid: RegularGrid,
    time: Optional[TimeRange] = None,
) -> dict

Write the selected boundary data to file.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for the boundary files.

required
grid RegularGrid

Grid instance to use for selecting the boundary points.

required
time Optional[TimeRange]

The times to filter the data to, only used if self.crop_data is True.

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

plot

plot(
    param,
    isel={},
    model_grid=None,
    cmap="turbo",
    figsize=None,
    fscale=10,
    borders=True,
    land=True,
    coastline=True,
    **kwargs,
)

Plot the grid.

validate_coords

validate_coords() -> BaseDataStation

BoundaryFileSwan pydantic-model

BoundaryFileSwan(**data: Any)

Bases: FilelistMixin, BoundaryFileSpectralBase

SWAN spectral boundary from pre-existing bcfile(s).

Use this class when you have existing SWAN spectral boundary files created outside of rompy (e.g., manually or from another tool).

If filelist=True, the source bcfile is expected to be a FILELIST file, and all files referenced within it will also be fetched from the same directory.

Examples

from rompy_xbeach.types import XBeachDataBlob

Single bcfile

boundary = BoundaryFileSwan( ... bcfile_source=XBeachDataBlob(source="/path/to/swan_spectrum.txt"), ... )

FILELIST with multiple bcfiles

boundary = BoundaryFileSwan( ... bcfile_source=XBeachDataBlob(source="/path/to/filelist.txt"), ... filelist=True, ... )

Fields:

id pydantic-field

id: Literal['swan'] = 'swan'

Boundary type identifier

model_type pydantic-field

model_type: Literal['file_swan'] = 'file_swan'

Model type discriminator

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

bcfile_source pydantic-field

bcfile_source: XBeachDataBlob

Source for the bcfile or FILELIST file

filelist pydantic-field

filelist: bool = False

Controls FILELIST behavior. For data-generating boundaries: creates multiple bcfiles with a FILELIST index if True, single bcfile if False. For file-based boundaries: interprets source as FILELIST if True.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Fetch bcfile(s) and return XBeach parameters.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory for boundary files.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters including wbctype, bcfile, and wave boundary settings.

rompy_xbeach.data.boundary.special

Special wave boundary condition classes for XBeach.

This module contains special boundary classes: - BoundaryOff: No wave forcing - BoundaryReuse: Reuse previous simulation boundary files

REUSE_LIST_FILES module-attribute

REUSE_LIST_FILES = [
    "ebcflist.bcf",
    "qbcflist.bcf",
    "esbcflist.bcf",
]

BoundaryOff pydantic-model

BoundaryOff(**data: Any)

Bases: WaveBoundaryParams

No wave forcing.

Use this when you don't want any wave forcing in the model.

Examples
from rompy_xbeach.data.boundary import BoundaryOff

print(BoundaryOff().get("."))
{'wbctype': 'off'}

Fields:

id pydantic-field

id: Literal['off'] = 'off'

Boundary type identifier

model_type pydantic-field

model_type: Literal['off'] = 'off'

Model type discriminator

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for no wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory (not used, but required for interface).

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters with wbctype='off' and wave boundary settings.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

BoundaryReuse pydantic-model

BoundaryReuse(**data: Any)

Bases: SpectralWaveBoundaryParams

Reuse previous boundary conditions.

Makes XBeach reuse wave time series from a previous simulation. The list files ebcflist.bcf and qbcflist.bcf (and esbcflist.bcf when the previous run used single_dir), and the series files they reference, are copied from the previous run directory into the workspace.

XBeach automatically looks for these files in the run directory - no bcfile parameter is needed in params.txt.

Examples
from rompy_xbeach.data.boundary import BoundaryReuse
from rompy_xbeach.types import XBeachDirectoryBlob

boundary = BoundaryReuse(
    previous_run=XBeachDirectoryBlob(source="/path/to/previous/run")
)

Fields:

id pydantic-field

id: Literal['reuse'] = 'reuse'

Boundary type identifier

model_type pydantic-field

model_type: Literal['reuse'] = 'reuse'

Model type discriminator

previous_run pydantic-field

previous_run: XBeachDirectoryBlob

Directory containing ebcflist.bcf and qbcflist.bcf files from a previous XBeach simulation.

nmax pydantic-field

nmax: Optional[float] = None

Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)

wbcevarreduce pydantic-field

wbcevarreduce: Optional[float] = None

Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)

bclwonly pydantic-field

bclwonly: Optional[bool] = None

Switch to run boundary conditions with long waves only (XBeach default: 0)

swkhmin pydantic-field

swkhmin: Optional[float] = None

Minimum kh value to include in wave action balance. Waves with lower kh are included in NLSWE instead (XBeach default: -0.01)

wbcRemoveStokes pydantic-field

wbcRemoveStokes: Optional[bool] = None

Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)

wbcScaleEnergy pydantic-field

wbcScaleEnergy: Optional[bool] = None

Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)

cyclicdiradjust pydantic-field

cyclicdiradjust: Optional[bool] = None

Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)

taper pydantic-field

taper: Optional[float] = None

Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)

ARC pydantic-field

ARC: Optional[bool] = None

Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)

freewave pydantic-field

freewave: Optional[bool] = None

Switch for free wave propagation at the boundary. When enabled, assumes incoming long waves propagate at sqrt(gh) instead of group velocity cg. Affects absorbing/radiating boundary calculations (XBeach default: 0)

thetamin pydantic-field

thetamin: Optional[float] = None

Minimum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: -90.0)

thetamax pydantic-field

thetamax: Optional[float] = None

Maximum wave angle (degrees). When thetanaut=0, this is relative to the grid x-axis (shore-normal); when thetanaut=1, this is in nautical convention (N=0°, E=90°). Only used when swave=1 (XBeach default: 90.0)

dtheta pydantic-field

dtheta: Optional[float] = None

Wave directional resolution (degrees). Automatically computed from thetamax-thetamin when single_dir=1. Only used when swave=1 (XBeach default: 10.0)

dtheta_s pydantic-field

dtheta_s: Optional[float] = None

Directional resolution (degrees) of the stationary refraction model used when single_dir=1, which is the XBeach default for surfbeat on 2D grids. Required by XBeach in that case. Only used when swave=1 (XBeach default: 10.0)

thetanaut pydantic-field

thetanaut: Optional[bool] = None

Switch for wave direction convention. When 0 (default), wave angles are relative to the grid x-axis and rotated by alfa internally. When 1, wave angles are in nautical convention (N=0°, E=90°) using real-world coordinates and alfa is ignored. Only used when swave=1 (XBeach default: 0)

order pydantic-field

order: Optional[Literal[1, 2]] = None

Order of wave steering at the boundary. 1 = first-order (short wave energy only), 2 = second-order (bound long wave corresponding to short wave forcing is added) (XBeach default: 2)

wbctype property

wbctype: str

The XBeach wbctype value for this boundary type, given by its id.

rt pydantic-field

rt: Optional[float] = None

Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))

dtbc pydantic-field

dtbc: Optional[float] = 1.0

Timestep (s) used to describe time series of wave energy and long wave flux at offshore boundary (not affected by morfac) (XBeach default: 1.0)

dthetas_xb pydantic-field

dthetas_xb: Optional[float] = None

The (counter-clockwise) angle in the degrees needed to rotate from the x-axis in swan to the x-axis pointing east (XBeach default: 0.0)

tm01switch pydantic-field

tm01switch: Optional[bool] = None

Switch to enable tm01 rather than tm-10 (XBeach default: 0)

correcthm0 pydantic-field

correcthm0: Optional[bool] = None

Switch to enable hm0 correction (XBeach default: 1)

fcutoff pydantic-field

fcutoff: Optional[float] = None

Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)

nonhspectrum pydantic-field

nonhspectrum: Optional[Literal[0, 1]] = None

Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)

nspectrumloc pydantic-field

nspectrumloc: Optional[int] = None

Number of input spectrum locations (XBeach default: 1)

nspr pydantic-field

nspr: Optional[bool] = None

Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)

random pydantic-field

random: Optional[bool] = None

Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)

sprdthr pydantic-field

sprdthr: Optional[float] = None

Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)

trepfac pydantic-field

trepfac: Optional[float] = None

Compute mean wave period over energy band: par%trepfac*maxval(sf) for jons, swan or vardens; converges to tm01 for trepfac = 0.0 (XBeach default: 0.01)

wbcversion pydantic-field

wbcversion: Optional[Literal[1, 2, 3]] = None

Version of wave boundary conditions (XBeach default: 3)

get

get(
    destdir: str | Path,
    grid: RegularGrid = None,
    time: TimeRange = None,
) -> dict

Return XBeach parameters for reuse wave boundary.

Parameters:

Name Type Description Default
destdir str | Path

Destination directory where boundary files will be fetched.

required
grid RegularGrid

Grid instance (not used).

None
time TimeRange

Time range (not used).

None

Returns:

Type Description
dict

XBeach parameters with wbctype='reuse' and wave boundary settings.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.