MHKiT-Software / MHKiT-Python

MHKiT-Python provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
47 stars 45 forks source link

Compute surface elevation using IFFT #250

Closed mbruggs closed 11 months ago

mbruggs commented 11 months ago

As discussed in #229 computing the surface elevation using the 'sum of sines' method is slow. Instead, we can use an IFFT which drastically increases performance. The IFFT method is used as the default when no frquency bins are provided and the frequency vector is equally spaced.

To compute the IFFT the zero frequency must be defined. The spectrum methods have been updated to avoid NaN values in the presence of the zero frequency. This means that spectrum and surface elevations functions work seamlessly together.

ssolson commented 11 months ago

@mbruggs you da man.

Looking this over I think we can get this in our next release for mid-August. I promise to get you a review before then. Currently, I am reviewing several other PRs for the next release so my review of this may be a week or so out.

Thank you so much for this contribution!

ssolson commented 11 months ago

@akeeste could you review Mark's application of the IFFT? I am looking for help reviewing the application of the technique as I am not familiar with it.

akeeste commented 11 months ago

@ssolson Yes definitely. @mbruggs I'll review this PR next week