public void Refresh(AscomTools tools, DateTime syncTime)
 {
     SyncTime = syncTime;
     LocalApparentSiderialTime = new HourAngle(AstroConvert.LocalApparentSiderealTime(tools.Transform.SiteLongitude, syncTime));
     Equatorial = new EquatorialCoordinate(GetRA(ObservedAxes), GetDec(ObservedAxes));
     UpdateAltAzimuth(tools, syncTime);
 }
 public void MoveRADec(AxisPosition newAxisPosition, AscomTools tools, DateTime syncTime)
 {
     // double[] delta = ObservedAxes.GetDeltaTo(newAxisPosition);
     SyncTime = syncTime;
     LocalApparentSiderialTime = new HourAngle(AstroConvert.LocalApparentSiderealTime(tools.Transform.SiteLongitude, syncTime));
     // Apply the axis rotation to the new position.
     ObservedAxes = newAxisPosition;
     Equatorial   = new EquatorialCoordinate(GetRA(ObservedAxes), GetDec(ObservedAxes));
     UpdateAltAzimuth(tools, syncTime);
 }
Beispiel #3
0
        /// <summary>
        ///  Obtains a vector in polar notation from the equatorial coordinates and the observation time.
        /// </summary>
        /// <param name="coord"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        private Vector GetEVC(EquatorialCoordinate coord, DateTime localTime)
        {
            double deltaTime = AstroConvert.HrsToRad(localTime - _timeZero);
            Vector evc       = new Vector(0.0, 0.0, 0.0);

            evc[0] = Math.Cos(coord.Declination.Radians) * Math.Cos(coord.RightAscension.Radians - (_k * deltaTime));
            evc[1] = Math.Cos(coord.Declination.Radians) * Math.Sin(coord.RightAscension.Radians - (_k * deltaTime));
            evc[2] = Math.Sin(coord.Declination.Radians);
            return(evc);
        }
 public MountCoordinate(EquatorialCoordinate equatorial, AxisPosition axisPosition, AscomTools tools, DateTime syncTime)
 {
     ObservedAxes = axisPosition;
     SyncTime     = syncTime;
     LocalApparentSiderialTime = new HourAngle(AstroConvert.LocalApparentSiderealTime(tools.Transform.SiteLongitude, syncTime));
     if (tools.Transform.SiteLatitude < 0.0)
     {
         Hemisphere = HemisphereOption.Southern;
     }
     Equatorial = equatorial;
     this.UpdateAltAzimuth(tools, syncTime);
 }
Beispiel #5
0
        public AxisPosition GetAxisPosition(EquatorialCoordinate eq, DateTime targetTime)
        {
            Vector EVC = GetEVC(eq, targetTime);
            Vector HVC = new Vector(0.0, 0.0, 0.0);

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    HVC[i] += _T[i, j] * EVC[j];
                }
            }

            return(new AxisPosition(AstroConvert.Range2Pi(Math.Atan2(HVC[1], HVC[0])), AstroConvert.Range2Pi(Math.Asin(HVC[2])), true));
        }
 /// <summary>
 /// Returns the RADec coordinate for the observed AltAzimuth using the values
 /// currently set in the passed AscomTools instance. Also sets the stored Equatorial
 /// </summary>
 /// <param name="transform"></param>
 /// <returns></returns>
 public void UpdateEquatorial(AscomTools tools, DateTime syncTime)
 {
     tools.Transform.JulianDateTT = tools.Util.DateLocalToJulian(syncTime);
     tools.Transform.SetAzimuthElevation(AltAzimuth.Azimuth, AltAzimuth.Altitude);
     Equatorial = new EquatorialCoordinate(tools.Transform.RATopocentric, tools.Transform.DECTopocentric);
 }