Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        static public 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);
        }
Ejemplo n.º 3
0
        static public 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);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
 public static Coordinates AltAzm2RaDec2(AltAzm altAzm, LatLon location, DateTime UTCtime, double elevation)
 {
     return new Coordinates(0, 0);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 7
0
 public static Coordinates AltAzm2RaDec2(AltAzm altAzm, LatLon location, DateTime UTCtime, double elevation)
 {
     return(new Coordinates(0, 0));
 }