JuliaSpace / SatelliteToolbox.jl

A toolbox for satellite analysis written in julia language.
MIT License
249 stars 33 forks source link

Read eop from file #8

Closed tmamedzadeh closed 6 years ago

tmamedzadeh commented 6 years ago

I want to read eop file locally, because ECItoECEF and ECEFtoECEF doesn't work without eop. I downloaded the eop file from here.

eop = read_iers_eop(eop_file, :IAU2000A)

ERROR: LoadError: MethodError: no method matching rECEFtoECEF(::Type{Val{:PEF}}, ::Type{Val{:ITRF}}, ::Float64, ::SatelliteToolbox.EOPData_IAU2000A{Interpolations.Extrapolation{Float64,1,Interpolations.GriddedInterpolation{Float64,1,Float64,Interpolations.Gridded{Interpolations.Linear},Tuple{Array{Float64,1}},0},Interpolations.Gridded{Interpolations.Linear},Interpolations.OnGrid,Interpolations.Flat}})
ronisbr commented 6 years ago

Hi @Tarlan0001,

IAU2000 reductions are not implemented yet. You should download and use the 1980 version.

ronisbr commented 6 years ago

You could get the file here:

https://datacenter.iers.org/eop/-/somos/5Rgv/latest/223

And read the file using

eop = read_iers_eop(eop_file)
tmamedzadeh commented 6 years ago

@ronisbr Is there a way not to use the EOP file, taking some average value? I'm propagating to the future, and the current data is useless...

helgee commented 6 years ago

@Tarlan0001 What is your use case? If you are propagating far into the future, i.e. further than one year, it probably makes sense to use a lower precision Earth-fixed frame (e.g. IAU_EARTH in SPICE parlance).

tmamedzadeh commented 6 years ago

@helgee Yes, I'm propagating further than 1 year. Could you, please, explain in more detail what should I do for optimal solution? Shouldn't I use this library?

helgee commented 6 years ago

@ronisbr Did you implement the IAU frame for Earth? I have an implementation in AstroDynCoordinates but the package is currently not ready for public use.

tmamedzadeh commented 6 years ago

You have the implementation of coordinate transformation in AstroDynCoordinates?

My code:

eop = read_iers_eop(eop_file)

function ECI_ECEF(y,date)

  D = rECItoECEF(J2000(), PEF(), date, eop)
  r_pef = D*y[1:3]
  v_pef = D*y[4:6] - [0;0;Ew] × r_pef
  a_pef = D*y[7:9] - [0;0;Ew] × [0;0;Ew] × r_pef - 2*[0;0;Ew] × v_pef

  D = rECEFtoECEF(PEF(), ITRF(), date, eop)
  r_itrf = D*r_pef
  v_itrf = D*v_pef
  a_itrf = D*a_pef

  return [r_itrf;v_itrf;a_itrf]

end
ronisbr commented 6 years ago

Hi @helgee,

Isn’t IAU adopted the ICRF? In this case, no. We have however the GCRF, which is almost the same. But everything is computed using IAU76/FK5 theory, not the more recent IAU2000 models.

I am planning to add IAU2000 in the following weeks.

ronisbr commented 6 years ago

Hi @Tarlan0001,

The difference between ITRF and PEF is that the former accounts for the polar motion, which is pretty much unmodelled AFAIK. The difference is not that much. The question is: do you really require ITRF? Isn’t PEF enough?

ronisbr commented 6 years ago

Notice that if you use only J2000 and PEF (original IAU76/FK5 theory), then you can just drop EOP data from the function you are using. The difference will be in the conversion from UT1 and Terrestrial Time, which will provide very little difference.