Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_legacy_built_with_twoline2rv():
sat = io.twoline2rv(LINE1, LINE2, wgs72)
verify_vanguard_1(sat, legacy=True)
assertEqual(sat.epochdays, VANGUARD_EPOCHDAYS)
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)
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)