Closed lkilcher closed 9 years ago
This problem had to do with applying rotations only to a portion of the rotation matrix (.orientmat[:2,:2]
). For some reason I messed up the linear-algebra here. Commit 59028fb51ad4275f688d0384530a3e0c2c4c2ed1 fixed this issue.
The bad-plot above now looks like this,
Yay! :)
Also, as a side note, the reason declination was messing up velocity is because it was applied to .orientmat
before data was rotated. The .orientmat
was also getting messed up during the earth2principal
call, but that was an 'after rotation' change to .orientmat
, so it didn't mess up the data.
The velocity magnitude changes when motion correction is applied even when motion signals are set to zero (
dat.Accel[:] = 0; dat.AngRt[:] = 0
). This SHOULD NOT be happening.For example, using a data file from a 'Turbulence Torpedo' deployment, the following code:
Generates this figure,
So, the question is clearly, why is the magnitude of the velocity different (second panel is non-zero) when the motion signals (third panel) are zero?
Note here that this issue is not particularly large when the declination is not specified. Also note that this appears to be related to something going wrong with the orientation matrix:
The determinant of the orientation matrix after motion-correction is non-zero?!! This is no good. Also, the orientation matrix is non-zero even when I comment out the
dat.props['declination'] = 14.5
line. In that case, I get:Why does this problem exist? Why does changing declination mess up the velocity magnitude, but the orientation matrix gets messed up - differently - either way.