Example #1
0
        // /////////////////////////////////////////////////////////////////////
        static void Main(string[] args)
        {
            // Sample obsCodeode to test the SGP4 and SDP4 implementation. The test
            // TLEs come from the NORAD document "Space Track Report No. 3".

            // Test SGP4
            string str1 = "SGP4 Test";
            string str2 = "1 88888U          80275.98708465  .00073094  13844-3  66816-4 0     8";
            string str3 = "2 88888  72.8435 115.9689 0086731  52.6988 110.5714 16.05824518   105";

            TwoLineElement tle1 = new TwoLineElement(str1, str2, str3);

            PrintPosVel(tle1);

            Console.WriteLine();

            // Test SDP4
            str1 = "SDP4 Test";
            str2 = "1 11801U          80230.29629788  .01431103  00000-0  14311-1       8";
            str3 = "2 11801  46.7916 230.4354 7318036  47.4722  10.4117  2.28537848     6";

            TwoLineElement tle2 = new TwoLineElement(str1, str2, str3);

            PrintPosVel(tle2);

            Console.WriteLine("\nExample output:");

            // Example: Define a location on the earth, then determine the look-angle
            // to the SDP4 satellite defined above.

            // Create an orbit object using the SDP4 TLE object.
            // Satellite satSDP4 = new Satellite(tle2);
            Orbit orbit = new Orbit(tle2);
            // Get the location of the satellite from the Orbit object. The
            // earth-centered inertial information is placed into eciSDP4.
            // Here we ask for the location of the satellite 90 minutes after
            // the TLE epoch.
            TimedMotionState eciSDP4 = orbit.PositionEci(90.0);

            // Now create a site object. Site objects represent a location on the
            // surface of the earth. Here we arbitrarily select a point on the
            // equator.
            GeoCoord siteEquator = new GeoCoord(0.0, -100.0, 0); // 0.00 N, 100.00 W, 0 km altitude

            // Now get the "look angle" from the site to the satellite.
            // Note that the ECI object "eciSDP4" has a time associated
            // with the coordinates it contains; this is the time at which
            // the look angle is valid.
            TopoCoord topoLook = OrbitUtils.GetSatTopoCoord(eciSDP4, siteEquator);

            // Print out the results. Note that the Azimuth and Elevation are
            // stored in the CoordTopo object as radians. Here we funcKeyToDouble
            // to degrees using Rad2Deg()
            Console.Write("AZ: {0:f3}  EL: {1:f3}\n",
                          topoLook.Azimuth,
                          topoLook.Elevation);
        }
Example #2
0
        private void button_radarCaculate_Click(object sender, EventArgs e)
        {
            bool isGeoCoord = this.radioButton_geoCoord.Checked;

            GeoCoord siteCoord = null;

            if (isGeoCoord)
            {
                siteCoord      = GeoCoord.Parse(this.textBox_coord.Text);
                siteCoord.Unit = AngleUnit.Degree;
            }
            else
            {
                XYZ xyz = XYZ.Parse(this.textBox_coord.Text);
                siteCoord = CoordTransformer.XyzToGeoCoord(xyz);
            }

            TwoLineElement tle = GetTwoLineElement();

            Gnsser.Orbits.Orbit orbit = new Gnsser.Orbits.Orbit(tle);

            double intervalMin = Double.Parse(this.textBox_intervalMin.Text);
            double count       = Int32.Parse(this.textBox_count.Text);

            lonlats = new List <AnyInfo.Geometries.Point>();
            lonlats.Add(new AnyInfo.Geometries.Point(siteCoord, "SitePoint"));
            for (int i = 0; i < count; i++)
            {
                double           time     = i * intervalMin;
                TimedMotionState eciSDP4  = orbit.PositionEci(time);
                TopoCoord        topoLook = OrbitUtils.GetSatTopoCoord(eciSDP4, siteCoord);

                if (topoLook.Elevation > 0)
                {
                    GeoCoord geoCoord = CoordTransformer.XyzToGeoCoord(eciSDP4.Position * 1000, AngleUnit.Degree);
                    lonlats.Add(new AnyInfo.Geometries.Point(geoCoord, i + ""));
                }
            }
        }