Library
Documentation for SatelliteToolboxTle.jl.
SatelliteToolboxTle.AbstractTleFetcher — Type
abstract type AbstractTleFetcherAbstract type for all TLE fetchers.
SatelliteToolboxTle.TLE — Type
struct TLEStore the elements of a TLE (two-line elements) using the same units.
We do not have fields for the line checksum since they are only required when creating or parsing a TLE string.
Fields
name: Name of the satellite.
First line
satellite_number: Satellite number.classification: Classification ('U', 'C', or 'S').international_designator: International designator.epoch_year: Epoch year (two digits).epoch_day: Epoch day (day + fraction of the day).dn_o2: 1st time derivative of mean motion / 2 [rev/day²].ddn_o6: 2nd time derivative of mean motion / 6 [rev/day³].bstar: B* drag term.element_set_number: Element set number.
Second line
inclination: Inclination [deg].raan: Right ascension of the ascending node [deg].eccentricity: Eccentricity [ ].argument_of_perigee: Argument of perigee [deg].mean_anomaly: Mean anomaly [deg].mean_motion: Mean motion [rev/day].revolution_number: Revolution number at epoch [rev].
Creating TLEs
You can manually create a TLE by calling the function TLE(; kwargs...), where kwargs... are keyword arguments with the same name as the fields. In this case, the following elements are required:
epoch_year,epoch_day,inclination,raan,eccentricity,argument_of_perigee,mean_anomalyandmean_motion.
The other ones are optional and default values will be assigned if not present.
Base.convert — Method
convert(::Type{String}, tle::TLE) -> StringConvert tle to its string representation, returning the satellite name line followed by the two TLE lines with recomputed checksums.
The angles (inclination, RAAN, argument of perigee, and mean anomaly) are normalized to the interval [0, 360)° before being written. If a value cannot be represented in its TLE field, the field is saturated and a warning is emitted.
SatelliteToolboxTle._show_tle — Method
_show_tle(io::IO, tle::TLE; color::Bool = true) -> NothingShow the TLE tle in the IO io.
Keywords
color::Bool: Iftrue, the text will be printed using colors. (Default =true)
SatelliteToolboxTle.create_tle_fetcher — Method
create_tle_fetcher(::Type{CelestrakTleFetcher}; kwargs...) -> CelestrakTleFetcherCreate a TLE fetcher from Celestrak service.
Keywords
url::String: Default PHP webpage address that will be used to perform the queries. (Default: "https://celestrak.org/NORAD/elements/gp.php")
SatelliteToolboxTle.create_tle_fetcher — Method
create_tle_fetcher(::Type{T}, args...; kwargs...) where T <: AbstractTleFetcher -> TCreate a TLE fetcher of type T.
SatelliteToolboxTle.fetch_tles — Method
fetch_tles(fetcher::CelestrakTleFetcher; kwargs...) -> Union{Nothing, Vector{TLE}}Fetch TLEs from the Celestrak using fetch with the parameters in kwargs....
This function returns a Vector{TLE} with the fetched TLEs. If an error is found, it returns nothing.
Keywords
international_designator::Union{Nothing, AbstractString}: International designator using the Celestrak formatYYYY-NNN, whereYYYYis the launch year, and theNNNis the launch number. (Default:nothing)satellite_number::Union{Nothing, Number}: Satellite catalog number (NORAD). (Default =nothing)satellite_name::Union{Nothing, AbstractString}: Satellite name. Notice that the system will search for all satellites whose name contains this string. (Default:nothing)
SatelliteToolboxTle.fetch_tles — Method
fetch_tles(fetcher::T; kwargs...) -> Vector{TLE}Fetch TLEs using fetcher.
The keywords kwargs... are used to customize the search. It depends on the fetcher type T.
SatelliteToolboxTle.read_tle — Method
read_tle(l1::AbstractString, l2::AbstractString; kwargs...) -> TLERead the TLE in which the first line is l1 and second line is l2.
Keywords
name::AbstractString: The satellite name in the returned TLE object. (Default = "UNDEFINED")verify_checksum::Bool: Iftrue, the checksum of both TLE lines will be verified. Otherwise, the checksum will not be checked. (Default =true)
SatelliteToolboxTle.read_tle — Method
read_tle(str::AbstractString; verify_checksum::Bool = true) -> TLERead the TLE in the string str.
str must contain only one TLE. Hence, it must have two or three non-empty lines. The lines beginning with the character # are discarded.
Keywords
verify_checksum::Bool: Iftrue, the checksum of both TLE lines will be verified. Otherwise, the checksum will not be checked. (Default =true)
SatelliteToolboxTle.read_tles — Method
read_tles(tles::AbstractString; verify_checksum::Bool = true) -> Vector{TLE}Parse a set of TLEs in the string tles. This function returns a Vector{TLE} with the parsed TLEs.
Keywords
verify_checksum::Bool: Iftrue, the checksum of both TLE lines will be verified. Otherwise, the checksum will not be checked. (Default =true)
SatelliteToolboxTle.read_tles_from_file — Method
read_tles_from_file(filename::String; verify_checksum::Bool = true) -> Vector{TLE}Read the TLEs in the file filename and return a Vector{TLE} with the parsed TLEs.
Keywords
verify_checksum::Bool: Iftrue, the checksum of both TLE lines will be verified. Otherwise, the checksum will not be checked. (Default =true)
SatelliteToolboxTle.tle_epoch — Method
tle_epoch(tle::TLE) -> Float64Return the Julian day related to the tle epoch.
SatelliteToolboxTle.tle_epoch — Method
tle_epoch(DateTime, tle::TLE) -> DateTimeReturn the DateTime related to the tle epoch.
SatelliteToolboxTle.tle_line_checksum — Method
tle_line_checksum(str::AbstractString) -> IntCompute the checksum of the line str modulo 10.
The algorithm is simple: add all the numbers in the line, ignoring letters, spaces, periods, and plus signs, but assigning +1 to the minus signs. The checksum is the remainder of the division by 10.
SatelliteToolboxTle.@tle_nc_str — Macro
@tle_nc_str(str) -> TLEParse one TLE in the string str.
This function returns the parsed TLE or nothing, if an error occurred.
This function does not verify the checksums of the TLE. If the checksum verification is desired, use @tle_str.
str must contain only one TLE. Hence, it must have two or three non-empty lines. The lines beginning with the character # are discarded.
Example
julia> tles = tle_nc"""
CBERS 4
1 40336U 14079A 18166.15595376 -.00000014 00000-0 10174-4 0 9993
2 40336 98.4141 237.7928 0001694 75.7582 284.3804 14.35485112184485
"""SatelliteToolboxTle.@tle_str — Macro
@tle_str(str) -> TLEParse one TLE in the string str.
This function returns the parsed TLE or nothing, if an error occurred.
This function verifies the checksums of the TLE. If the checksum verification is not desired, use @tle_nc_str.
str must contain only one TLE. Hence, it must have two or three non-empty lines. The lines beginning with the character # are discarded.
Example
julia> tle = tle"""
CBERS 4
1 40336U 14079A 18166.15595376 -.00000014 00000-0 10174-4 0 9993
2 40336 98.4141 237.7928 0001694 75.7582 284.3804 14.35485112184485
"""SatelliteToolboxTle.@tles_nc_str — Macro
@tles_nc_str(str) -> Vector{TLE}Parse a set of TLEs in the string str and return them as a Vector{TLE}.
This version does not verify the checksum of the TLE. If the checksum verification is required, use @tles_str.
Example
julia> tles = tles_nc"""
CBERS 4
1 40336U 14079A 18166.15595376 -.00000014 00000-0 10174-4 0 9993
2 40336 98.4141 237.7928 0001694 75.7582 284.3804 14.35485112184485
SCD 1
1 22490U 93009B 18165.62596833 .00000225 00000-0 11410-4 0 9991
2 22490 24.9690 231.7852 0042844 200.7311 292.7198 14.44524498338066
SCD 2
1 25504U 98060A 18165.15074951 .00000201 00000-0 55356-5 0 9994
2 25504 24.9961 80.1303 0017060 224.4822 286.6438 14.44043397 37312
"""SatelliteToolboxTle.@tles_str — Macro
@tles_str(str) -> Vector{TLE}Parse a set of TLEs in the string str and return them as a Vector{TLE}.
This function verifies the checksums of the TLE. If the checksum verification is not desired, use @tles_nc_str.
Example
julia> tles = tles"""
CBERS 4
1 40336U 14079A 18166.15595376 -.00000014 00000-0 10174-4 0 9993
2 40336 98.4141 237.7928 0001694 75.7582 284.3804 14.35485112184485
SCD 1
1 22490U 93009B 18165.62596833 .00000225 00000-0 11410-4 0 9991
2 22490 24.9690 231.7852 0042844 200.7311 292.7198 14.44524498338066
SCD 2
1 25504U 98060A 18165.15074951 .00000201 00000-0 55356-5 0 9994
2 25504 24.9961 80.1303 0017060 224.4822 286.6438 14.44043397 37312
"""