How to use the sgp4.propagation.sgp4 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 consensys-space / trusat-orbit / tests / test_profile.py View on Github external
print("sgp4_py:                     {:.6f} {:.2f}x".format( *tac(baseline, Timer(lambda: sgp4(satold, tsince)).timeit(number = num)) ))
print()
github brandon-rhodes / python-sgp4 / sgp4 / tests.py View on Github external
def run_legacy_sgp4(satrec, tsince):
        r, v = sgp4(satrec, tsince)
        return (satrec.error, satrec.error_message), r, v
github brandon-rhodes / python-sgp4 / tmp.py View on Github external
line1 = next(lines)
        line2 = next(lines)
        sat = twoline2rv(line1, line2, wgs72)
        sats.append(sat)

    sats = sats[:20]  # first 20 sats

    print(len(sats), 'pure Python sats')
    print(len(jd_array), 'and', len(fr_array), 'times')

    zipped_times = list(zip(jd_array, fr_array))

    for sat in sats:
        for jd, fr in zipped_times:
            t = (jd - sat.jdsatepoch + fr) * 1440.0
            r, v = sgp4(sat, t)
        #     print(r)
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)