/*****************************************************************************************************************/ /*****************************************************************************************************************/ /** * * A two-line element set (TLE) is the mean orbital elements of an Earth-orbiting object at an epoch, * as are published by the United States Space Force, e.g., by Space-Track and CelesTrak, in the * fixed-column format of two lines of 69 characters each. * * N.B. The elements are mean elements, e.g., the Kozai mean elements of the SGP4 theory they are * fitted against, and not osculating elements, and so they are only meaningful when they are * propagated by that same theory, e.g., SGP4, and not by a Keplerian orbit. * * N.B. The elements are given in the units of the format itself, e.g., degrees for the angles and * revolutions per day for the mean motion, and it is the propagator that converts them to the * units it works in. * * @see https://celestrak.org/columns/v04n03/ * */ export type TwoLineElement = { /** * * The satellite catalogue number of the object, e.g., the NORAD ID, which is decoded from the * Alpha-5 scheme where it exceeds 99,999, e.g., "A0001" is 100001. * */ satellite: number; /** * * The security classification of the element set, e.g., "U" for unclassified, "C" for * classified, or "S" for secret. * */ classification: 'U' | 'C' | 'S'; /** * * The international designator of the object, e.g., the COSPAR ID, in the abbreviated form of the * last two digits of the launch year, the launch number of that year, and the piece of the * launch, e.g., "98067A" for the first piece of the 67th launch of 1998. * * N.B. The designator is empty for an object that was not assigned one, e.g., an analyst object. * */ designator: string; /** * * The epoch of the element set, as a Julian date in Coordinated Universal Time (UTC). * * N.B. The epoch is resolved to the ~0.9 milliseconds that the eight decimal places of the * fractional day of the format resolve, which a Date, of a millisecond resolution, would not * carry exactly. * */ epoch: number; /** * * The first time derivative of the mean motion divided by two, ṅ/2 (in revolutions per day²), * e.g., the "ballistic coefficient" of the format. * * N.B. SGP4 does not use the term, which is carried for the older SGP model it was fitted for. * */ ndot: number; /** * * The second time derivative of the mean motion divided by six, n̈/6 (in revolutions per day³). * * N.B. SGP4 does not use the term, which is carried for the older SGP model it was fitted for. * */ nddot: number; /** * * The B* drag term of the element set (in inverse Earth radii), e.g., the radiation pressure * coefficient of the SGP4 theory, which scales the atmospheric drag on the object. * */ bstar: number; /** * * The ephemeris type of the element set, which is 0 for every element set that is published, * e.g., the elements of the SGP4 theory. * */ ephemeris: number; /** * * The element set number, e.g., the count of the element sets that have been generated for the * object, which is incremented as each new element set is generated for it. * */ element: number; /** * * The inclination of the orbit (in degrees), e.g., the angle between the plane of the orbit and * the plane of the equator, in the range [0, 180]. * */ i: number; /** * * The right ascension of the ascending node of the orbit (in degrees), e.g., the angle from the * vernal equinox to the point at which the object crosses the equator northward, in the range * [0, 360], where 360 is the rounding of the format of an angle of 359.99995° or more. * */ Ω: number; /** * * The eccentricity of the orbit (dimensionless), in the range [0, 1). * */ e: number; /** * * The argument of perigee of the orbit (in degrees), e.g., the angle from the ascending node to * the perigee, in the plane of the orbit, in the range [0, 360], where 360 is the rounding of the * format of an angle of 359.99995° or more. * */ ω: number; /** * * The mean anomaly of the object at the epoch (in degrees), in the range [0, 360], where 360 is * the rounding of the format of an angle of 359.99995° or more. * */ M: number; /** * * The mean motion of the object (in revolutions per day), e.g., the Kozai mean motion of the * SGP4 theory. * */ n: number; /** * * The revolution number of the object at the epoch, e.g., the count of the orbits it has made * since launch, modulo 100,000 in the five columns of the format. * */ revolution: number; }; /*****************************************************************************************************************/ /** * * convertAlpha5ToSatelliteNumber() * * Converts a satellite catalogue number of the Alpha-5 scheme to the number it encodes, e.g., the * scheme by which the five columns of the format carry a catalogue number that exceeds 99,999. * * A catalogue number of up to 99,999 is given as its five digits. One that exceeds it is given as a * letter for its ten-thousands, followed by four digits for the remainder, where the letters "A" * to "Z" stand for 10 to 33, e.g., "A0001" is 100001 and "Z9999" is 339999, the greatest catalogue * number the scheme carries. * * N.B. The letters "I" and "O" are omitted from the scheme, so that they are not mistaken for the * digits "1" and "0", and so the letters that follow them are displaced, e.g., "J" stands for 18 * and "P" stands for 23. * * @param alpha5 - The satellite catalogue number of the Alpha-5 scheme, e.g., "25544" or "A0001". * @throws An error if the catalogue number is not of the Alpha-5 scheme. * @returns The satellite catalogue number it encodes, e.g., 25544 or 100001. * */ export declare function convertAlpha5ToSatelliteNumber(alpha5: string): number; /*****************************************************************************************************************/ /** * * getTwoLineElementChecksum() * * Calculates the checksum of a line of a two-line element set, e.g., the modulo 10 sum of the * first 68 columns of the line, in which each digit counts for its value, each minus sign counts * for one, and every other character, e.g., a letter, a space, a period or a plus sign, counts * for nothing. * * The checksum is carried in the 69th column of the line, and so a line is intact where the * checksum calculated for it is equal to the digit in that column. * * N.B. The checksum is calculated over the first 68 columns alone, and so the checksum of a line * that carries its checksum, or data beyond it, is that of the line without them. * * @param line - The line of the two-line element set, e.g., its first or second line. * @returns The checksum of the line, in the range [0, 9]. * */ export declare function getTwoLineElementChecksum(line: string): number; /*****************************************************************************************************************/ /** * * parseTwoLineElement() * * Parses a two-line element set (TLE) from its two lines of the fixed-column format, e.g., as are * published by Space-Track and CelesTrak, to the mean orbital elements it carries, in the units of * the format itself, e.g., degrees for the angles and revolutions per day for the mean motion. * * Each line is asserted to be of the fixed-column format, e.g., that its separators fall in their * columns, and its checksum, where it carries one in its 69th column, is verified. Any data beyond * the 69th column, e.g., the start, stop and step of a verification element set, is ignored. * * N.B. The epoch of the format carries the last two digits of its year alone, which are resolved * as the years 1957 to 2056, e.g., "57" is 1957 and "56" is 2056, as the first object was launched * in 1957. * * N.B. The catalogue number of the object is decoded from the Alpha-5 scheme where it exceeds * 99,999, e.g., "A0001" is 100001. * * @see https://celestrak.org/columns/v04n03/ * * @param line1 - The first line of the two-line element set. * @param line2 - The second line of the two-line element set. * @throws An error if either line is not of the fixed-column format, or its checksum is not that of the line. * @throws An error if the catalogue numbers of the two lines are not the same. * @throws An error if either line is not of printable ASCII characters alone. * @throws An error if the inclination is not within [0, 180], or the right ascension of the ascending node, the argument of perigee or the mean anomaly is not within [0, 360]. * @throws An error if the mean motion is not greater than zero. * @returns The two-line element set, e.g., the mean orbital elements of the object at its epoch. * */ export declare function parseTwoLineElement(line1: string, line2: string): TwoLineElement; /*****************************************************************************************************************/