Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this be used to convert ECI to Lat, Long, Alt? #221

Open
ScottBeeson opened this issue Jun 23, 2023 · 2 comments
Open

Can this be used to convert ECI to Lat, Long, Alt? #221

ScottBeeson opened this issue Jun 23, 2023 · 2 comments
Labels
enhancement question General question on CoordinateSharp's usage.

Comments

@ScottBeeson
Copy link

I have some ECI data in .17col format that I need to convert to lat, long, alt. I was able to do this in Python, but that forces me to run a separate conversion outside of our main platform. I would like our C# ingestor to be able to handle this. Is this something CoordinateSharp can do?

This is the python script I'm using to do the actual conversion, if it helps.

from astropy import coordinates as coord
from astropy import units as u

def eci_to_latlong(t, x_eci, y_eci, z_eci):
    #compliments of https://stackoverflow.com/questions/46494755/obstime-syntax-for-astropy-python-utc-time-for-coordinate-conversion
    xyz = [x_eci,y_eci,z_eci]
    cartrep = coord.CartesianRepresentation(*xyz, unit=u.m) #adding units of [m] to xyz

    gcrs = coord.GCRS(cartrep, obstime=t)
    itrs = gcrs.transform_to(coord.ITRS(obstime=t))
    loc = coord.EarthLocation(*itrs.cartesian.xyz)

    return loc.lat.value, loc.lon.value, loc.height.value
@ScottBeeson ScottBeeson added the question General question on CoordinateSharp's usage. label Jun 23, 2023
@Tronald
Copy link
Owner

Tronald commented Jun 23, 2023

Hi Scott,

Unfortunately ECI is not available at this time. The library does convert to ECEF however. I believe the shift from ECEF to ECI, is commonly used, but I am not versed enough to know what the best conversion technique is at this time.

I did find this potential resource however, but I do not know if the algorithm is accurate and would have to research further. https://idlastro.gsfc.nasa.gov/ftp/pro/astro/geo2eci.pro

I think it would be great to incorporate however to compliment ECEF. Chime in if anyone has any reliable resource on the math involved or any existing algorithms for reference.

@Tronald
Copy link
Owner

Tronald commented Jun 26, 2023

Yikes,

Having researched this further, it's clear this is one of the more complex conversions. Based on the involved calculations, and various time and ICRF requirements that update overtime, this system would be better served as an extension library. The base library is designed in such a fashion where "data" updates are not needed (or very rarely needed as base algorithms could improve theoretically).

Extension libraries serve to bridge that gap and allow for conversions for items that require underlying data (like our Magnetic Extension.

This one is a doozy though, so I am not sure how long it will take to implement. Sorry we don't have a near term solution. Will keep this open for others to chime in on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement question General question on CoordinateSharp's usage.
Projects
None yet
Development

No branches or pull requests

2 participants