How the fit works
A TLE is not a position: it is a set of mean elements that SGP4 turns into positions. To get one from an ephemeris, the converter searches for the elements whose SGP4 positions come closest to your states (least squares, in TEME), with the epoch at your last state. It reports the average and largest difference in metres, so you can judge the result.
- Inputs: CCSDS OEM in KVN or XML, or plain text or CSV with time, x, y, z, vx, vy, vz (km and km/s; metres are detected). Frames EME2000, GCRF, TEME or ITRF (ECEF); say which when the file does not.
- Span: at least 10 minutes, at most 14 days. A day or two from a GNSS receiver gives the best element set for predictions, and drag is fitted only with more than a day and a half.
- NORAD ID: an ephemeris does not carry one; enter it to have it in the TLE (00000 otherwise).
Expect tens to hundreds of metres for a good fit: SGP4 is a simplified model, so it can't follow a precise ephemeris exactly.
Every direction
The same converter reads any of the three and writes any of the three. TLE and OMM convert directly. OEM is written by propagating with SGP4, and read by fitting SGP4 elements to the states. An OEM can also be re-written in another frame without fitting. The TLE to OMM, TLE to OEM and OEM to TLE pages are the same tool, starting with a different output.
Check element sets first with the TLE checker, or read how to read a TLE.