ufrgs-gnss-lab / geo-alhazen

Modeling of reflection on a sphere
1 stars 0 forks source link

Return geocentric coordinates #34

Open fgnievinski opened 1 year ago

fgnievinski commented 1 year ago

converting from osculating sphere

need to input geodetic coordinates of receiver (lat lon h)

also need satellite azimuth.

then call get_sphere_osculating to shift the origin

and apply a rotation

might also start with #11

fgnievinski commented 1 year ago

it's explained in section 3.1 https://lume.ufrgs.br/handle/10183/231573 image

vitorhjr commented 1 year ago

I have some questions:

vitorhjr commented 1 year ago

We have not defined the rotation matrix of eq. 34: Where can I find the matrix?

I guess it is the Jacobian matrix called in convert_from_local_cart.m

vitorhjr commented 1 year ago

Draft of steps to get geocentric coordinates of reflection point

I'm having a bit of difficulty finding the correct way to transform geocentric coordinates. I didn't find in the dissertation how to get X and Y quasigeocentric coordinates of reflection point and then transform into cartesian.

I build this draft to confirm with you if the transformation is correct:

1- Define the base point (antenna's foot) to the cartesian coordinates with get_sphere_osculating.m (eq. 37 of dissertation) 2- Define the center of the osculating sphere in the global cartesian coordinates (eq. 36 of dissertation) 3- Define X and Y on the quasigeocentric frame based on X distance and azimuth (maybe [X'=Xsind(az), Y'=Xcosd(az)]?). The quasigeocentric coordinates of reflection point on quasigeocentric frame is R'_s = [X' Y' Z'=Y] 4- Transform the reflection point to the global cartesian frame (eq. 35)

fgnievinski commented 1 year ago

please try to use some of the following functions:

vitorhjr commented 1 year ago

Is not the function convert_local_sph2cart.m is not an option to get the 3D reflection point on the quasigeo frame?

Or then pol2cart.m function only to get Y with azimuth, as I have X and Z.

fgnievinski commented 1 year ago

function convert_local_sph2cart only converts from spherical (elevation angle, azimuth, slant distance) to Cartesian coordinates (East, North, Vertical) in the standard local tangent plane frame. it does not change the frame.

to convert to the geocentric frame, you can start from the local frame or from the quasi-geocentric frame. function convert_from_local_cart converts from the standard local frame directly to the geocentric frame and function convert_to_sphnrm is the inverse. so, you can skip the quasi-geocentric frame.

the only part missing is converting from the specific local frame, aligned with the satellite azimuth, to the standard local frame, aligned with north. so, you'll need to apply a rotation around the vertical or zenithal axis. function convert_to_local_ray shows how to apply the rotations; it includes a second rotation which you don't need.

here's a sketch, plesae document the input and output:

function [pt_geoc_cart, pt_geod] = convert_from_local_cart2 (azim, pt_local_cart2, base_geod, ell)
    n = size(pos_local,1);
    pt_local_cart3 = [pt_local_cart2(:,1) zeros(n,1) pt_local_cart2(:,2)];
    pt_local_cart = myrotate([0,0,90-azim], pt_local_cart3);
    [pt_geoc_cart, pt_geod] = convert_from_local_cart2 (pt_local_cart, base_geod, ell);
end
vitorhjr commented 1 year ago

I've upload the new function get_osculating_spherical_reflection.m to return the geocentric coodinates. The position of specular reflection is the first output. It is a struct with local quasigeocentric cartesian coordinates, geocentric cartesian coordinates and geodetic coordinates. I prefer the struct to retrieve the specular position in all frames and for all heights and elevation angles involved. If it is not helpful, I can reformulate the outputs.

I've also uploaded the following auxiliary functions:

To demonstrate the get_osculating_spherical_reflection, I upload the demo_geo_cartesian.

I documented get_osculating_spherical_reflection and convert_from_local_cart3.

vitorhjr commented 1 year ago

I updated the function to return geocentric coordinates on the osculating sphere based on this comment (https://github.com/ufrgs-gnss-lab/atm-interf-rtr-dev/issues/6#issuecomment-1705600389):

These functions get the reflection point on a 2D local frame and convert it to 3D local cartesian, geocentric coordinates, and geodetic coordinates. A demonstration is available at demo_geo_cartesian

Some comments:

vitorhjr commented 1 year ago

In a meeting with @fgnievinski, it was noted that I was rotating the 2D frame incorrectly around the Y-axis instead of the Z-axis. So, I update the function convert_from local axis. The local 2D point [x2 y2] initially turns to 3D as [0 y3=x2 z3=y2]. Then, it is rotated around the Z-axis with the azimuth as pt_local_cart = (myrotate([0,0,az], pt_local_cart2)).

It works well.