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 void GetPasses(Site observer, Orbit orbit, DateTime start) {
            int passesRequired = 2;
            int totalPassesFound = 0;
            DateTime calcTime = start;
            Hashtable passes = new Hashtable();
            EciTime eci;
            Topo topoLook;
            Pass pass;

            orbit.HasAOS(observer);

            while (totalPassesFound < passesRequired)
            {
                eci = orbit.GetPosition(calcTime);
                CoordGeo a = eci.ToGeo();
                topoLook = observer.GetLookAngle(eci);
                if (topoLook.ElevationDeg > 0)
                {
                    pass = new Pass();
                    pass.AOS = calcTime;
                    pass.AOSAz = topoLook.AzimuthDeg;
                    while (topoLook.ElevationDeg > 0)
                    {
                        eci = orbit.GetPosition(calcTime);
                        topoLook = observer.GetLookAngle(eci);
                        if (topoLook.ElevationDeg > pass.MaxEl)
                        {
                            pass.MaxEl = topoLook.ElevationDeg;
                        }
                        calcTime = calcTime.AddSeconds(1);
                        pass.LOS = calcTime;
                    }
                    pass.LOSAz = topoLook.AzimuthDeg;
                    //passes.Add(pass);
                    totalPassesFound++;
                }

                calcTime = calcTime.AddSeconds(20);
            }
            //return passes;
        }
Beispiel #3
0
        public static void Main()
        {
            string str1 = "ISS (ZARYA)             ";
            string str2 = "1 25544U 98067A   13222.08683053  .00004563  00000-0  87202-4 0  3628";
            string str3 = "2 25544  51.6485 201.2720 0004128 298.2475 180.8024 15.50224716843064";
            Tle tle1 = new Tle(str1, str2, str3);
            Site siteEquator = new Site(52.1259155, -0.219355, 0);
            Orbit orbit = new Orbit(tle1);
            DateTime now = DateTime.Now;
            Track t = new Track();
            t.GetPasses(siteEquator, orbit, DateTime.Now);

            while (true)
            {
                EciTime eciSDP4 = orbit.GetPosition(DateTime.Now);
                Topo topoLook = siteEquator.GetLookAngle(eciSDP4);
                CoordGeo g = eciSDP4.ToGeo();
                Debug.Print(g.Latitude.ToString() + " " + g.Longitude.ToString() + " " + g.Altitude.ToString());
                Thread.Sleep(1000);
            }
        }
Beispiel #4
0
        void TimerTick(Timer timer)
        {
            string str1 = "ISS (ZARYA)             ";
            string str2 = "1 25544U 98067A   15352.54319571  .00014358  00000-0  21741-3 0  9990";
            string str3 = "2 25544  51.6437 244.0274 0008333 295.0996 127.4199 15.54892795976727";
            Tle tle1 = new Tle(str1, str2, str3);
            Site siteEquator = new Site(52.454935, 0.201279, 0);
            Orbit orbit = new Orbit(tle1);
            DateTime now = DateTime.Now;
            EciTime eciSDP4 = orbit.GetPosition(now);
            Topo topoLook = siteEquator.GetLookAngle(eciSDP4);

            CoordGeo coords = eciSDP4.ToGeo();

            UpdateTextBlock(RealTimeClock.GetDateTime().ToString(@"dd\/MM\/yyyy HH:mm"), "date");

            UpdateTextBlock(coords.Altitude.ToString("F2"), "satAlt");
            UpdateTextBlock(coords.Latitude.ToString("F2"), "satLat");
            UpdateTextBlock((360 - coords.Longitude).ToString("F2"), "satLon");
            UpdateTextBlock(topoLook.AzimuthDeg.ToString("F2"), "satAz");
            UpdateTextBlock(topoLook.ElevationDeg.ToString("F2"), "satEl");
        }
Beispiel #5
0
      public bool HasAOS(Site observer)
      {
          double lin, sma, apogee;
          bool retcode = false;

          /* FIXME */
          /*the first condition takes care of geostationary satellites and 
            decayed satellites.  The second deals with LEOS from the original 
            predict code.  However, nothing correctly handles geos with poor 
            station keeping that are tracing a figure 8.
          */

          //     if ((sat->otype == ORBIT_TYPE_GEO) || (decayed(sat)))
          //    {
          //         retcode = FALSE;
          //     }
          //     else
          //    {

          if (this.MeanMotion == 0.0)
          {
              retcode = false;
          }
          else
          {
              lin = this.Inclination;

              if (lin >= (Globals.Pi / 2))
                  lin = Globals.Pi - lin;

              sma = 331.25 * Math.Exp(Math.Log(1440.0 / this.MeanMotion) * (2.0 / 3.0));
              apogee = sma * (1.0 + this.Eccentricity) - Globals.Xkmper;

              if ((Math.Acos(Globals.Xkmper / (apogee + Globals.Xkmper)) + (lin)) > Math.Abs(observer.LatitudeRad * Globals.DegreesPerRad))
                  retcode = true;
              else
                  retcode = false;

          }
          //   }
          return retcode;
      }