../_images/calypso.png

toto.core.toolbox

toto.core.toolbox.PolyArea(x, y)[source]
toto.core.toolbox.cart2pol(x, y)[source]
toto.core.toolbox.cart2sph(x, y, z)[source]
toto.core.toolbox.degToCompass(num)[source]
toto.core.toolbox.dir_interval(dir_swath=45, mode='centred')[source]
toto.core.toolbox.display_message()[source]
toto.core.toolbox.do_occurence(dpm, min_occ)[source]
toto.core.toolbox.dyadlength(x)[source]

% dyadlength – Find length and dyadic length of array % Usage % [n,J] = dyadlength(x) % Inputs % x array of length n = 2^J (hopefully) % Outputs % n length(x) % J least power of two greater than n % % Side Effects % A warning is issued if n is not a power of 2. % % See Also % quadlength, dyad, dyad2ix %

toto.core.toolbox.get_increment(data, s)[source]
toto.core.toolbox.get_number_of_loops(time_blocking)[source]
toto.core.toolbox.get_opt(var, label_name, default)[source]
toto.core.toolbox.get_seasons(typ)[source]
toto.core.toolbox.lanc(numwt, haf)[source]

Generates a numwt + 1 + numwt lanczos cosine low pass filter with -6dB (1/4 power, 1/2 amplitude) point at haf

Function from Oceans Toolbox Parameters ———- numwt : int

number of points

haffloat

frequency (in ‘cpi’ of -6dB point, ‘cpi’ is cycles per interval. For hourly data cpi is cph,

Examples

>>> from oceans.filters import lanc
>>> import matplotlib.pyplot as plt
>>> t = np.arange(500)  # Time in hours.
>>> h = 2.5 * np.sin(2 * np.pi * t / 12.42)
>>> h += 1.5 * np.sin(2 * np.pi * t / 12.0)
>>> h += 0.3 * np.random.randn(len(t))
>>> wt = lanc(96+1+96, 1./40)
>>> low = np.convolve(wt, h, mode='same')
>>> high = h - low
>>> fig, (ax0, ax1) = plt.subplots(nrows=2)
>>> _ = ax0.plot(high, label='high')
>>> _ = ax1.plot(low, label='low')
>>> _ = ax0.legend(numpoints=1)
>>> _ = ax1.legend(numpoints=1)
toto.core.toolbox.peaks(y)[source]
return peaks and trough indx

from Nagi Hatoum peaks.m

copyright 2005

toto.core.toolbox.qkhfs(w, h)[source]

Quick iterative calculation of kh in gravity-wave dispersion relationship kh = qkhfs(w, h )

Input

w - angular wave frequency = 2*pi/T where T = wave period [1/s] h - water depth [m]

Returns

kh - wavenumber * depth [ ]

Orbital velocities from kh are accurate to 3e-12 ! RL Soulsby (2006) “Simplified calculation of wave orbital velocities” HR Wallingford Report TR 155, February 2006 Eqns. 12a - 14 from https://github.com/csherwood-usgs/crspy/blob/master/crspy.py

toto.core.toolbox.spdir2uv(spd, direc, origin='going to')[source]
toto.core.toolbox.sph2cart(azimuth, elevation, r)[source]
toto.core.toolbox.uv2spdir(u, v, origin='going to')[source]
toto.core.toolbox.wavenuma(ang_freq, water_depth)[source]

Chen and Thomson wavenumber approximation.