question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Earth Center Earth Fixed (ECEF) reference frames

See original GitHub issue

It would be useful to be able to define an orbit using a state vector in Earth Center Earth Fixed (ECEF) reference frames, such as ITRF2014.

🐞 This is a new feature to facilitate the usage of the package.

🎯 Precise GPS orbits are normally given in ITRF reference frame. Therefore it would be of great help to be able to use ECEF state vectors to define an orbit, to be able to perform mission analysis for GPS-based positioning.

💡 This is just sample code using astropy to do the reference frame transformation

     # These are state vectors in Earth Center Earth Fixed (ECEF reference frame)
    pos = [SV.X[0], SV.Y[0], SV.Z[0]]
    vel = [SV.VX[0], SV.VY[0], SV.VZ[0]]

    from astropy import coordinates as coord
    cartdiff = coord.CartesianDifferential(*vel, unit='m/s')
    cartrep  = coord.CartesianRepresentation(*pos, unit = u.m, differentials=cartdiff)

    # Transform state vector from ECEF to J2000
    itrs = coord.ITRS(cartrep, obstime = epoch)
    gcrs = itrs.transform_to(coord.GCRS(obstime=epoch))

    #This should be coordinates in J2000
    pos = gcrs.cartesian.xyz
    vel = [gcrs.velocity.d_x.to_value(u.km/u.s), gcrs.velocity.d_y.to_value(u.km/u.s), gcrs.velocity.d_z.to_value(u.km/u.s)]

    # Generate orbit using J2000 state vector
    orbit = Orbit.from_vectors(Earth, pos, vel * u.km / u.s )

📋
I am not familiar with the package yet to be able to propose a solution.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
astrojuanlucommented, Feb 1, 2019

Hi @jtegedor! With the change we just landed in master, thanks to @hrishikeshgoyal in #554, now you can do this (copying and pasting from your original example):

     # These are state vectors in Earth Center Earth Fixed (ECEF reference frame)
    pos = [SV.X[0], SV.Y[0], SV.Z[0]]
    vel = [SV.VX[0], SV.VY[0], SV.VZ[0]]

    from astropy import coordinates as coord
    cartdiff = coord.CartesianDifferential(*vel, unit='m/s')
    cartrep  = coord.CartesianRepresentation(*pos, unit = u.m, differentials=cartdiff)

    # Transform state vector from ECEF to J2000
    itrs = coord.ITRS(cartrep, obstime = epoch)

    # Generate orbit using J2000 state vector
    orbit = Orbit.from_coords(Earth, itrs)

Hopefully, a bit easier. For your information, the orbit will be internally converted to ECI (GCRS). We will release poliastro 0.12 with this functionality in two weeks, but you can test it using pip install git+https://github.com/poliastro/poliastro.git if you want to give us early feedback. With your permission, I am closing the issue, but feel free to comment. Thanks again!

0reactions
astrojuanlucommented, Jan 23, 2019

That’s because ICRS has a fixed definition that does not depend on the time of observation 😃 Further reading in https://github.com/poliastro/poliastro/wiki/Reference-frames#links

Read more comments on GitHub >

github_iconTop Results From Across the Web

Earth-centered, Earth-fixed coordinate system - Wikipedia
The Earth-centered, Earth-fixed coordinate system (acronym ECEF), also known as the geocentric coordinate system, is a cartesian spatial reference system ...
Read more >
1 Earth centered, Earth fixed reference frame (ECEF)
first reference frame used is called Earth Centered, Earth Fixed (ECEF). The ECEF depicted in Figure 3.1 and denoted by E, is a...
Read more >
ECEF Coordinate System - WRLD3D
Our ECEF coordinate system is a subtle variation of the Earth Centred Earth Fixed system that we find more appropriate. This coordinate system...
Read more >
Technical Notes for Central Bodies - Configuration Settings ...
Y* - The Inertial frame for the Earth and the Sun is ICRF—these bodies do not have a separate system named Inertial. Coordinate...
Read more >
Transformations between ECEF and ENU coordinates - GSSC
The relation between the local East, North, Up (ENU) coordinates and the (x,y,z) Earth Centred Earth Fixed (ECEF) coordinates is illustrated ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found