Closed trufanov-nok closed 1 year ago
Hi @trufanov-nok !
You need to pass all the EOP data instead of just the LOD:
using SatelliteToolbox
using Dates
r = [4.311678750265122e+06, -3.090624111700405e+06, 4.284610045293988e+06]
v = [3.147249615634850e+03, -3.764293063945658e+03, -5.865605641177310e+03]
# Epoch in [s] since J2000 epoch Terrestrial Time
t = 732341388.184000
t = 946728000 + t
t = Dates.unix2datetime(t)
t = datetime2julian(t)
sv = orbsv(t, r, v)
eop = get_iers_eop()
sv_ecef_to_eci(sv, ITRF(), TEME(), t, eop)
epoch : 2.46002e6 (2023-03-17T16:09:48.184)
r : [4925.69, 1969.78, 4284.61] km
v : [4.72293, 0.984993, -5.8656] km/s
I have two important points:
rv_to_mean_elements_sgp4
and rv_to_tle
.The conversion from ECEF to ECI using the state vector considers that the velocity in ECEF is also measured in the ECEF, meaning that the Earth rotation rate will be subtracted.
Is this subtraction performed automatically?
Do you know that we have here a tool to convert the RV measurements from GPS to TLE? We used this tool for some applications in a satellite developed here in Brazil. See the functions
rv_to_mean_elements_sgp4
andrv_to_tle
.
Great to hear! I didn't know that, thank you. At least I don't need to run DOS program on linux machine anymore.
Both functions seems to expect vectors represented in TEME reference frame, so I still need sv_ecef_to_eci
.
Is this subtraction performed automatically?
Yes! It will always remove the Earth rotation rate if you use sv_ecef_to_eci
.
Great to hear! I didn't know that, thank you. At least I don't need to run DOS program on linux machine anymore. Both functions seems to expect vectors represented in TEME reference frame, so I still need sv_ecef_to_eci.
Yes! Indeed, you need to pass vectors represented in TEME. If you want a code snipped how to use the TLE estimation, take a look a this test file: https://github.com/JuliaSpace/SatelliteToolbox.jl/blob/master/test/orbit/mean_elements/sgp4.jl
Ah! Notice that rv_to_tle
actually estimates and orbit. It is not just a conversion from a state vector to SGP4 mean elements. You can provide a list of vectors (like GPS measurements), and it returns the mean elements obtained by a least square algorithm.
Hello!
I don't know julia language so may be missing something...
I would like to try to propagate a State Vector obtained from GPS with SGP4. Thus I need to construct a TLE (with help of RV2TLE tool) with state vector in TEME. So I would like to convert it from ITRF (GPS) to TEME. My code is:
Unfortunately I'm getting
ERROR: MethodError: no method matching sv_ecef_to_eci(::OrbitStateVector{Float64, Float64}, ::Val{:ITRF}, ::Val{:TEME}, ::Float64, ::Float64)
.Am I missing something or direct conversion between ITRF and TEME is not supported?