wavespectra.partition.partition.Partition.bbox#

Partition.bbox(bboxes)[source]#

Partition based on user-defined bounding boxes in frequency-direction space.

BBOX partitions the spectra based on user-defined bounding boxes in frequency-direction space.

Args:
  • bboxes (list(dict)): List of dictionaries with keys fmin, fmax, dmin and dmax specifying the boundaries of each bounding box.

Returns:
  • dspart (xr.Dataset): Partitioned spectra with extra part dimension with indices ordered as in the list of dictionaries.

Note:
  • Non-specified bounds in each bbox dict are defined from the bounds of the freq / dir bounds in the spectrum, e.g., fmin=min(freq).

  • Bounding boxes must not overlap.

  • Last part index is defined by spectral bins not covered by any bboxes.

TODO: Deal with directions crossing 360.