TLE structure to file
CL_tle_write(tle, fpath [[, form, opts]])
This function writes a TLE structure to a file:
- Each TLE on two lines if the format is "TLE",
- Each TLE on three lines if the format is "3LE". First line is the description (= object name),
- Using JSON syntax if the format is "JSON".
- Using CCSDS OMM XML syntax if the format is "OMM-XML".
The "desc" field in the "tle" structure is provided:
- In the first (out of 3) line for "3LE" format,
- in the "OBJECT_NAME" field for "JSON" and "OMM-XML" format.
The opts structure enables passing additional parameters if the format is OMM-XML (parameters that are not definéd in the input TLE structure).
The possible fields are:
- comment: (string) Comment in the metadata section (1x1). Default: "Generated via CelestLab"
- originator: (string) Originator in the metadata section (1x1). Default: "CNES"
- center_name: (string) Frame center (1x1). Default: "EARTH"
- ref_frame: (string) Reference frame (1x1). Default: "TEME"
- time_system: (string) Time system (1x1). Default: "UTC"
- mean_element_theory: (string) Mean element theory (1x1). Default: "SGP4"
The output is generated even if the "status" value is not 0.
If a value does not fit with the format, the slot in the string is filled with "#" characters (for TLE or 3LE formats only).
TLE structure (size N)
(string) File name or path
(string, optional) Output format: "TLE", "3LE", "JSON" or "OMM-XML". Default is "3LE"
(struct) Additional parameters (see above)
CNES
str = [.. "1 00005U 58002B 00179.78495062 .00000023 00000-0 28098-4 0 4753"; .. "2 00005 34.2682 348.7242 1859667 331.7664 19.3264 10.82419157413667" ]; tle = CL_tle_parse(str) CL_tle_write(tle, fullfile(TMPDIR, "example_tle.txt"), "TLE"); | ![]() | ![]() |