示例#1
0
        /// <summary>
        /// Calculate ECI position/velocity for a given time past the epoch.
        /// </summary>
        /// <param name="tsince">Target time, in minutes past the TLE (UTC) epoch.</param>
        /// <returns>Kilometer-based position/velocity ECI coordinates.</returns>
        public Eci getPosition(double minutesPastEpoch)
        {
            Eci eci = m_NoradModel.getPosition(minutesPastEpoch);

            eci.ae2km();

            return(eci);
        }
示例#2
0
 /// <summary>
 /// Creates a new instance of the class from ECI coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 public Eci(Eci eci)
 {
    Position = new Vector(eci.Position);
    Velocity = new Vector(eci.Velocity);
 }
示例#3
0
 /// <summary>
 /// Creates a new instance of the class from ECI-time coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 /// <param name="date">The time associated with the ECI coordinates.</param>
 public EciTime(Eci eci, Julian date)
    : this(eci.Position, eci.Velocity, date)
 {
 }
示例#4
0
 /// <summary>
 /// Creates a new instance of the class given ECI coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 /// <param name="date">The Julian date.</param>
 public Geo(Eci eci, Julian date)
    :this(eci.Position, 
          (Globals.AcTan(eci.Position.Y, eci.Position.X) - date.ToGmst()) % Globals.TwoPi)
 {
 }
示例#5
0
 /// <summary>
 /// Creates a new instance of the class from ECI coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 /// <param name="date">The Julian date.</param>
 public GeoTime(Eci eci, Julian date)
    : base(eci, date)
 {
    Date = date;
 }
示例#6
0
 /// <summary>
 /// Creates a new instance of the class from ECI coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 public Eci(Eci eci)
 {
     Position = new Vector(eci.Position);
     Velocity = new Vector(eci.Velocity);
 }
示例#7
0
 /// <summary>
 /// Creates a new instance of the class from ECI-time coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 /// <param name="date">The time associated with the ECI coordinates.</param>
 public EciTime(Eci eci, Julian date)
     : this(eci.Position, eci.Velocity, date)
 {
 }
示例#8
0
 /// <summary>
 /// Creates a new instance of the class given ECI coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 /// <param name="date">The Julian date.</param>
 public Geo(Eci eci, Julian date)
     : this(eci.Position,
            (Globals.AcTan(eci.Position.Y, eci.Position.X) - date.ToGmst()) % Globals.TwoPi)
 {
 }
示例#9
0
 /// <summary>
 /// Creates a new instance of the class from ECI coordinates.
 /// </summary>
 /// <param name="eci">The ECI coordinates.</param>
 /// <param name="date">The Julian date.</param>
 public GeoTime(Eci eci, Julian date)
     : base(eci, date)
 {
     Date = date;
 }
示例#10
0
        // ///////////////////////////////////////////////////////////////////////////
        // getLookAngle()
        // Return the topocentric (azimuth, elevation, etc.) coordinates for a target
        // object described by the input ECI coordinates.
        public CoordTopo getLookAngle(Eci eci)
        {
            // Calculate the ECI coordinates for this Site object at the time
            // of interest.
            Julian date    = eci.Date;
            Eci    eciSite = new Eci(m_geo, date);

            // The Site ECI units are km-based; ensure target ECI units are same
            if (!eci.UnitsAreKm())
            {
                throw new Exception("ECI units must be kilometer-based");
            }

            Vector vecRgRate = new Vector(eci.Velocity.X - eciSite.Velocity.X,
                                          eci.Velocity.Y - eciSite.Velocity.Y,
                                          eci.Velocity.Z - eciSite.Velocity.Z);

            double x = eci.Position.X - eciSite.Position.X;
            double y = eci.Position.Y - eciSite.Position.Y;
            double z = eci.Position.Z - eciSite.Position.Z;
            double w = Math.Sqrt(Globals.Sqr(x) + Globals.Sqr(y) + Globals.Sqr(z));

            Vector vecRange = new Vector(x, y, z, w);

            // The site's Local Mean Sidereal Time at the time of interest.
            double theta = date.toLMST(Longitude);

            double sin_lat   = Math.Sin(Latitude);
            double cos_lat   = Math.Cos(Latitude);
            double sin_theta = Math.Sin(theta);
            double cos_theta = Math.Cos(theta);

            double top_s = sin_lat * cos_theta * vecRange.X +
                           sin_lat * sin_theta * vecRange.Y -
                           cos_lat * vecRange.Z;
            double top_e = -sin_theta * vecRange.X +
                           cos_theta * vecRange.Y;
            double top_z = cos_lat * cos_theta * vecRange.X +
                           cos_lat * sin_theta * vecRange.Y +
                           sin_lat * vecRange.Z;
            double az = Math.Atan(-top_e / top_s);

            if (top_s > 0.0)
            {
                az += Globals.PI;
            }

            if (az < 0.0)
            {
                az += 2.0 * Globals.PI;
            }

            double el   = Math.Asin(top_z / vecRange.W);
            double rate = (vecRange.X * vecRgRate.X +
                           vecRange.Y * vecRgRate.Y +
                           vecRange.Z * vecRgRate.Z) / vecRange.W;

            CoordTopo topo = new CoordTopo(az,         // azimuth, radians
                                           el,         // elevation, radians
                                           vecRange.W, // range, km
                                           rate);      // rate, km / sec

#if WANT_ATMOSPHERIC_CORRECTION
            // Elevation correction for atmospheric refraction.
            // Reference:  Astronomical Algorithms by Jean Meeus, pp. 101-104
            // Note:  Correction is meaningless when apparent elevation is below horizon
            topo.m_El += Globals.Deg2Rad((1.02 /
                                          Math.Tan(Globals.Deg2Rad(Globals.Rad2Deg(el) + 10.3 /
                                                                   (Globals.Rad2Deg(el) + 5.11)))) / 60.0);
            if (topo.m_El < 0.0)
            {
                topo.m_El = el; // Reset to true elevation
            }
            if (topo.m_El > (Globals.PI / 2))
            {
                topo.m_El = (Globals.PI / 2);
            }
#endif
            return(topo);
        }