skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.41k stars 212 forks source link

J2000 to Earth Fixed #956

Open mikefNAMA opened 5 months ago

mikefNAMA commented 5 months ago

I am new to Skyfield and python but very impressed with all the hard work that went into creating this package. I'm using my own code to propagate a J2000 state vector relative to the earth. I'd like to rotate that position vector into the earth fixed frame. I'm struggling with how to do that in Skyfield. I know there must be a way. I thought I might be able to do something like this:

time = ts.utc(2024, 4, 8, 16, 39, 25.66) au = 1.495978707e11 posI = ICRF(position_au=[5411128.46914935/au, 1397726.32920587/au, 3063240.39456669/au],center=earth,t=time) print('posI: ',posI.position) posEF = posI.frame_xyz(itrs) print('posEF: ',posEF)

But no joy.

brandon-rhodes commented 4 months ago

Could you show which coordinates you are getting back, and explain in a bit more detail what's wrong with them?