seafloor-geodesy / gnatss

Community Seafloor Global Navigation Satellite Systems - Acoustic (GNSS-A) Transponder Surveying Software
https://gnatss.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
10 stars 14 forks source link

Add a way to compute e,n,u components from residuals #149

Closed lsetiawan closed 11 months ago

lsetiawan commented 1 year ago

@johnbdesanto could you paste here:

  1. a transponders xyz
  2. array center coordinates used
  3. enu computed
  4. the azimuth angle computed
  5. the look angle computed

If you can point me to a resource on how you computed these azimuth and look angles that would be really great! Additionally, the formula for residuals (cm) -> e,n,u components. Thank you so much!

lsetiawan commented 1 year ago

From your script with gmtmath. I think I found that the equation is the following to compute the enu components from the residuals

def calc_enu_comp(residuals, az, el):
    # az is the azimuth angle in degrees
    # el is the look angle or elevation in degrees
    res_north = np.mean(residuals * np.sin(np.radians(az)) * np.sin(np.radians(el)))
    res_east = np.mean(residuals * np.cos(np.radians(az)) * np.cos(np.radians(el)))
    res_vert = np.mean(residuals * np.cos(np.radians(el)))

    return np.array([res_east, res_north, res_vert])

Please let me know if this is correct. One thing to note is that I did not divide by 2 here since the residuals are already a one way travel time residual value rather than 2. I assume that is the purpose of the division by 2? Please correct me if I'm wrong @johnbdesanto. Thanks!

johnbdesanto commented 1 year ago

The formula you posted are correct. You are also right in getting rid of the factor of 2, which is there because I assumed the residuals were two way. We have since shown that not to be the case, so it should be removed.

johnbdesanto commented 1 year ago

For calculating the angles, say that t_n, t_e, and t_d are the north, east, and depth (positive down) of the transponder in meters and c_n, c_e are the north and east of the array center, also in meters (assume 0 depth for the center since it's at sea level). Then,

az = ATAN[ (t_n-c_n)/(t_e-c_e) ], alternatively ATAN2[ (t_n-cn), (t_e-c_e) ] el = ATAN[ SQRT[ (t_n-c_n)^2 + (t_e-c_e)^2 ]/t_d ], alternatively ATAN2[ SQRT[ (t_n-c_n)^2 + (t_e-c_e)^2 ], t_d ]

There is no real reference for this, just basic trig that I drew out. In the past, I have calculated t_n, t_e, c_n, c_e by converting the a priori coordinates to UTM. However, with the python tools we have we should be able to directly compute t_n-c_n and t_e-c_e by converting the transponder a priori position to ENU coordinates with the array center as the origin.

johnbdesanto commented 1 year ago

For a sanity check, consider NCL1, whose transponders and center have the following a priori:

 0    08       45.302064471    -124.978181346    -1176.5866     0.200000d0       1480.767
 1    12       45.295207747    -124.958752845    -1146.5881     0.320000d0       1480.816
 2    22       45.309643593    -124.959348875    -1133.7305     0.440000d0       1480.850

45.3023d0 -124.9656d0 ! Latitude/Longitude array center (decimal degrees)

For this array, I calculated the following azimuth and look angles for the transponders:

Fetch 08 Azi Angle: -179.9, Look Angle: 39.99

Fetch 12 Azi Angle: -57.16, Look Angle: 39.74

Fetch 22 Azi Angle: 57.61, Look Angle: 40.02

lsetiawan commented 1 year ago

@madhavmk I'll share with you some implementation code so you can implement the routine.

lsetiawan commented 12 months ago

Update: @madhavmk I just went ahead and implemented the routine and plotting code for this on PR #174.

madhavmk commented 11 months ago

Thanks for the PR pointers @lsetiawan . I am taking a look at them.