private void ShowData()
        {
            if (tle != null)
            {
                var Location = new LatLon(53.9, 27.56667);
                var dt = DateTime.UtcNow;

                var JDdate = Utils.Utils.JDtime(dt);
                MJD.Text = JDdate.ToString("f5");
                orbit = new Orbit(tle);
                Site site = new Site(Location.Lat, Location.Lon, 0.290);
                EciTime eci = orbit.GetPosition(dt);
                Topo topoLook = site.GetLookAngle(eci);
                main.Altitude.Text = topoLook.ElevationDeg.ToString("f3");
                main.Azimuth.Text = topoLook.AzimuthDeg.ToString("f3");
                var altAzm = new AltAzm(topoLook.ElevationDeg, topoLook.AzimuthDeg);
                var RaDec = Utils.Utils.AltAzm2RaDec(altAzm, Location, dt, 0.29);

                var tt2 = Utils.Utils.RaDec2AltAzm2(
                    new Coordinates(16.695, 36.466667),
                    new LatLon(52.5, -1.9166667),
                    new DateTime(1998, 8, 10, 23, 10, 00),
                    0);
                var ttt = Utils.Utils.RaDec2AltAzm2(RaDec, Location, dt, 0.2);

                RA.Text = DMS.FromDeg(RaDec.Ra).ToString();
                Dec.Text = DMS.FromDeg(RaDec.Dec).ToString();
            }
        }
Beispiel #2
0
        public static AltAzm RaDec2AltAzm2(Coordinates coord, LatLon location, DateTime UTCtime, double elevation)
        {
            var utils = new ASCOM.Astrometry.NOVAS.NOVAS31();

            var ra = coord.Ra * 15;
            var dec = coord.Dec;
            var time = UTCtime.TimeOfDay.TotalHours;
            var lat = location.Lat;
            var lon = location.Lon;
            var j200Time = utils.JulianDate((short)UTCtime.Year, (short)UTCtime.Month, (short)UTCtime.Day, time);
            j200Time -= 2451545.0;
            var LST =  100.46 + 0.985647 * j200Time + lon + 15 * time;
            LST = LST.ToRange(0, 360);

            var HA = (LST - ra).ToRange(0, 360);

            var sinALT = Math.Sin(dec.ToRad()) * Math.Sin(lat.ToRad()) + Math.Cos(dec.ToRad()) * Math.Cos(lat.ToRad()) * Math.Cos(HA.ToRad());
            var ALT = Math.Asin(sinALT);
            var alt = ALT.ToDeg();

            var cosA = (Math.Sin(dec.ToRad()) - Math.Sin(ALT) * Math.Sin(lat.ToRad())) / (Math.Cos(ALT) * Math.Cos(lat.ToRad()));
            var A = Math.Acos(cosA).ToDeg();

            var Azm = Math.Sin(HA.ToRad()) < 0 ? A : 360 - A;

            return new AltAzm(alt, Azm);
        }
Beispiel #3
0
        public static AltAzm RaDec2AltAzm(Coordinates coord, LatLon location, DateTime time, double elevation)
        {
            var utils = new ASCOM.Astrometry.AstroUtils.AstroUtils();
            var MJDdate = utils.CalendarToMJD(time.Day, time.Month, time.Year);
            MJDdate += time.TimeOfDay.TotalDays;

            var tfm = new ASCOM.Astrometry.Transform.Transform();
            tfm.JulianDateTT = MJDdate;
            tfm.SiteElevation = elevation * 1000;
            tfm.SiteLatitude = location.Lat;
            tfm.SiteLongitude = location.Lon;
            tfm.SiteTemperature = 0;
            tfm.SetApparent(coord.Ra, coord.Dec);
            tfm.Refresh();

            var res = new AltAzm(tfm.ElevationTopocentric, tfm.AzimuthTopocentric);
            return res;
        }
Beispiel #4
0
 public static double NowLST(LatLon location)
 {
     var nov = new ASCOM.Astrometry.NOVAS.NOVAS31();
     var ast = new ASCOM.Astrometry.AstroUtils.AstroUtils();
     var currJD = ast.JulianDateUT1(0);
     double lstNow = 0;
     var res = nov.SiderealTime(
         currJD, 0d, 0, GstType.GreenwichApparentSiderealTime, Method.EquinoxBased, Accuracy.Full, ref lstNow);
     if (res != 0) throw new Exception("Error getting Local Apparent Sidereal time");
     return lstNow;
 }
Beispiel #5
0
 public static Coordinates AltAzm2RaDec2(AltAzm altAzm, LatLon location, DateTime UTCtime, double elevation)
 {
     return new Coordinates(0, 0);
 }
Beispiel #6
0
 public static Coordinates AltAzm2RaDec(AltAzm altAzm, LatLon location, DateTime time, double elevation)
 {
     var JDdate = JDtime(time);
     var tfm = new ASCOM.Astrometry.Transform.Transform();
     var jdtt = tfm.JulianDateTT;
     //tfm.JulianDateTT = JDdate;
     tfm.SiteElevation = elevation * 1000;
     tfm.SiteLatitude = location.Lat;
     tfm.SiteLongitude = location.Lon;
     tfm.SiteTemperature = 0;
     tfm.SetAzimuthElevation(altAzm.Azm, altAzm.Alt);
     tfm.Refresh();
     //            var res = new Coordinates(tfm.RAJ2000, tfm.DecJ2000);
     //            var res = new Coordinates(tfm.RAApparent, tfm.DECApparent);
     var res = new Coordinates(tfm.RATopocentric, tfm.DECTopocentric);
     return res;
 }
Beispiel #7
0
 public static Coordinates AltAzm2RaDec2(AltAzm altAzm, LatLon location, DateTime UTCtime, double elevation)
 {
     return(new Coordinates(0, 0));
 }