rompy.swan.boundary.Boundnest1#

pydantic model rompy.swan.boundary.Boundnest1[source]#

SWAN BOUNDNEST1 NEST data class.

Fields:
Validators:
field buffer: float = 2.0#

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth')#

Names of the coordinates in the dataset

field crop_data: bool = True#

Update crop filter from Time object if passed to get method

field filter: Filter | None [Optional]#

Optional filter specification to apply to the dataset

field grid_type: Literal['boundary_wave_station'] = 'boundary_wave_station'#

Model type discriminator

field id: str [Required]#

Unique identifier for this data source

Whether to create a symbolic link instead of copying the file

field model_type: Literal['boundnest1', 'BOUNDNEST1'] = 'boundnest1'#

Model type discriminator

field rectangle: Literal['closed', 'open'] = 'closed'#

Defines whether boundary is defined over an closed or open rectangle

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

Wavespectra method to use for selecting boundary points from the dataset

field sel_method_kwargs: dict = {}#

Keyword arguments for sel_method

field source: SPEC_BOUNDARY_SOURCE_MODELS [Required]#

Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method

field spacing: float | Literal['parent'] | None = None#

Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the get method. If ‘parent’, the resolution of the parent dataset is used to define the spacing.

Validated by:
  • spacing_gt_zero

field time_buffer: list[int] = [0, 0]#

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

field variables: list[str] | None = []#

Subset of variables to extract from the dataset

get(destdir: str, grid: SwanGrid, time: TimeRange | None = None) str[source]#

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – Destination directory for the SWAN ASCII file.

  • grid (RegularGrid) – Grid instance to use for selecting the boundary points.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

  • filename (Path) – The filename of the written boundary file.

  • cmd (str) – Boundary command string to render in the SWAN INPUT file

model_post_init(context: Any, /) None#

We need to both initialize private attributes and call the user-defined model_post_init method.