rompy.core.boundary.BoundaryWaveStation#

pydantic model rompy.core.boundary.BoundaryWaveStation[source]#

Wave boundary data from station datasets.

Note

The tolerance behaves differently with sel_methods idw and nearest; in idw sites with no enough neighbours within tolerance are masked whereas in nearest an exception is raised (see wavespectra documentation for more details).

Note

Be aware that when using idw missing values will be returned for sites with less than 2 neighbours within tolerance in the original dataset. This is okay for land mask areas but could cause boundary issues when on an open boundary location. To avoid this either use nearest or increase tolerance to include more neighbours.

Fields:
Validators:

field buffer: float = 2.0#

Space to buffer the grid bounding box if filter_grid is True

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

Model type discriminator

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

Wavespectra method to use for selecting boundary points from the dataset

field source: SourceDataset | SourceFile | SourceIntake | SourceDatamesh | SourceWavespectra [Required]#

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

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

Write the selected boundary data to a netcdf file.

Parameters:
  • destdir (str | Path) – Destination directory for the netcdf 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:

outfile – Path to the netcdf file.

Return type:

Path

model_post_init(context: Any, /) None#

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

property ds#

Return the filtered xarray dataset instance.