I am trying to calculate the International Space Station (ISS) LVLH (Local-Vertical-Local-Horizontal) base vectors expressed in the ECEF/ITRF frame at a given time. The point is then to calculate the rotation matrix to rotate vectors in ECEF to LVLH (and vice-versa).
I have a procedure to do that, but I am not sure if it is done properly. So that's why I am asking help here to check what I am doing, presented next.
The ISS LVLH frame is defined as in the following picture:
Lets consider a specific time: 2019-Mar-24 00:31:53.135444 UTC.
First, the Skyfield library in Python is used to get the ISS position and its velocity vector for a specific time using the ITRF_position_velocity_error method of the sgp4lib.EarthSatellite class :
Longitude (deg), Latitude (deg), Altitude (km) : 55.34071583, 0.10055032, 408.59435164
Position unit vector (ITRF) : R == (0.56869428, 0.82254713, 0.00174319)
Velocity unit vector (ITRF) : V == (-0.47416977, 0.33092048, -0.81587662)
(The used TLE is :
1 25544U 98067A 19083.06129885 -.00367384 00000-0 -62017-2 0 9991
2 25544 51.6362 64.4008 0003657 146.0534 252.6576 15.52294152162032)
Then the LVLH X-Y-Z base vectors are calculated with :
Z = - R / ||R||
Y = Z X V
EDIT: should be : Y = Z X V / ||Z X V||
X = Y X Z
Which, in this case gives the values:
X = (-0.47480547, 0.33000101, -0.81587857)
Y = ( 0.67167383, -0.4631578 , -0.57821957)
Z = (-0.56869428, -0.82254713, -0.00174319)
Then, calculating the rotation matrix and inverting it is straightforward.
Is this method correct ?
Thanks in advance for the help.