Beam2ENU

by kep last modified Apr 02, 2007 12:23 AM
Up to Waves

Beam2ENU

Posted by kep at March 28. 2007
I'm sorry that I have posted so many questions recently!  I appreciate your responses.

I have been using Beam2ENU Matlab script on the Beam data in the wad file (see previous topic), and have it running successfully (I think).  However, the output velocities seem to high (being significantly greater than the beam velocities).  Is that what I should expect.  The output velocities also seem too high, given my knowledge of the site.

Here is a sample of the input and output (2 data points)

Heading 205.2
Pitch -1
Roll -1.5

Beam1 Beam2 Beam3 x y z e n u
-0.1 0.906 -0.033 -0.84659082 -1.28287207 0.284213379 -0.795602648 1.30375017 0.332424322
0.024 0.842 -0.057 -0.581556641 -1.228223633 0.297449707 -0.85877527 1.040382514 0.339598304

Thank you.

Kevin
Current state: Being created

Beam2ENU

Posted by kep at March 28. 2007
Hi Kevin,

Just keep asking, I am sure you are not the only one having these questions  <img src=" />:)'>

After the clarification in the previous topic I guess the question now is how to convert from XYZ to ENU coordinates. So I have added a Matlab-script to do that.

This is a general script, for those of you who want to use it for other instruments, remember to substitute the beam to xyz transformation matrix with the actual values from the header file. The script takes into account the orientation of the system that is reported in the status byte.

With up orientation, your sample data point then becomes
  X        Y         Z        East       North        Up
-0.1   0.906  -0.033   0.8617   -0.2939   -0.0550

Best regards,
Sven Nylund
Current state: Being created

Beam2ENU

Posted by kep at March 28. 2007
Thanks for that Sven.  I have yet to get into xyz coordinates however. In your response, the first three numbers (-0.1   0.906  -0.033) were beam coordinates, not xyz.
I am still using the BEAM coords from the wad file and trying to get to either xyz or enu. From previous correspondence these are from the first wave bin above the blanking distance.

My system is the horizontal (ie it lies flat on the bed) 2MHz ADCP, with the beams pointing up (at 90 degrees to the casing). The Transformation matrix in the header file of this instrument is the same as in the Beam2ENU script that I have been using.  I obtained this script from elsewhere in this forum.

If I call Beam2ENU with the [Beam1; Beam2; Beam3] data
[-0.1;   0.906;  -0.033]  
this is what I get returned:

MATLAB command window (with some line breaks removed)

>> heading=205.2
heading =
 205.2000
>> pitch=-1
pitch =
   -1
>> roll=-1.5
roll =
  -1.5000
>> beam=[-0.1;0.906;-0.033]
beam =
  -0.1000
   0.9060
  -0.0330

>> [enu, xyz] = Beam2ENU(heading, pitch, roll, beam)

enu =
  -0.7956
   1.3038
   0.3324

xyz =
  -0.8466
  -1.2829
   0.2842
>>

I can't see the problem in the function Beam2ENU, but these numbers seem way too high.  I wonder if it is because I am using a horizontal instrument, and heading, pitch or roll is handled wrongly in Beam2ENU. For example, even though the numbers in the transformation matrix are the same, should they be entered in a different order, or something like that.

Again, any help would be appreciated.

Kevin
Current state: Being created

Beam2ENU

Posted by kep at March 29. 2007
Hi Kevin,

The point I made (or at least tried to make ??? ) in the previous thread was that the data in the converted .wad file is in XYZ coordinates in your case. So since what you thought were beam coordinates are in fact XYZ coordinates instead, I converted them into ENU.

As long as you work with the ASCII .wad file and the Aquadopp Profiler, the data you import will be in the same coordinate system as you configured the instrument for.

AWAC users should take note that this is different for the AWAC where the velocity data in the .wad file is in beam coordinates.

Best regards,
Sven Nylund
Current state: Being created

Beam2ENU

Posted by kep at March 29. 2007
That makes sense thanks Sven.  However, that is different from the advice that Torstein gave me in the previous post.

I said:
I am trying to find out what the Velocity fields (10, 11, 12) in the ADCP wad file are.  Persumably they are the velocities used for PUV calculation of wave parameters in STORM.
At setup I nominated XYZ mode, so I presume the fields contain XYZ (as opposed to ENU or Beam data).  However, which bin are these data from?

Torstein replied:

The coordinate system (ENU, XYZ, BEAM) depends on which instrument you use.
If you are using the Aquadopp current meter, then the coordinate system is that which you choose at configuration time.
If you are using the Aquadopp Profiler then the coordinate system is always in BEAM coordinates for the wave burst measurement. The coordinate system you specify in the deployment planning applies to the current profiles only.

Hence the confusion!

Thanks for your help in clearing this up.

Kevin
Current state: Being created

Beam2ENU

Posted by kep at March 30. 2007
Yet another little concern!

Having cleared up the confusion, I ran the (unchanged) xyz2enu script you supplied on the same data point that you tested (see above). Y

Your result:
With up orientation, your sample data point then becomes
 X        Y         Z        East       North        Up
-0.1   0.906  -0.033   0.8617   -0.2939   -0.0550

Here is my output using xyz2enu
>> clear
>> x=-0.1
x =
  -0.1000
>> y=0.906
y =
   0.9060
>> z=-0.033
z =
  -0.0330
>> heading=205.2
heading =
 205.2000
>> pitch=-1
pitch =
   -1
>> roll=-1.5
roll =
  -1.5000
>> status=0
status =
    0
>> [e,n,u]=xyz2enu(x,y,x,heading,pitch,roll,status)

e =
   0.8606
n =
  -0.2921
u =
  -0.1219

The results are very similar, except for the u, which seems to be quite a lot higher than you calculated (and higher than I would have expected). As I have changed nothing in the script, I am not sure what I have done wrong.  Any idea?

Thanks again.

Kevin
Current state: Being created

Beam2ENU

Posted by kep at March 30. 2007
Hi Kevin,

Well, this is really confusing. I really do not understand what might be going on here. I suggest you start out with some really simple numbers which may indicate where the problem is. For example:
» [e, n, u]=xyz2enu(1,0,0,0,0,0,0);disp([e n u])
   0.0000    1.0000   -0.0000

» [e, n, u]=xyz2enu(1,0,0,0,45,0,0);disp([e n u])
        0    0.7071    0.7071

Single stepping through the function while checking each calculation might be something to try.

Best regards,
Sven Nylund
Current state: Being created

Beam2ENU

Posted by kep at April 02. 2007
Hi Sven

I spent some time trying to puzzle this one out.  Then I noticed a small but significant typo - x,y,X,heading,... in my function call.

>> [e,n,u]=xyz2enu(x,y,x,heading,pitch,roll,status)

Sorry to have wasted your time.

Kevin
Current state: Being created
Powered by Ploneboard
Document Actions
Log in


Forgot your password?
New user?