Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidal prf #5

Merged
merged 3 commits into from
Aug 7, 2023
Merged

Tidal prf #5

merged 3 commits into from
Aug 7, 2023

Conversation

ssolson
Copy link

@ssolson ssolson commented Aug 4, 2023

Merge MHKiT-Software#232 & resolve conflicts in adcp example

mbruggs and others added 3 commits July 31, 2023 09:32
* Prevent nan values for zero-frequency component in spectrum

Previously providing a zero frequency when creating a spectrum (JONSWAP or Pierson Moskowitz) produced a NaN value. This is due the f^-5 and f^-4 terms in the calculation.

The zero frequency is a valid input and is important when calculating the surface elevation from the spectrum. We know, however, that the zero frequency should __always__ have zero amplitude as the surface elevation has a mean of zero.

This change ensures that if a zero frequency is provided, the amplitude is set to zero.

* Compute surface elevation using IFFT

Previously the surface elevation was only computed using the 'sum of sines' method. This has been found to be prohibitively slow when computing long duration surface elevation traces.

This commit introduces the capability to compute the surface elevation using the more computationally efficient IFFT. The IFFT routine is used by default if no frequency bins are provided and the input frequency vector is equally spaced.

For example a 1hr sea state realisation at 20Hz took 11s to compute using the 'sum of sines' and 0.007s using the IFFT.

Fixes MHKiT-Software#229

* add docstrings to surface_elevation

* update surface_elevation calls in examples

---------

Co-authored-by: akeeste <[email protected]>
A slew of bugfixes and inconsistency cleanup, as well as including ADCP turbulence functionality for MHKiT-Software#227

Changelog:

Bugfixes

Added check to ensure n_bin is shorter than the total data length when calling dolfyn.TimeBinner.reshape
Added checks to ensure n_fft and n_fft_coh can't be greater than n_bin
Fixed bug where dolfyn.adp.nan_beyond_surface overtrimmed TRDI instrument data
Fixed bug where dolfyn.ADVBinner.cross_spectral_density would fail if n_fft != n_fft_coh
Improved robustness of Nortek Signature reader for deployments not measuring water velocity
log file extension changed from ".log" to ".dolfyn.log"
API/Useability

Calculation of depth from pressure sensor updated to use linear approximation of the equation of state, rather than EOS-80
Added warnings for ADV motion and turbulence functions
Updated dataset.velds.U_dir shortcut to automatically convert "degrees CCW from X/East/streamwise" to "degrees CW from X/North/streamwise"
dolfyn.ADVBinner.cross_spectral_density now returns frequency coordinate coh_freq instead of freq
Added ADCP turbulence functions
Added function to calculate Doppler noise to ADV turbulence functions
Added "beam_angle" attribute to Nortek Signature datasets
Saved full Nortek Signature "config" dictionary as json string in attributes
Added warning if "rotate_vars" attribute not found
Standardized variable metadata based on CF conventions
@jmcvey3 jmcvey3 merged commit 1b7c1ef into jmcvey3:tidal_prf Aug 7, 2023
@ssolson ssolson deleted the tidal_prf branch April 16, 2024 14:55
jmcvey3 pushed a commit that referenced this pull request Jul 2, 2024
* fix cdip

* D3D TRTS eg fix

* fix pylint error

* pylint

* fix too many branches

* fix map and Tp

* folium fix & Tp using pandas

* up to python 3.10

* py version as string

* fix variable check for new xarray

* undo changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants