r_t_tide Page
I've made some enhancements to Rich Pawlowicz's t_tide
package. Please refer to Leffler and Jay (2009) for details. It now uses robust methods, rather than standard least
squares for the harmonic fitting. This
version requires the Matlab Signal Processing and Statistics Toolboxes.
The changes will eventually be included in the main version of
t_tide, but should be considered an offshoot of t_tide for the moment.
Download the software
: Citation is appreciated if you find the code useful :
Leffler, Keith E and Jay, David A. Enhancing tidal
harmonic analysis: Robust (hybrid L1/L2) solutions. Continental
Shelf Research, 2009, v 29, p 7888.
Notes
r_t_tide has a few differences from t_tide in the parameters passed to the main function r_t_tide. PLEASE read the readme.txt file in the download package.
Summarizing the major differences:
 Observed time must be passed into r_t_tide as the first
parameter, in the Matlabstandard serial time format (ie, output
of datenum).

Passing in latitude does not automatically cause nodal corrections
to be calculated : For nodal corrections, you must pass in the
'nodalcorrflag', true pair (see below), and the latitude value

Passing in a start time is deprecated : To standardize the phases
to Greenwich time, you must pass in the 'greenwichcorrflag',true
pair (also see below).

stats is returned as a fifth return arguement It is the stats
structure returned by Matlab's robustfit.
So an example :
given observed times t and heights or currents x, a basic robust
calculation would look like this :
[name,freq,tidecon,xout,stats] =
r_t_tide(t,x,'method','cauchy','latitude',45.0,'greenwichcorrflag',true,'nodalcorrflag',true);
The structure of tidecon is in the header, lines 132140, and is
the same as standard ttide.