How to use the sgp4.io function in sgp4

To help you get started, we’ve selected a few sgp4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brandon-rhodes / python-sgp4 / sgp4 / tests.py View on Github external
def test_legacy_built_with_twoline2rv():
    sat = io.twoline2rv(LINE1, LINE2, wgs72)
    verify_vanguard_1(sat, legacy=True)
    assertEqual(sat.epochdays, VANGUARD_EPOCHDAYS)
github brandon-rhodes / python-sgp4 / sgp4 / tests.py View on Github external
def test_legacy_epochyr():
    # Apparently I saw fit to change the meaning of this attribute
    # in the Python version of SGP4.
    sat = io.twoline2rv(LINE1, LINE2, wgs72)
    assertEqual(sat.epochyr, 2000)
github RazerM / orbital / orbital / elements.py View on Github external
def from_tle(cls, line1, line2, body):
        """Create object by parsing TLE using SGP4."""

        # Get state vector at TLE epoch
        sat = sgp4.io.twoline2rv(line1, line2, wgs72)
        r, v = sgp4.propagation.sgp4(sat, 0)
        ref_epoch = time.Time(sat.epoch, scale='utc')

        # Convert km to m
        r, v = np.array(r) * kilo, np.array(v) * kilo

        return cls.from_state_vector(r, v, body=body, ref_epoch=ref_epoch)