Ejemplo n.º 1
0
Archivo: TLE.cs Proyecto: yanhc519/sgp4
        /**
         * Parses the two lines optimistically.  No exceptions are thrown but some parse errors will
         * be accumulated as a string.  Call getParseErrors() to see if there are any.
         *
         * @param line1
         * @param line2
         */
        public void parseLines(String line1, String line2)
        {
            parseErrors = null;
            rec         = new ElsetRec();

            this.line1 = line1;
            this.line2 = line2;

            if (line1 == null || line1.Trim().Length < 68) // we can live without checksum
            {
                addParseError("line1 too short");
            }

            if (line2 == null || line2.Trim().Length < 68) // we can live without checksum
            {
                addParseError("line2 too short");
            }

            if (parseErrors != null)
            {
                return;
            }



            objectNum = (int)gd(line1, 2, 7);
            if (objectNum != (int)gd(line2, 2, 7))
            {
                addParseError("ids don't match");
            }

            rec.classification = line1[7];
            //          1         2         3         4         5         6
            //0123456789012345678901234567890123456789012345678901234567890123456789
            //line1="1 00005U 58002B   00179.78495062  .00000023  00000-0  28098-4 0  4753";
            //line2="2 00005  34.2682 348.7242 1859667 331.7664  19.3264 10.82419157413667";

            intlid = line1.Substring(9, 17 - 9).Trim();
            epoch  = parseEpoch(line1.Substring(18, 32 - 18).Trim());
            ndot   = gdi(line1[33], line1, 35, 44);
            nddot  = gdi(line1[44], line1, 45, 50);
            nddot *= Math.Pow(10.0, gd(line1, 50, 52));
            bstar  = gdi(line1[53], line1, 54, 59);
            bstar *= Math.Pow(10.0d, gd(line1, 59, 61));

            elnum = (int)gd(line1, 64, 68);

            incDeg  = gd(line2, 8, 16);
            raanDeg = gd(line2, 17, 25);
            ecc     = gdi('+', line2, 26, 33);
            argpDeg = gd(line2, 34, 42);
            maDeg   = gd(line2, 43, 51);

            n = gd(line2, 52, 63);

            revnum = (int)gd(line2, 63, 68);

            setValsToRec();
        }
Ejemplo n.º 2
0
 public void setElsetRec(ElsetRec er)
 {
     rec = er;
 }