There’s 2 issues with writing the last segment of an STK ephemeris file.
When a ThrustHistoryFile is used with an estimator and an STK ephemeris file, the ephemeris file output is empty. This is caused by the EndFileThrust command finalizing the last segment in a way that the STK ephemeris writer is not able to close out the ephemeris file correctly
When a Toggle Off command is used, sometimes an extra epoch is written . This is because an extra segment with no data points is created at the end of the ephemeris