There is an error in the conversion from spherical geocentric coordinates and RLL coordinates. To see this in action, consider the following simple example:
onera_desp_lib_rotate(onera_desp_lib_rotate([1,45,60],'SPH2RLL'),'RLL2SPH')
This should print the following:
[ 1 45 60]
While the conversion to geodetic coordinates is not strictly exact, we should expect that the conversion to and from RLL coordinates should return roughly the same initial vector. This is not the case, however
[75.007 45.19 60]
Clearly there is a serious error in this conversion process, as the final coordinate is starkly different from the input coordinate. I have traced the culprit to the following code from CoordTrans.f, on line 1853:
xOUT(1)=SQRT(xIN(1)*xIN(1)+xIN(2)*xIN(2)+xIN(3)*xIN(3))
I seems that the RLL radius is being calculated from the norm of the spherical geocentric coordinate rather than the cartesian geocentric coordinate. I believe that line 1853 should be replaced by something like:
xOUT(1)=xIN(1)
i.e., setting it to the geocentric radius of the input point.
Change made in r619.
I don't think I have permissions close this ticket though...
Last edit: Steve Morley 2020-04-03
closing for Steve.