Пример #1
0
        public void TestSatellitePasses()
        {
            var passRequest = new SatelliteAccessPassData <IVerifiable>();

            passRequest.SSCs.Add(25544); // the International Space Station
            passRequest.Start = new DateTime(2019, 5, 27, 12, 0, 0, DateTimeKind.Utc);
            passRequest.Stop  = passRequest.Start.AddDays(7);
            var sd = new SiteData();

            sd.Location = new ServiceCartographic(40.0, -75.0, 0.0);
            passRequest.FromObjectPath  = sd;
            passRequest.ToObjectLit     = true;
            passRequest.FromObjectDark  = true;
            passRequest.IncludePathCzml = true;
            passRequest.Verify();

            // call the service
            var passResults = AccessServices.GetSatellitePasses <SatellitePassResults <ServiceCartographicWithTime> >
                                  (passRequest).Result;

            Assert.That(passResults.Passes.Count > 0);
            Assert.That(!string.IsNullOrEmpty(passResults.CzmlForPasses));
            // Head to cesiumjs.org, click the "Tap to Interact" button. Once the globe appears, Drag the file produced
            // in the next line to the globe.  Use the globe controls to move forward and backward in time, and move the
            // camera to see the orbit, and highlighted visibility times.
            File.WriteAllText("ISS.czml", passResults.CzmlForPasses);
        }
        public void SatellitePasses_IssAccessToSite()
        {
            var passRequest = new SatelliteAccessPassData <IVerifiable>
            {
                Start = new DateTime(2014, 8, 19, 0, 0, 0, DateTimeKind.Utc),
                Stop  = new DateTime(2014, 8, 19, 12, 0, 0, DateTimeKind.Utc)
            };
            var sd = new SiteData
            {
                Location       = new ServiceCartographic(40.0012, -75.661, 19.0),
                MeanSeaLevel   = true,
                OutputSettings =
                {
                    Step             =                     30,
                    TimeFormat       = TimeRepresentation.UTC,
                    CoordinateFormat = { Coord = CoordinateRepresentation.LLA }
                }
            };

            passRequest.FromObjectPath = sd;
            passRequest.SSCs.Add(25544); // the International Space Station
            passRequest.FromObjectDark         = true;
            passRequest.ToObjectLit            = true;
            passRequest.UseMinElevation        = true;
            passRequest.FromObjectMinElevation = 10.0;
            passRequest.LineOfSight            = true;
            passRequest.IncludePathData        = true;
            passRequest.IncludePathCzml        = true;
            passRequest.SatelliteOrbitColor    = Color.Magenta.ToString();
            passRequest.PassLinkColor          = Color.Green.ToString();
            passRequest.Verify();

            // call the service
            var passResults = AccessServices.GetSatellitePasses <SatellitePassResults <ServiceCartographicWithTime> >
                                  (passRequest).Result;

            Assert.That(passResults.Passes.Count == 2);
            // First Pass
            Assert.AreEqual(-2.893973737835, passResults.Passes[0].MaxMagnitude, 1e-12);
            Assert.AreEqual(15.61516492386, passResults.Passes[0].MaximumElevationData.Elevation, 1e-11);
            Assert.AreEqual("2014-08-19T00:22:13.1728536Z", passResults.Passes[0].AccessStart);
            Assert.AreEqual("2014-08-19T00:26:28.4117640Z", passResults.Passes[0].AccessStop);
            // Second Pass
            Assert.AreEqual(-4.341255364434, passResults.Passes[1].MaxMagnitude, 1e-12);
            Assert.AreEqual(55.23840734827, passResults.Passes[1].MaximumElevationData.Elevation, 1e-11);
            Assert.AreEqual("2014-08-19T01:58:17.8074201Z", passResults.Passes[1].AccessStart);
            Assert.AreEqual("2014-08-19T02:01:13.4157620Z", passResults.Passes[1].AccessStop);
        }
Пример #3
0
        public void GeoToLeo()
        {
            var passRequest = new SatelliteAccessPassData <IVerifiable>
            {
                Start = new DateTime(2014, 8, 19, 0, 0, 0, DateTimeKind.Utc),
                Stop  = new DateTime(2014, 8, 19, 12, 0, 0, DateTimeKind.Utc)
            };
            var fromObjectPath = new Sgp4RouteData
            {
                Start          = new DateTime(2014, 8, 19, 0, 0, 0, DateTimeKind.Utc),
                Stop           = new DateTime(2014, 8, 19, 12, 0, 0, DateTimeKind.Utc),
                SSC            = 19548,
                OutputSettings =
                {
                    TimeFormat = TimeRepresentation.UTC
                }
            };

            passRequest.FromObjectPath = fromObjectPath;
            passRequest.SSCs.Add(25544); // the International Space Station
            passRequest.FromObjectDark  = false;
            passRequest.ToObjectLit     = true;
            passRequest.UseMinElevation = false;
            passRequest.LineOfSight     = true;
            passRequest.IncludePathCzml = true;
            passRequest.Verify();

            // call the service
            var passResults = AccessServices.GetSatellitePasses <SatellitePassResults <ServiceCartographicWithTime> >
                                  (passRequest).Result;

            Assert.That(passResults.Passes.Count == 13);
            // First Pass
            Assert.AreEqual(7.285152814472, passResults.Passes[0].MaxMagnitude, 1e-12);
            Assert.AreEqual(-80.727902792933861, passResults.Passes[0].MaximumElevationData.Elevation, 1e-15);
            Assert.AreEqual("2014-08-19T00:10:47.7098365Z", passResults.Passes[0].AccessStart);
            Assert.AreEqual("2014-08-19T00:28:20.1973285Z", passResults.Passes[0].AccessStop);
            // Second Pass
            Assert.AreEqual(4.137398061182, passResults.Passes[12].MaxMagnitude, 1e-12);
            Assert.AreEqual(-80.7507306151, passResults.Passes[12].MaximumElevationData.Elevation, 1e-10);
            Assert.AreEqual("2014-08-19T11:54:24.1844298Z", passResults.Passes[12].AccessStart);
            Assert.AreEqual("2014-08-19T12:00:00.0000000Z", passResults.Passes[12].AccessStop);
        }