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
SOURCE_TIMESERIES_TYPES
module-attribute
¶
SOURCE_TIMESERIES_TYPES = Union[
load_entry_points("rompy.source", "timeseries")
+ (SourceFile, SourceIntake, SourceDataset)
]
SOURCE_PARAM_TYPES
module-attribute
¶
SOURCE_PARAM_TYPES = Union[
SourceCRSFile, SourceCRSIntake, SourceCRSDataset
]
SOURCE_SPECTRA_TYPES
module-attribute
¶
SOURCE_SPECTRA_TYPES = Union[
SourceCRSWavespectra,
SourceCRSFile,
SourceCRSIntake,
SourceCRSDataset,
]
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(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]])
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
check_for_typos
classmethod
¶
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]])
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
Version of wave boundary conditions (XBeach default: 3)
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
check_for_typos
classmethod
¶
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.
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.
BoundaryBaseGrid
pydantic-model
¶
BoundaryBaseGrid(**data: Any)
Bases: BoundaryBase, BaseDataGrid
Base class to construct XBeach wave boundary from gridded data.
Fields:
-
model_type(Literal['grid']) -
id(str) -
source(SOURCES) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['interp', 'sel']) -
sel_method_kwargs(dict)
source
pydantic-field
¶
source: SOURCES
Source reader, must return a dataset with the rioxarray accessor in the open method
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
check_for_typos
classmethod
¶
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.
get
abstractmethod
¶
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 |
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(Literal['grid']) -
id(str) -
source(SOURCES) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['idw', 'nearest']) -
sel_method_kwargs(dict)
source
pydantic-field
¶
source: SOURCES
Source reader, must return a dataset with the rioxarray accessor in the open method
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
check_for_typos
classmethod
¶
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.
get
abstractmethod
¶
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 |
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.
BoundaryBasePoint
pydantic-model
¶
BoundaryBasePoint(**data: Any)
Bases: BoundaryBase, BaseDataPoint
Base class to construct XBeach wave boundary from point timeseries type data.
Fields:
-
model_type(Literal['grid']) -
id(str) -
source(SOURCES_TS) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore'])
source
pydantic-field
¶
source: SOURCES_TS
Source reader, must return an xarray timeseries dataset in the open method
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
check_for_typos
classmethod
¶
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.
get
abstractmethod
¶
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 |
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
¶
source: SOURCE_SPECTRA_TYPES
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
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, 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):
Each line contains: duration (seconds), timestep (seconds), and filename.
dspr_to_s
¶
s_to_dspr
¶
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
id(Literal['params']) -
model_type(Literal['params']) -
Hrms(float) -
Trep(float) -
Tlong(Optional[float]) -
dir0(float) -
m(int)
Tlong
pydantic-field
¶
Wave group period (s). When set, XBeach generates bichromatic waves, which requires the surfbeat wave model (XBeach default: not set, constant wave conditions)
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
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
¶
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
id(Literal['stat_table']) -
model_type(Literal['file_stat_table']) -
source(XBeachDataBlob)
model_type
pydantic-field
¶
model_type: Literal['file_stat_table'] = 'file_stat_table'
Model type discriminator
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
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
¶
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
id(Literal['ts_1']) -
model_type(Literal['file_ts_1']) -
source(XBeachDataBlob)
source
pydantic-field
¶
source: XBeachDataBlob
Source for time series boundary file (bc/gen.ezs format)
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
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
¶
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
id(Literal['ts_2']) -
model_type(Literal['file_ts_2']) -
source(XBeachDataBlob)
source
pydantic-field
¶
source: XBeachDataBlob
Source for time series boundary file (bc/gen.ezs format)
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
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
¶
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
id(Literal['ts_nonh']) -
model_type(Literal['file_ts_nonh']) -
source(XBeachDataBlob)
model_type
pydantic-field
¶
model_type: Literal['file_ts_nonh'] = 'file_ts_nonh'
Model type discriminator
source
pydantic-field
¶
source: XBeachDataBlob
Source for non-hydrostatic time series boundary file (Boun_u.bcf format)
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
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
¶
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.
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
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
¶
Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)
dfj
pydantic-field
¶
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
¶
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 |
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.
get
¶
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 |
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
bcfile_source(XBeachDataBlob)
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
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.
BoundaryStationSpectraJons
pydantic-model
¶
BoundaryStationSpectraJons(**data: Any)
Bases: SpectraMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBaseStation
Wave boundary conditions from station type spectra dataset such as SMC.
Fields:
-
id(Literal['parametric']) -
source(SOURCE_SPECTRA_TYPES) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(DatasetCoords) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['idw', 'nearest']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
filelist(bool) -
fnyq(Optional[float]) -
dfj(Optional[float]) -
model_type(Literal['station_spectra_jons'])
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
¶
source: SOURCE_SPECTRA_TYPES
Dataset source reader, must support CRS and have wavespectra accessor
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)
dfj
pydantic-field
¶
Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)
check_for_typos
classmethod
¶
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.
get
¶
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 |
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.
BoundaryStationParamJons
pydantic-model
¶
BoundaryStationParamJons(**data: Any)
Bases: ParamMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBaseStation
Wave boundary conditions from station type parameters dataset such as SMC.
Fields:
-
id(Literal['parametric']) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['idw', 'nearest']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
filelist(bool) -
fnyq(Optional[float]) -
dfj(Optional[float]) -
hm0_var(Union[str, float]) -
tp_var(Union[str, float]) -
mainang_var(Union[str, float]) -
gammajsp_var(Optional[Union[str, float]]) -
dspr_var(Optional[Union[str, float]]) -
source(SOURCE_PARAM_TYPES) -
model_type(Literal['station_param_jons'])
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
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)
dfj
pydantic-field
¶
Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)
hm0_var
pydantic-field
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times
dspr_var
pydantic-field
¶
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
¶
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.
get
¶
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 |
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.
BoundaryPointParamJons
pydantic-model
¶
BoundaryPointParamJons(**data: Any)
Bases: ParamMixin, BoundaryJonsBase, SpectralWaveBoundaryParams, BoundaryBasePoint
Wave boundary conditions from point timeseries type parameters dataset.
Fields:
-
id(Literal['parametric']) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
filelist(bool) -
fnyq(Optional[float]) -
dfj(Optional[float]) -
hm0_var(Union[str, float]) -
tp_var(Union[str, float]) -
mainang_var(Union[str, float]) -
gammajsp_var(Optional[Union[str, float]]) -
dspr_var(Optional[Union[str, float]]) -
model_type(Literal['point_param_jons']) -
source(SOURCE_TIMESERIES_TYPES)
model_type
pydantic-field
¶
model_type: Literal["point_param_jons"] = "point_param_jons"
Model type discriminator
source
pydantic-field
¶
source: SOURCE_TIMESERIES_TYPES
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
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)
dfj
pydantic-field
¶
Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)
hm0_var
pydantic-field
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times
dspr_var
pydantic-field
¶
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
¶
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.
get
¶
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 |
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:
-
id(Literal['parametric']) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['interp', 'sel']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
filelist(bool) -
fnyq(Optional[float]) -
dfj(Optional[float]) -
hm0_var(Union[str, float]) -
tp_var(Union[str, float]) -
mainang_var(Union[str, float]) -
gammajsp_var(Optional[Union[str, float]]) -
dspr_var(Optional[Union[str, float]]) -
source(SOURCE_PARAM_TYPES) -
model_type(Literal['grid_param_jons'])
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
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
Highest frequency used to create JONSWAP spectrum [Hz] (XBeach default: 0.3)
dfj
pydantic-field
¶
Step size frequency used to create JONSWAP spectrum [Hz] within the range fnyq/1000 - fnyq/20 (XBeach default: fnyq/200)
hm0_var
pydantic-field
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times
dspr_var
pydantic-field
¶
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
¶
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.
get
¶
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 |
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
bcfile_source(XBeachDataBlob) -
filelist(bool) -
id(Literal['parametric']) -
model_type(Literal['file_jons'])
id
pydantic-field
¶
id: Literal['parametric'] = 'parametric'
Boundary type identifier, the XBeach wbctype for JONSWAP spectra
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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.
check_for_typos
classmethod
¶
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.
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:
-
id(Literal['jonstable']) -
source(SOURCE_SPECTRA_TYPES) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(DatasetCoords) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['idw', 'nearest']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
model_type(Literal['station_spectra_jonstable'])
model_type
pydantic-field
¶
model_type: Literal["station_spectra_jonstable"] = (
"station_spectra_jonstable"
)
Model type discriminator
source
pydantic-field
¶
source: SOURCE_SPECTRA_TYPES
Dataset source reader, must support CRS and have wavespectra accessor
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
Version of wave boundary conditions (XBeach default: 3)
check_for_typos
classmethod
¶
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.
get
¶
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 |
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.
BoundaryStationParamJonstable
pydantic-model
¶
BoundaryStationParamJonstable(**data: Any)
Bases: ParamMixin, BoundaryJonstableBase, SpectralWaveBoundaryParams, BoundaryBaseStation
Wave boundary conditions from station type parameters dataset such as SMC.
Fields:
-
id(Literal['jonstable']) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['idw', 'nearest']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
hm0_var(Union[str, float]) -
tp_var(Union[str, float]) -
mainang_var(Union[str, float]) -
gammajsp_var(Optional[Union[str, float]]) -
dspr_var(Optional[Union[str, float]]) -
source(SOURCE_PARAM_TYPES) -
model_type(Literal['station_param_jonstable'])
model_type
pydantic-field
¶
model_type: Literal["station_param_jonstable"] = (
"station_param_jonstable"
)
Model type discriminator
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
Version of wave boundary conditions (XBeach default: 3)
hm0_var
pydantic-field
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times
dspr_var
pydantic-field
¶
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
¶
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.
get
¶
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 |
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.
BoundaryPointParamJonstable
pydantic-model
¶
BoundaryPointParamJonstable(**data: Any)
Bases: ParamMixin, BoundaryJonstableBase, SpectralWaveBoundaryParams, BoundaryBasePoint
Wave boundary conditions from point timeseries type parameters dataset.
Fields:
-
id(Literal['jonstable']) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
hm0_var(Union[str, float]) -
tp_var(Union[str, float]) -
mainang_var(Union[str, float]) -
gammajsp_var(Optional[Union[str, float]]) -
dspr_var(Optional[Union[str, float]]) -
model_type(Literal['point_param_jonstable']) -
source(SOURCE_TIMESERIES_TYPES)
model_type
pydantic-field
¶
model_type: Literal["point_param_jonstable"] = (
"point_param_jonstable"
)
Model type discriminator
source
pydantic-field
¶
source: SOURCE_TIMESERIES_TYPES
Dataset source reader for point timeseries type data
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
Version of wave boundary conditions (XBeach default: 3)
hm0_var
pydantic-field
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times
dspr_var
pydantic-field
¶
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
¶
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.
get
¶
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 |
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.
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:
-
id(Literal['jonstable']) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(Optional[DatasetCoords]) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['interp', 'sel']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
hm0_var(Union[str, float]) -
tp_var(Union[str, float]) -
mainang_var(Union[str, float]) -
gammajsp_var(Optional[Union[str, float]]) -
dspr_var(Optional[Union[str, float]]) -
source(SOURCE_PARAM_TYPES) -
model_type(Literal['grid_param_jonstable'])
model_type
pydantic-field
¶
model_type: Literal["grid_param_jonstable"] = (
"grid_param_jonstable"
)
Model type discriminator
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
Subset of variables to extract from the dataset
coords
pydantic-field
¶
coords: Optional[DatasetCoords] = DatasetCoords()
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
Version of wave boundary conditions (XBeach default: 3)
hm0_var
pydantic-field
¶
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
¶
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
¶
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
¶
Variable name of the gamma parameter in the source data, or alternatively a constant value to use for all times
dspr_var
pydantic-field
¶
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
¶
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.
get
¶
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 |
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
bcfile_source(XBeachDataBlob) -
id(Literal['jonstable']) -
model_type(Literal['file_jonstable'])
model_type
pydantic-field
¶
model_type: Literal['file_jonstable'] = 'file_jonstable'
Model type discriminator
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
Version of wave boundary conditions (XBeach default: 3)
check_for_typos
classmethod
¶
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.
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:
-
source(SOURCE_SPECTRA_TYPES) -
filter(Optional[Filter]) -
variables(Optional[list[str]]) -
coords(DatasetCoords) -
crop_data(bool) -
buffer(float) -
time_buffer(list[int]) -
location(Literal['offshore']) -
sel_method(Literal['idw', 'nearest']) -
sel_method_kwargs(dict) -
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
filelist(bool) -
id(Literal['swan']) -
model_type(Literal['station_spectra_swan'])
model_type
pydantic-field
¶
model_type: Literal["station_spectra_swan"] = (
"station_spectra_swan"
)
Model type discriminator
source
pydantic-field
¶
source: SOURCE_SPECTRA_TYPES
Dataset source reader, must support CRS and have wavespectra accessor
filter
pydantic-field
¶
Optional filter specification to apply to the dataset
variables
pydantic-field
¶
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
¶
Number of source data timesteps to buffer the time range if filter_time is True
location
pydantic-field
¶
location: Literal['offshore'] = 'offshore'
Location to extract the data from the source dataset
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
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
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 |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
XBeach parameters including wbctype, bcfile, and wave boundary settings. |
check_for_typos
classmethod
¶
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.
plot
¶
plot(
param,
isel={},
model_grid=None,
cmap="turbo",
figsize=None,
fscale=10,
borders=True,
land=True,
coastline=True,
**kwargs,
)
Plot the grid.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
bcfile_source(XBeachDataBlob) -
filelist(bool) -
id(Literal['swan']) -
model_type(Literal['file_swan'])
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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.
check_for_typos
classmethod
¶
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.
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
¶
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¶
Fields:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
id(Literal['off']) -
model_type(Literal['off'])
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
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
¶
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.
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:
-
nmax(Optional[float]) -
wbcevarreduce(Optional[float]) -
bclwonly(Optional[bool]) -
swkhmin(Optional[float]) -
wbcRemoveStokes(Optional[bool]) -
wbcScaleEnergy(Optional[bool]) -
cyclicdiradjust(Optional[bool]) -
taper(Optional[float]) -
ARC(Optional[bool]) -
freewave(Optional[bool]) -
thetamin(Optional[float]) -
thetamax(Optional[float]) -
dtheta(Optional[float]) -
dtheta_s(Optional[float]) -
thetanaut(Optional[bool]) -
order(Optional[Literal[1, 2]]) -
rt(Optional[float]) -
dtbc(Optional[float]) -
dthetas_xb(Optional[float]) -
tm01switch(Optional[bool]) -
correcthm0(Optional[bool]) -
fcutoff(Optional[float]) -
nonhspectrum(Optional[Literal[0, 1]]) -
nspectrumloc(Optional[int]) -
nspr(Optional[bool]) -
random(Optional[bool]) -
sprdthr(Optional[float]) -
trepfac(Optional[float]) -
wbcversion(Optional[Literal[1, 2, 3]]) -
id(Literal['reuse']) -
model_type(Literal['reuse']) -
previous_run(XBeachDirectoryBlob)
previous_run
pydantic-field
¶
previous_run: XBeachDirectoryBlob
Directory containing ebcflist.bcf and qbcflist.bcf files from a previous XBeach simulation.
nmax
pydantic-field
¶
Maximum ratio of cg/c for computing long wave boundary conditions (XBeach default: 0.8)
wbcevarreduce
pydantic-field
¶
Reduction factor of short-wave group variance at the boundary (XBeach default: 1.0, no reduction)
bclwonly
pydantic-field
¶
Switch to run boundary conditions with long waves only (XBeach default: 0)
swkhmin
pydantic-field
¶
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
¶
Switch to remove long wave Stokes drift component at the offshore boundary (XBeach default: 1)
wbcScaleEnergy
pydantic-field
¶
Switch to correct random time series of wave height to exactly match input Hm0 (XBeach default: 1)
cyclicdiradjust
pydantic-field
¶
Adjust alongshore wave length to fit inside domain with cyclic boundary conditions (XBeach default: 0)
taper
pydantic-field
¶
Spin-up time of wave boundary conditions, in morphological time (XBeach default: 100.0)
ARC
pydantic-field
¶
Switch for active reflection compensation at seaward boundary. Compensates for spurious long wave reflection (XBeach default: 1)
freewave
pydantic-field
¶
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
¶
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
¶
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
¶
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
¶
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
¶
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 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)
rt
pydantic-field
¶
Duration (s) of wave spectrum at offshore boundary, in morphological time (XBeach default: min(3600.d0, tstop))
dtbc
pydantic-field
¶
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
¶
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
¶
Switch to enable tm01 rather than tm-10 (XBeach default: 0)
correcthm0
pydantic-field
¶
Switch to enable hm0 correction (XBeach default: 1)
fcutoff
pydantic-field
¶
Low-freq cutoff frequency in Hz for jons, swan or vardens boundary conditions (XBeach default: 0.0)
nonhspectrum
pydantic-field
¶
Spectrum format for wave action balance of nonhydrostatic waves (XBeach default: 0)
nspectrumloc
pydantic-field
¶
Number of input spectrum locations (XBeach default: 1)
nspr
pydantic-field
¶
Switch to enable long wave direction forced into centres of short wave bins (XBeach default: 0)
random
pydantic-field
¶
Switch to enable random seed for jons, swan or vardens boundary conditions (XBeach default: 1)
sprdthr
pydantic-field
¶
Threshold ratio to maximum value of s above which spectrum densities are read in (XBeach default: 0.08)
trepfac
pydantic-field
¶
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
¶
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
¶
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.