mixsea.shearstrain.shearstrain
- mixsea.shearstrain.shearstrain(depth, t, SP, lon, lat, ladcp_u=None, ladcp_v=None, ladcp_depth=None, m=None, depth_bin=None, window_size=None, m_include_sh=array([0, 1, 2, 3]), m_include_st=array([0, 1, 2, 3]), ladcp_is_shear=False, smooth='AL', sh_integration_limit=0.66, st_integration_limit=0.22, window='hamming', return_diagnostics=False)[source]
Compute krho and epsilon from CTD/LADCP data via the shear/strain parameterization.
- Parameters:
depth (array-like) – CTD depth [m]
t (array-like) – CTD in-situ temperature [ITS-90, degrees C]
SP (array-like) – CTD practical salinity [psu]
lon (array-like or float) – Longitude
lat (array-like or float) – Latitude
ladcp_u (array-like, optional) – LADCP velocity east-west component [m/s]. If not provided, only the strain solution with a fixed shear/strain ratio of 3 will be computed.
ladcp_v (array-like, optional) – LADCP velocity north-south component [m/s]
ladcp_depth (array-like, optional) – LADCP depth vector [m]
m (array-like, optional) – Wavenumber vector to interpolate spectra onto
depth_bin (array-like, optional) – Centers of windows over which spectra are computed. Defaults to np.arange(75, max(depth), 150). Note that windows are half-overlapping so the 150 spacing above means each window is 300 m tall.
window_size (float) – Size of depth window [m].
m_include_sh (array-like, optional) – Wavenumber integration range for shear spectra. Array must consist of indices or boolans to index m. Defaults to first 4 wavenumbers.
m_include_st (array-like, optional) – Wavenumber integration range for strain spectra. Array must consist of indices or boolans to index m. Defaults to first 4 wavenumbers.
ladcp_is_shear (bool, optional) – Indicate whether LADCP data is velocity or shear. Defaults to False (velocity).
smooth ({‘AL’, ‘PF’}, optional) – Select type of N^2 smoothing and subsequent strain calculation. ‘AL’ selects the adiabatic leveling method as applied in strain_adiabatic_leveling. ‘PF’ selects second order polynomial fits to the buoyancy frequency in each window as applied in strain_polynomial_fits. Defaults to the adiabatic leveling method.
sh_integration_limit (float, optional) – Shear variance level for determining integration cutoff wavenumber. Defaults to 0.66, compare Gargett (1990) [4] and Gregg et al. (2003) [6].
st_integration_limit (float, optional) – Strain variance level for determining integration cutoff wavenumber. Defaults to 0.22, compare Gargett (1990) [4] and Gregg et al. (2003) [6].
window (str or tuple, optional) – Window type. Defaults to ‘hamming’ (which corresponds to a sin square taper as used in various studies. See scipy.signal.get_window for details.
return_diagnostics (bool, optional) – Default is False. If True, this function will return a dictionary containing variables such as shear spectra, shear/strain ratios,
- Returns:
eps_shst (array-like) – Epsilon calculated from both shear and strain spectra
krho_shst (array-like) – krho calculated from both shear and strain spectra
diag (dict, optional) – Dictionary of diagnostic variables, set return with the return_diagnostics’ argument. `diag holds the following variables:
"P_shear"Matrix of shear spectra for each depth window (array-like).
"P_strain"Matrix of strain spectra for each depth window
"Mmax_sh"Cutoff wavenumber kc (array-like).
"Mmax_st"Cutoff wavenubmer used for strain only calculation (array-like).
"Rwtot"Shear/strain ratio used, computed from spectra unless specificed in input (array-like).
"krho_st"krho calculated from strain only (array-like).
"eps_st"Epsilon calculated from strain only (array-like).
"m"Wavenumber vector (array-like).
"depth_bin"Center points of depth windows (array-like).
"strain"Results from strain calculation (dict).
"Int_sh"Results from shear variance integration (array-like).
"Int_st"Results from strain variance integration (array-like).
Notes
Adapted from Jen MacKinnon and Amy Waterhouse.