StkEphemerisFile Class | 
Reads from and writes to STK ephemeris (.e) files. STK ephemeris files can express position, velocity, acceleration, and covariance information, and are useful for getting this type of data into and out of STK.
To read an STK ephemeris file, call the ReadFrom(String) method to read the data into memory, and then call the CreatePoint method to create a time-varying Point representing the ephemeris data in the file. Similarly, call CreateCovarianceInterpolator to obtain the Covariance3By3SizeAndOrientationInterpolator representing the covariance data in the file.
You can also build an StkEphemerisFile instance by calling the various Configure... methods such as ConfigureFromPointInterpolator(PointInterpolator). Once you've built an appropriate StkEphemerisFile instance, you can save it to a file or another stream by calling WriteTo(TextWriter).
Namespace: AGI.Foundation.Stk
The StkEphemerisFile type exposes the following members.
| Name | Description | |
|---|---|---|
| StkEphemerisFile | Initializes a new instance.  | 
| Name | Description | |
|---|---|---|
| CovarianceData | 
            Gets or sets the covariance data.
              | |
| Data | 
            Gets or sets the ephemeris data.
              | |
| Properties | 
            Gets a dictionary of key and value pairs in the STK ephemeris file.  After an StkEphemerisFile is
            read, this dictionary contains all the key and value pairs in the file.  When writing an
            StkEphemerisFile, these properties are written back to the file, but only if another
            property does not offer an authoritative value.  For example, if the CoordinateSystem
            property is set, any "CoordinateSystem" property in this collection will be overwritten.
              | |
| PropertiesWithUnsupportedValues | 
            Gets a dictionary of property names and values for the properties with values specified in the file that
            are not supported by the StkEphemerisFile reader.  Any information contained in these
            properties may not be captured by the reader.
              | |
| SegmentBoundaryTimes | 
            Gets or sets the list of segment boundary times in the STK ephemeris file.
            Segment boundary times are times that should not be interpolated over.
              | |
| UnsupportedProperties | 
            Gets a dictionary of property names and values for the properties that are contained in the file but that
            are not supported by the StkEphemerisFile reader.  Any information contained in these properties
            may not be captured by the reader.
              | |
| Version | 
            Gets or sets the ephemeris file version.
              | 
| Name | Description | |
|---|---|---|
| ConfigureFromPoint | 
            Configures this instance with values computed by sampling a Point over an interval with
            a fixed step.  The Data property is replaced with a new instance of StkEphemerisFileEphemerisTimePos,
            StkEphemerisFileEphemerisTimePosVel, or StkEphemerisFileEphemerisTimePosVelAcc (depending on the value of the
            order property) and any existing information stored in that instance is lost.
            The Properties are not modified, but values pulled from Point will take precedence
            over values in the Properties collection when writing this instance using WriteTo(TextWriter).
            The Interpolator property is not configured, so you may want to call
            ConfigureInterpolation(InterpolationAlgorithm, Int32) after calling this method.
              | |
| ConfigureFromPointInterpolator | 
            Configures the instance to represent the ephemeris and interpolation stored in a PointInterpolator.
            The Data property is replaced with a new instance of StkEphemerisFileEphemerisTimePos,
            StkEphemerisFileEphemerisTimePosVel, or StkEphemerisFileEphemerisTimePosVelAcc (depending on the number of derivatives
            available from the PointInterpolator) and any existing information stored in that instance
            is lost.  The Properties are not modified, but values pulled from PointInterpolator
            will take precedence over values in the Properties collection when writing this instance using
            WriteTo(TextWriter).
              | |
| ConfigureInterpolation | 
            Configures the Interpolator to use the specified interpolation algorithm
            and polynomial degree.  The Data property must be set before calling this method.
              | |
| CreateCovarianceInterpolator | 
            Creates a Covariance3By3SizeAndOrientationInterpolator for interpolating
            over the covariance data held by this instance.
              | |
| CreatePoint | 
            Creates a Point whose time-varying position is computed by interpolating
            over the ephemeris data held by this instance.
              | |
