hypergas.tle module

Get the Two Line Element (TLE) file at specific time.

class hypergas.tle.TLE(id)[source]

Bases: object

Get the TLE list for satellite observation using spacetrack.

get_tle(start_date, end_date, overpass_time=None)[source]

Get the TLE content as list, optionally selecting the closest to overpass time.

Parameters:
  • start_date (datetime) – Beginning of observation datatime.

  • end_date (datetime) – End of observation datatime.

  • overpass_time (datetime, optional) – If provided, returns only the TLE closest to this time. If None, returns all TLEs in the time range.

Returns:

tles (TLE data in lines. If overpass_time is provided, returns a list of 2 lines) – (line1, line2) for the closest TLE. Otherwise, returns all TLE lines.

static parse_tle_epoch(tle_line1)[source]

Parse the epoch from TLE Line 1.

The epoch is in columns 19-32 of Line 1 in the format: YYDDD.DDDDDDDD where YY is the year, DDD is the day of year, and .DDDDDDDD is the fractional day.

Parameters:

tle_line1 (str) – The first line of the TLE.

Returns:

epoch (datetime) – The epoch time of the TLE.