NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/adcp/trunk/adcp/diwasp_1_1GD/private/Hsig.m

Revision 168 (checked in by cbc, 16 years ago)

Adding diwasp customizations.

Line 
1 function Hs=Hmo(varargin)
2 %DIWASP V1.1 function to calculate significant wave height
3 %
4 %Hs=Hsig(SM)
5 %
6 %Hs is 4 times the zeroth moment wave height of spectral matrix SM
7 %
8 %"help data_structures" for information on the DIWASP data structures
9
10 %Copyright (C) 2002 Coastal Oceanography Group, CWR, UWA, Perth
11
12
13 if nargin==1
14     SM=varargin{1};
15     df=SM.freqs(2)-SM.freqs(1);ddir=abs(SM.dirs(2)-SM.dirs(1));S=SM.S;
16 elseif nargin==3
17     df=varargin{2};ddir=varargin{3};S=varargin{1};
18 end
19
20 Hs=sqrt(16*sum(sum(real(S)*df*ddir)));
Note: See TracBrowser for help on using the browser.