wavespectra.construct.partition_and_reconstruct#

wavespectra.construct.partition_and_reconstruct(dset, parts=4, freq_name='jonswap', dir_name='cartwright', partition_method='ptm3', method_combine='max', use_defaults=['alpha'])[source]#

Partition and reconstruct existing spectra to evaluate.

Args:
  • dset (SpecDataset): Spectra object to partition and reconstruct.

  • parts (int): Number of partitions to use in reconstruction.

  • freq_name (str, list): Name of a valid fit function, e.g. jonswap, or a list of names with len=`parts` to define one fit function for each partition.

  • dir_name (str, list): Name of a valid directional spread function, e.g. cartwright, or a list of names with len=`parts` to define one directional spread function for each partition.

  • partition_method (str): Partitioning method, either ptm1, ptm2 or ptm3.

  • method_combine (str): Method to combine partitions when reconstructing.

  • use_defaults (list): List of default parameters to use in the construct shape functions, i.e., those that are not calculated from the input spectra.

Returns:
  • dsout (SpecArray): Reconstructed spectra with same coordinates as dset.

Note:
  • The ptm3 partitioning method is used by default in which wind sea and swell systems are not distiguished or merged together.

  • If freq_name or dir_name are str, the functions specified by these arguments are applied to all sea and swell partitions.