| Equals | Determines whether the specified object is equal to the current object.  (Inherited from Object.) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.  (Inherited from Object.) | |
| GetHashCode | Serves as the default hash function.   (Inherited from Object.) | |
| GetType | Gets the Type of the current instance.  (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object.  (Inherited from Object.) | |
| ReadFrom(String) | 
            Reads an STK ephemeris (.e) file from a specified file.  See the
            Remarks section of the
            documentation of ReadFrom(TextReader, StkEphemerisFileOptions) for detailed information.
              | |
| ReadFrom(TextReader) | 
            Reads an STK ephemeris (.e) file from a TextReader.  The
            TextReader can be a StreamReader for reading
            from a file, a StringReader for reading from a string,
            or any number of other types.  See the Remarks section of the
            documentation of ReadFrom(TextReader, StkEphemerisFileOptions) for detailed information.
              | |
| ReadFrom(String, StkEphemerisFileOptions) | 
            Reads an STK ephemeris (.e) file from a specified file.  See the
            Remarks section of the
            documentation of ReadFrom(TextReader, StkEphemerisFileOptions) for detailed information.
              | |
| ReadFrom(TextReader, StkEphemerisFileOptions) | 
            Reads an STK ephemeris (.e) file from a TextReader.  The
            TextReader can be a StreamReader for reading
            from a file, a StringReader for reading from a string,
            or any number of other types.  See the
            Remarks section for more information.
              | |
| ToString | Returns a string that represents the current object.  (Inherited from Object.) | |
| WriteTo(TextWriter) | 
            Writes this instance to a TextWriter in the STK ephemeris file (.e) format.
            The TextWriter can be a StreamWriter for writing to a file,
            a StringWriter for writing to a string, or any number of other types.
              | |
| WriteTo(TextWriter, Boolean) | 
            Writes this instance to a TextWriter in the STK ephemeris file (.e) format.
            The TextWriter can be a StreamWriter for writing to a file,
            a StringWriter for writing to a string, or any number of other types.
              | 
The following example shows how to write an STK ephemeris (.e) file from a motion evaluator:
// Use any valid TLE to create a propagator, and use that propagator to create a MotionEvaluator. TwoLineElementSet inputTwoLineElementSet = new TwoLineElementSet(@"1 20813U 90084A 07157.52757149 -.00000978 00000-0 10000-3 0 8139 2 20813 62.3585 177.5907 7234421 261.2958 18.3008 2.01001663122427"); Sgp4Propagator propagator = new Sgp4Propagator(inputTwoLineElementSet); MotionEvaluator<Cartesian> motionEvaluator = propagator.GetEvaluator(); // Define start time, stop time, and time step that will be used to sample the motion evaluator for ephemeris data. JulianDate startDate = new GregorianDate(2007, 6, 1).ToJulianDate(); JulianDate stopDate = new GregorianDate(2007, 6, 2).ToJulianDate(); Duration timeStep = Duration.FromSeconds(60); // Using the MotionEvaluator created above, output ephemeris data in a format that can be processed by // the StkEphemerisFile object. Passing null for the ITrackCalculationProgress indicates that the Evaluate step // should not track progress. DateMotionCollection<Cartesian> rawEphemerisData = motionEvaluator.Evaluate(startDate, stopDate, timeStep, 0, null); // The data obtained from the MotionEvaluator is in meters. Convert to desired units, kilometers in this case. DateMotionCollection<Cartesian> rawEphemerisDataKm = new DateMotionCollection<Cartesian>(); double toKilometers = 1.0 / 1000.0; for (int i = 0; i < rawEphemerisData.Count; i++) { rawEphemerisDataKm.Add(rawEphemerisData.Dates[i], rawEphemerisData.Motions[i].Value * toKilometers); } // Once the raw data has been obtained from the MotionEvaluator and converted as necessary, place it into an StkEphemerisFile // and specify the appropriate coordinate system. StkEphemerisFile.EphemerisTimePos ephemerisData = new StkEphemerisFile.EphemerisTimePos { CoordinateSystem = propagator.ReferenceFrame, EphemerisData = rawEphemerisDataKm, }; StkEphemerisFile ephemerisFile = new StkEphemerisFile { Data = ephemerisData }; // Use the "Properties" element of the STKEphemerisFile to specify any additional supported properties // such as the distance unit of the data. ephemerisFile.Properties.Add("DistanceUnit", "Kilometers"); // Finally, write the StkEphemerisFile out. using (StreamWriter ephemerisWriter = new StreamWriter(path, false, Encoding.ASCII)) { ephemerisFile.WriteTo(ephemerisWriter); }