CoordinateSharp icon indicating copy to clipboard operation
CoordinateSharp copied to clipboard

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

Open ScottBeeson opened this issue 1 year ago • 2 comments

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 avatar Jun 23 '23 13:06 ScottBeeson

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 avatar Jun 23 '23 21:06 Tronald

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.

Tronald avatar Jun 26 '23 17:06 Tronald