PSD motion correction: nau_correct_HiWinGS.m

1) Computes angles theta, phi & psi for the Hare motion correction and defines Omega matrix for the coordinate transform (lines 16-87).  Various approaches using filter function are commented out in the code.  The current approach sums a slow component with a high-pass filtered, integrated angular rate component.  Slow components for theta and phi are obtained from accx and accy minus G, with the high-pass-filtered component subtracted off.  Slow psi is from heading.

2) Computes “initial conditions” for a digital filter (lines 95-117).  I don’t understand what these values represent.  Also, I’m not sure why they are initialized in lines 104-112 and then recomputed in lines 115-117 using the filtic function.

3) The next step is the usual Edson97 correction (lines 131-217), yielding UVW corrected for platform motion (but not ship speed) in earth coordinates.  This is equivalent to the product I’ve been using for flux calculations, except I set the slow heading (i.e. SCS gyro) to zero in the angles subroutine, leaving UVW in ship coordinates, then apply dual angle rotation to correct W for flow distortion.

4) Next the Hare correction (245-445):
- accelerations and sonic wind are rotated into what appear to be earth referenced coordinates (lines 245-268).  Presumably, this is equivalent to the neaqs_trans function used for Edson97.
- the high-passed components of acceleration are integrated by 1) multiplying by time constant and then 2) low-pass filtering (lines 326-353).  “Initial conditions” are computed from the filtered product with filtic function.  fxyz values are saved.  Don’t understand the significance of this part.  
- platform velocities and sonic winds are then summed to yield the motion-corrected Result.  Only W is lag corrected. (lines 378-456)

Remaining steps are done on 10-min blocks of data:

5) N and E components of ship’s speed are computed from gps sog & cog (lines 529-530), then low-pass filtered (lines 543-551), then removed from the U V components of Hare-corrected winds (lines 564-565).

6) Then mean Platvel UVW over each 10-min block is subtracted from corrected UVW Result (lines 568-585).  This part is a bit confusing.  Mean Platvel should be zero for each component over the hour, I think.  Presumably this corrects for the fact that the 10-min means may not be zero…

7) The above steps are repeated for the Edson97-corrected winds (lines 611-631)

8) Winds are rotated into the mean streamlines.

9) The rest of the script deals with computing 10-min H2O and CO2 flux and bulk met and nav statistics…