Skip to content

SP3

Reader, writer, and in-memory builder for SP3 precise orbit files.

SP3

SP3

SP3(satellites: list[str | SP3SatelliteId], epoch_interval: float, header: SP3Header | None = None)

An SP3 precise orbit file held in memory.

Read SP3-a through SP3-d files, build files epoch by epoch, and write SP3-d text. All values are SI. The file stores satellites in header order and records on a fixed epoch grid. Properties and accessors return copies; to change the header or a record, modify the copy and assign it back with sp3.header = header or sp3.set_record(...).

The constructor creates an empty file with a fixed epoch grid. It keeps header with three fields set from the other arguments: epoch_interval, file_type (the common system when all satellites share one, M otherwise), and accuracies, which is filled with one unknown accuracy per satellite when it is empty. Header labels and the time system are checked when the file is written.

Parameters:

Name Type Description Default
satellites list[str | SP3SatelliteId]

Satellites in header order, at most 999, no duplicates.

required
epoch_interval float

Spacing of the epoch grid, seconds.

required
header SP3Header | None

Header of the file; defaults to SP3Header().

None

Raises:

Type Description
BraheError

If a satellite is invalid or duplicated, there are more than 999 satellites, or the interval is not positive and finite.

Example
import brahe as bh
import numpy as np

sp3 = bh.SP3(["G01", "G02"], 900.0, bh.SP3Header(agency="TEST"))
t0 = bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS)
sp3.set_record("G01", t0, bh.SP3Record(np.array([15.0e6, 20.0e6, 5.0e6]), clock=2.5e-5))

parsed = bh.SP3.from_str(sp3.to_string())
assert parsed.num_epochs == 1
assert abs(parsed.record("G01", t0).clock - 2.5e-5) < 1e-12

Initialize instance.

end_epoch property

end_epoch: Epoch | None

Last epoch of the file.

Returns:

Type Description
Epoch | None

Epoch | None: Last epoch, or None if the file has no epochs.

epochs property

epochs: list[Epoch]

Epochs of the file.

Returns:

Type Description
list[Epoch]

list[Epoch]: Epochs in ascending order, in the file's time system.

fractional_day property

fractional_day: float | None

Fractional day of the first epoch, in the time system of the file.

Returns:

Type Description
float | None

float | None: The value, or None if the file has no epochs or its time system has no Brahe equivalent.

gps_week property

gps_week: int | None

GPS week of the first epoch, in the time system of the file.

Returns:

Type Description
int | None

int | None: The value, or None if the file has no epochs or its time system has no Brahe equivalent.

header property

header: SP3Header

File header.

Returns:

Name Type Description
SP3Header SP3Header

A copy of the header. Assign a modified copy back to replace the header.

interpolation_degree property

interpolation_degree: int

Degree of the Lagrange polynomials that the satellites taken from the file fit through their samples. It is not part of the file format and is 9 for a new or parsed file; a degree of 9 fits 10 samples.

Returns:

Name Type Description
int int

The degree.

Example
1
2
3
4
5
6
import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
assert sp3.interpolation_degree == 9
sp3.interpolation_degree = 7
assert sp3.satellite("G01").interpolation_degree == 7

mjd property

mjd: int | None

Modified Julian day number of the first epoch, in the time system of the file.

Returns:

Type Description
int | None

int | None: The value, or None if the file has no epochs or its time system has no Brahe equivalent.

num_epochs property

num_epochs: int

Number of epochs.

Returns:

Name Type Description
int int

Epoch count.

num_satellites property

num_satellites: int

Number of satellites.

Returns:

Name Type Description
int int

Satellite count.

satellite_ids property

satellite_ids: list[SP3SatelliteId]

Satellites in header order.

Returns:

Type Description
list[SP3SatelliteId]

list[SP3SatelliteId]: Satellite identifiers.

seconds_of_week property

seconds_of_week: float | None

Seconds of the GPS week of the first epoch, in the time system of the file.

Returns:

Type Description
float | None

float | None: The value, or None if the file has no epochs or its time system has no Brahe equivalent.

start_epoch property

start_epoch: Epoch | None

First epoch of the file.

Returns:

Type Description
Epoch | None

Epoch | None: First epoch, or None if the file has no epochs.

from_bytes staticmethod

from_bytes(data: bytes) -> SP3

Parse an SP3 file from bytes that are plain text or compressed.

Gzip and Unix compress (.Z) data is detected from its leading bytes and decompressed; the decompressed size is limited to 1 GiB.

Parameters:

Name Type Description Default
data bytes

File contents: SP3 text, or a gzip or Unix compress stream of SP3 text.

required

Returns:

Name Type Description
SP3 SP3

The parsed file.

Raises:

Type Description
BraheError

If the compressed stream is corrupt or decompresses to more than 1 GiB, the text is not UTF-8, or the header or any record is malformed.

Example
1
2
3
4
5
import brahe as bh

with open("test_assets/sp3/nsgf.orb.stella.v00.sp3.gz", "rb") as f:
    sp3 = bh.SP3.from_bytes(f.read())
assert sp3.num_epochs > 0

from_file staticmethod

from_file(path: str) -> SP3

Read and parse an SP3 file.

Gzip and Unix compress (.Z) files are decompressed based on their leading bytes.

Parameters:

Name Type Description Default
path str

Path to a plain-text, gzip-compressed, or Unix-compressed file; any os.PathLike is accepted.

required

Returns:

Name Type Description
SP3 SP3

The parsed file.

Raises:

Type Description
BraheError

If the file cannot be read or parsed.

Example
1
2
3
4
import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
assert sp3.header.version == bh.SP3Version.D

from_str staticmethod

from_str(content: str) -> SP3

Parse an SP3 file from text.

Parameters:

Name Type Description Default
content str

Full file text.

required

Returns:

Name Type Description
SP3 SP3

The parsed file.

Raises:

Type Description
BraheError

If the header or any record is malformed. Messages carry the one-based line number.

Example
1
2
3
4
5
import brahe as bh

text = open("test_assets/sp3/example-d-2.sp3").read()
sp3 = bh.SP3.from_str(text)
assert sp3.num_satellites == 26

from_trajectories staticmethod

from_trajectories(trajectories: list[tuple[str | SP3SatelliteId, OrbitTrajectory]], step: float | None = None, header: SP3Header | None = None) -> SP3

Build an SP3 file from orbit trajectories.

Without step, the file holds the epochs the trajectories store: the trajectories must store the same epochs, to within 1 ms, on a regular grid whose interval is the spacing of the first two. With step, each trajectory is interpolated at start + k * step over the span all trajectories cover, from the latest first epoch to the earliest last epoch. States are converted to ITRF. Velocities are stored when header.has_velocity is set. Clocks and clock rates are absent and are written as the format's bad-clock value unless set with set_clocks and set_clock_rates. The file type follows the satellite systems.

A propagator supplies the trajectory it has propagated as propagator.trajectory, and an SP3Satellite supplies one with to_trajectory().

Parameters:

Name Type Description Default
trajectories list[tuple[str | SP3SatelliteId, OrbitTrajectory]]

Satellite identifiers paired with their trajectories.

required
step float | None

Epoch spacing to resample at, seconds. Default: None, which keeps the stored epochs.

None
header SP3Header | None

Header of the file; defaults to SP3Header(). Its epoch interval is set from the epochs written.

None

Returns:

Name Type Description
SP3 SP3

The file.

Raises:

Type Description
TypeError

If an item is not a (satellite, OrbitTrajectory) tuple.

BraheError

If no trajectory is given, a trajectory is empty, the satellites are invalid, the trajectories share no span, the stored epochs differ between trajectories, number fewer than two, or are off a regular grid, or a state is unavailable or not finite.

Example
import brahe as bh
import numpy as np

bh.initialize_eop()
t0 = bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS)
oe = np.array([bh.R_EARTH + 800e3, 0.001, 98.0, 0.0, 0.0, 0.0])
prop = bh.KeplerianPropagator.from_keplerian(t0, oe, bh.AngleFormat.DEGREES, 60.0)
prop.propagate_to(t0 + 3600.0)

sp3 = bh.SP3.from_trajectories([("L01", prop.trajectory)], header=bh.SP3Header(agency="DEMO"))
assert sp3.num_epochs == 61

sp3 = bh.SP3.from_trajectories([("L01", prop.trajectory)], step=300.0)
assert sp3.num_epochs == 13

record method descriptor

record(satellite: str | SP3SatelliteId, epoch: Epoch) -> SP3Record | None

Record of a satellite at an epoch of the file.

Parameters:

Name Type Description Default
satellite str | SP3SatelliteId

Satellite.

required
epoch Epoch

One of the file's epochs, matched to within 1 ms.

required

Returns:

Type Description
SP3Record | None

SP3Record | None: A copy of the record, or None if the satellite is absent at that epoch.

Raises:

Type Description
BraheError

If the satellite is not in the file or the file has no such epoch.

Example
1
2
3
4
5
import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
record = sp3.record("G01", sp3.epochs[0])
print(record.position, record.clock)

satellite method descriptor

satellite(satellite: str | SP3SatelliteId) -> SP3Satellite

Extract one satellite.

The result keeps the epochs where the satellite has a record with a non-zero position.

Parameters:

Name Type Description Default
satellite str | SP3SatelliteId

Satellite.

required

Returns:

Name Type Description
SP3Satellite SP3Satellite

The satellite.

Raises:

Type Description
BraheError

If the satellite is not in the file or has no valid sample.

Example
1
2
3
4
5
import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
g01 = sp3.satellite("G01")
print(len(g01), g01.start_epoch, g01.end_epoch)

satellites method descriptor

satellites() -> list[SP3Satellite]

Extract every satellite that has at least one valid sample.

Returns:

Type Description
list[SP3Satellite]

list[SP3Satellite]: Satellites in header order, omitting satellites without a valid sample.

Example
1
2
3
4
5
import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
for sat in sp3.satellites():
    print(sat.id, len(sat))

set_clock_rates method descriptor

set_clock_rates(satellite: str | SP3SatelliteId, rates: list[float | None]) -> Any

Set the clock rate of a satellite at every epoch.

Clock rates are stored on velocity records, so the file must have velocity records. None or NaN clears the rate at that epoch. Nothing is modified when the call fails.

Parameters:

Name Type Description Default
satellite str | SP3SatelliteId

Satellite.

required
rates list[float | None]

One clock rate per epoch of the file, seconds per second. NaN is treated as None.

required

Raises:

Type Description
BraheError

If the file has no velocity records, the satellite is not in the file, rates does not hold one value per epoch, or a value is given at an epoch where the satellite has no record.

Example
import brahe as bh
import numpy as np

sp3 = bh.SP3(["G01"], 900.0)
sp3.set_epoch(bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS), [])
record = bh.SP3Record(np.array([2.0e7, 1.0e7, 1.0e7]), velocity=np.array([0.0, 3000.0, 0.0]))
sp3.set_record("G01", sp3.epochs[0], record)

sp3.set_clock_rates("G01", [1e-12])
assert sp3.record("G01", sp3.epochs[0]).clock_rate == 1e-12

set_clocks method descriptor

set_clocks(satellite: str | SP3SatelliteId, clocks: list[float | None]) -> Any

Set the clock correction of a satellite at every epoch.

None or NaN clears the clock at that epoch, so the clocks() array of an SP3Satellite can be passed back. Nothing is modified when the call fails.

Parameters:

Name Type Description Default
satellite str | SP3SatelliteId

Satellite.

required
clocks list[float | None]

One clock correction per epoch of the file, seconds. NaN is treated as None.

required

Raises:

Type Description
BraheError

If the satellite is not in the file, clocks does not hold one value per epoch, or a value is given at an epoch where the satellite has no record.

Example
import brahe as bh
import numpy as np

sp3 = bh.SP3(["G01"], 900.0)
t0 = bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS)
sp3.set_epoch(t0, [])
sp3.set_epoch(t0 + 900.0, [])
sp3.set_record("G01", sp3.epochs[0], bh.SP3Record(np.array([2.0e7, 1.0e7, 1.0e7])))

sp3.set_clocks("G01", [1e-5, None])
assert sp3.record("G01", sp3.epochs[0]).clock == 1e-5

set_epoch method descriptor

set_epoch(epoch: Epoch, records: list[tuple[str | SP3SatelliteId, SP3Record]]) -> Any

Set the records of every satellite at an epoch.

The epoch is added or addressed as in set_record. Satellites of the file that records does not list are absent at the epoch, so an empty list gives an epoch at which every satellite is absent. Nothing is modified when the call fails.

Parameters:

Name Type Description Default
epoch Epoch

Epoch of the records.

required
records list[tuple[str | SP3SatelliteId, SP3Record]]

Satellites paired with their records.

required

Raises:

Type Description
BraheError

If a satellite is not in the file or is listed twice, the epoch is off the grid, or a position or velocity has a NaN or infinite component.

Example
import brahe as bh
import numpy as np

sp3 = bh.SP3(["G01", "G02"], 900.0)
t0 = bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS)
sp3.set_epoch(t0, [
    ("G01", bh.SP3Record(np.array([2.0e7, 1.0e7, 1.0e7]))),
    ("G02", bh.SP3Record(np.array([-1.5e7, 2.0e7, 5.0e6]))),
])
sp3.set_epoch(t0 + 900.0, [("G01", bh.SP3Record(np.array([2.1e7, 1.0e7, 1.0e7])))])
assert sp3.record("G02", t0) is not None
assert sp3.record("G02", t0 + 900.0) is None

set_record method descriptor

set_record(satellite: str | SP3SatelliteId, epoch: Epoch, record: SP3Record) -> Any

Set the record of a satellite at an epoch.

An epoch the file does not hold is added at its place in the epoch order, with every other satellite absent; it must lie on the grid of the epoch interval anchored at the first epoch, to within 1 ms. An epoch within 1 ms of one the file holds addresses that epoch. A record whose position is exactly zero marks the satellite as absent at that epoch. Nothing is modified when the call fails.

Parameters:

Name Type Description Default
satellite str | SP3SatelliteId

Satellite.

required
epoch Epoch

Epoch of the record.

required
record SP3Record

Record to store.

required

Raises:

Type Description
BraheError

If the satellite is not in the file, the epoch is off the grid, or the position or velocity has a NaN or infinite component.

Example
1
2
3
4
5
6
7
8
9
import brahe as bh
import numpy as np

sp3 = bh.SP3(["G01"], 900.0)
t0 = bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS)
sp3.set_record("G01", t0, bh.SP3Record(np.array([2.0e7, 1.0e7, 1.0e7])))
sp3.set_record("G01", t0 + 1800.0, bh.SP3Record(np.array([2.1e7, 1.0e7, 1.0e7])))
assert sp3.num_epochs == 2
assert sp3.record("G01", t0) is not None

to_file method descriptor

to_file(path: str) -> Any

Write the file as SP3-d text.

The text is gzip-compressed when the path ends in .gz, compared case-insensitively. The data is written to a temporary file and renamed into place, so a failed write leaves any existing file unchanged. The parent directory must exist.

Parameters:

Name Type Description Default
path str

Destination path; any os.PathLike is accepted. A .gz extension selects gzip output.

required

Raises:

Type Description
BraheError

If the file cannot be represented in SP3-d or cannot be written.

Example
1
2
3
4
5
6
7
8
import os
import tempfile

import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
with tempfile.TemporaryDirectory() as directory:
    sp3.to_file(os.path.join(directory, "example-d-2-copy.sp3"))

to_string method descriptor

to_string() -> str

Render the file as SP3-d text.

The version, epoch count, start epoch, GPS week, and date fields are derived from the epoch table rather than taken from the header.

Returns:

Name Type Description
str str

The file text.

Raises:

Type Description
BraheError

If the file cannot be represented in SP3-d, for example an off-grid epoch, an epoch interval that rounds to zero at 8 decimal places, a comment longer than 77 characters, a header label longer than its field (agency 4, coordinate system 5, data used 5, orbit type 3 characters; shorten it by assigning a modified header), or a value that does not fit its column.

Example
1
2
3
4
import brahe as bh

sp3 = bh.SP3.from_file("test_assets/sp3/example-d-2.sp3")
assert sp3.to_string().startswith("#dV2001")

SP3Satellite

SP3Satellite

SP3Satellite()

Orbit and clock samples of one satellite from SP3 data.

Only epochs where the satellite has a valid position are kept, and records() holds one SP3Record per epoch of epochs(). Positions and velocities are in the file's Earth-fixed frame (ITRF), in m and m/s.

The satellite is an orbit state provider with the same state_* and states_* methods as OrbitTrajectory, named after its identifier (such as "G01"), so it can be passed to location_accesses. A state is interpolated in ITRF with a Lagrange polynomial of degree interpolation_degree through the samples around the requested epoch, as centered as the samples allow; a satellite with fewer samples uses all of them. The velocity is interpolated from the records when every sample of the fit has one, and is the derivative of the position polynomial otherwise. A request before the first sample or after the last one raises BraheError, as does any request to a satellite with a single sample.

Missing samples do not stop interpolation: a state between two samples that are further apart than the epoch interval is fitted through the samples around the hole and loses accuracy as the hole grows. gaps() lists those holes.

Example
import brahe as bh
import numpy as np

sp3 = bh.SP3(["G01"], 900.0, bh.SP3Header(has_velocity=False))
t0 = bh.Epoch(2024, 11, 10, 0, 0, 0.0, 0.0, time_system=bh.GPS)
for k in range(4):
    sp3.set_record("G01", t0 + 900.0 * k, bh.SP3Record(np.array([2.0e7 + 900.0 * k, 1.0e7, 1.0e7])))

sat = sp3.satellite("G01")
assert len(sat) == 4
assert sat.get_name() == "G01"
state = sat.state_itrf(t0 + 450.0)
assert abs(state[3] - 1.0) < 1e-9
assert sat.gaps() == []
assert len(sat.to_trajectory()) == 4

Initialize instance.

end_epoch property

end_epoch: Epoch

Epoch of the last sample.

Returns:

Name Type Description
Epoch Epoch

Last sample epoch.

id property

Satellite identifier.

Returns:

Name Type Description
SP3SatelliteId SP3SatelliteId

The identifier.

interpolation_degree property

interpolation_degree: int

Degree of the Lagrange polynomials fitted through the samples. A fit uses degree + 1 samples, or every sample when the satellite has fewer. The satellite takes the degree of the file it comes from.

Returns:

Name Type Description
int int

The degree, at least 1.

Raises:

Type Description
BraheError

If set to zero.

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
assert sat.interpolation_degree == 9
sat.interpolation_degree = 7

start_epoch property

start_epoch: Epoch

Epoch of the first sample.

Returns:

Name Type Description
Epoch Epoch

First sample epoch.

state_dim property

state_dim: int

Dimension of the provider state.

Returns:

Name Type Description
int int

Always 6 (position then velocity).

clock_rates method descriptor

clock_rates() -> ndarray

Clock rates of the valid samples.

Returns:

Type Description
ndarray

numpy.ndarray: Array of shape (N,) with the clock rate of each sample in seconds per second, NaN where the file has a bad or missing rate.

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
rates = sat.clock_rates()
assert len(rates) == len(sat)

clocks method descriptor

clocks() -> ndarray

Clock corrections of the valid samples.

Returns:

Type Description
ndarray

numpy.ndarray: Array of shape (N,) with the clock correction of each sample in seconds, NaN where the file has a bad or missing clock.

Example
1
2
3
4
5
import brahe as bh
import numpy as np

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
valid = ~np.isnan(sat.clocks())

epochs method descriptor

epochs() -> list[Epoch]

Epochs of the valid samples, in increasing order.

Returns:

Type Description
list[Epoch]

list[Epoch]: Sample epochs.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = sat.epochs()

from_files staticmethod

from_files(files: list[SP3]) -> list[SP3Satellite]

Chain every satellite across several SP3 files.

The files are sorted by start epoch, so they may be passed in any order, and files without epochs are ignored. Each satellite in the union of the files' satellite lists collects its valid samples from every file that contains it; a file that lacks a satellite leaves a gap in it. Two consecutive files may share their boundary epoch, where the later file's sample is kept. The files must have the same epoch interval. Time systems, agencies, coordinate system labels, and orbit types need not match.

Parameters:

Name Type Description Default
files list[SP3]

SP3 files covering consecutive, non-overlapping spans.

required

Returns:

Type Description
list[SP3Satellite]

list[SP3Satellite]: One satellite for each identifier with at least one valid sample, in ascending identifier order.

Raises:

Type Description
BraheError

If the files have different epoch intervals, two files overlap by more than a shared boundary epoch, or two consecutive samples are closer than half the epoch interval.

Example
1
2
3
4
5
6
7
8
import brahe as bh

files = [
    bh.SP3.from_file("test_assets/sp3/gbm19500_truncated.sp3"),
    bh.SP3.from_file("test_assets/sp3/gbm19500_after_drop.sp3"),
]
sats = bh.SP3Satellite.from_files(files)
print(len(sats), sats[0].id, len(sats[0]))

gaps method descriptor

gaps() -> list[tuple[Epoch, Epoch]]

Spans where samples are missing.

Two consecutive samples more than 1.5 epoch intervals apart have a gap between them. A satellite with zero positions at 10:15 and 10:30 in a 15-minute file has one gap, from 10:00 to 10:45.

Returns:

Type Description
list[tuple[Epoch, Epoch]]

list[tuple[Epoch, Epoch]]: The last sample before and the first sample after each gap, in time order.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
assert sat.gaps() == []

generate_uuid method descriptor

generate_uuid() -> Any

Generate a new UUID and set it in place.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat.generate_uuid()

get_id method descriptor

get_id() -> int | None

Get the numeric ID.

Returns:

Type Description
int | None

int | None: The numeric ID, or None if not set.

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat.set_id(5)
assert sat.get_id() == 5

get_name method descriptor

get_name() -> str | None

Get the name.

Returns:

Type Description
str | None

str | None: The name; defaults to the satellite identifier, such as "G01".

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
assert sat.get_name() == "G05"

get_uuid method descriptor

get_uuid() -> str | None

Get the UUID.

Returns:

Type Description
str | None

str | None: The UUID as a string, or None if not set.

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat.generate_uuid()
uuid = sat.get_uuid()

positions method descriptor

positions() -> ndarray

Positions of the valid samples.

Returns:

Type Description
ndarray

numpy.ndarray: Array of shape (N, 3) with the ITRF position of each sample, meters.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
assert sat.positions().shape == (len(sat), 3)

records method descriptor

records() -> list[SP3Record]

Full file records of the valid samples.

The records hold the file values unchanged, including standard deviations, flags, and correlations.

Returns:

Type Description
list[SP3Record]

list[SP3Record]: A copy of the record of each sample.

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
record = sat.records()[0]
position = record.position

set_id method descriptor

set_id(id: int | None) -> Any

Set the numeric ID in place.

Parameters:

Name Type Description Default
id int | None

Numeric ID to assign, or None to clear.

required
Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat.set_id(5)

set_identity method descriptor

set_identity(name: str | None, uuid_str: str | None, id: int | None) -> Any

Set every identity field in place.

Parameters:

Name Type Description Default
name str | None

Name to assign.

required
uuid_str str | None

UUID string to assign.

required
id int | None

Numeric ID to assign.

required

Raises:

Type Description
ValueError

If uuid_str is not a valid UUID.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat.set_identity("G05", None, 5)

set_name method descriptor

set_name(name: str | None) -> Any

Set the name in place.

The trajectories returned afterwards carry the same name.

Parameters:

Name Type Description Default
name str | None

Name to assign, or None to clear.

required
Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat.set_name("GPS IIR-M G05")

state method descriptor

state(epoch: Epoch) -> ndarray

State at an epoch in ITRF.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: ITRF state [x, y, z, vx, vy, vz] (meters, m/s).

Raises:

Type Description
BraheError

If the epoch is outside the samples or the satellite has a single sample.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state(sat.start_epoch + 150.0)

state_bcbf method descriptor

state_bcbf(epoch: Epoch) -> ndarray

State at an epoch in the Earth's body-centered body-fixed frame (ITRF).

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: BCBF state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_bcbf(sat.start_epoch + 150.0)

state_bci method descriptor

state_bci(epoch: Epoch) -> ndarray

State at an epoch in the Earth's body-centered inertial frame (GCRF).

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: BCI state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_bci(sat.start_epoch + 150.0)

state_ecef method descriptor

state_ecef(epoch: Epoch) -> ndarray

State at an epoch in ECEF (ITRF) Cartesian coordinates.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: ECEF state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_ecef(sat.start_epoch + 150.0)

state_eci method descriptor

state_eci(epoch: Epoch) -> ndarray

State at an epoch in ECI (GCRF) Cartesian coordinates.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: ECI state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_eci(sat.start_epoch + 150.0)

state_eme2000 method descriptor

state_eme2000(epoch: Epoch) -> ndarray

State at an epoch in EME2000 Cartesian coordinates.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: EME2000 state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_eme2000(sat.start_epoch + 150.0)

state_gcrf method descriptor

state_gcrf(epoch: Epoch) -> ndarray

State at an epoch in GCRF Cartesian coordinates.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: GCRF state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_gcrf(sat.start_epoch + 150.0)

state_in_frame method descriptor

state_in_frame(frame: CelestialFrame, epoch: Epoch) -> ndarray

State at an epoch expressed in an arbitrary reference frame.

Parameters:

Name Type Description Default
frame CelestialFrame

Reference frame to express the state in.

required
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: State [x, y, z, vx, vy, vz] in frame (meters, m/s).

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_in_frame(bh.CelestialFrame.GCRF, sat.start_epoch + 150.0)

state_itrf method descriptor

state_itrf(epoch: Epoch) -> ndarray

State at an epoch in ITRF Cartesian coordinates.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required

Returns:

Type Description
ndarray

numpy.ndarray: ITRF state [x, y, z, vx, vy, vz] (meters, m/s).

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
state = sat.state_itrf(sat.start_epoch + 150.0)

state_koe_mean method descriptor

state_koe_mean(epoch: Epoch, angle_format: AngleFormat) -> ndarray

Mean Keplerian elements at an epoch.

Mean elements are orbit-averaged elements that remove short-period and long-period J2 perturbations using first-order Brouwer-Lyddane theory.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required
angle_format AngleFormat

Angle format of the angular elements.

required

Returns:

Type Description
ndarray

numpy.ndarray: Mean elements [a, e, i, raan, argp, mean_anomaly].

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
oe = sat.state_koe_mean(sat.start_epoch + 150.0, bh.AngleFormat.DEGREES)

state_koe_osc method descriptor

state_koe_osc(epoch: Epoch, angle_format: AngleFormat) -> ndarray

Osculating Keplerian elements at an epoch.

Parameters:

Name Type Description Default
epoch Epoch

Epoch to evaluate.

required
angle_format AngleFormat

Angle format of the angular elements.

required

Returns:

Type Description
ndarray

numpy.ndarray: Osculating elements [a, e, i, raan, argp, mean_anomaly].

Example
1
2
3
4
5
6
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
oe = sat.state_koe_osc(sat.start_epoch + 150.0, bh.AngleFormat.DEGREES)

states method descriptor

states(epochs: list[Epoch]) -> list[ndarray]

ITRF states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: ITRF state [x, y, z, vx, vy, vz] at each epoch (meters, m/s).

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states(epochs)

states_bcbf method descriptor

states_bcbf(epochs: list[Epoch]) -> list[ndarray]

Body-centered body-fixed (ITRF) states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: BCBF state at each epoch (meters, m/s).

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_bcbf(epochs)

states_bci method descriptor

states_bci(epochs: list[Epoch]) -> list[ndarray]

Body-centered inertial (GCRF) states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: BCI state at each epoch (meters, m/s).

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_bci(epochs)

states_ecef method descriptor

states_ecef(epochs: list[Epoch]) -> list[ndarray]

ECEF (ITRF) states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: ECEF state at each epoch (meters, m/s).

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_ecef(epochs)

states_eci method descriptor

states_eci(epochs: list[Epoch]) -> list[ndarray]

ECI (GCRF) states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: ECI state at each epoch (meters, m/s).

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_eci(epochs)

states_eme2000 method descriptor

states_eme2000(epochs: list[Epoch]) -> list[ndarray]

EME2000 states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: EME2000 state at each epoch (meters, m/s).

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_eme2000(epochs)

states_gcrf method descriptor

states_gcrf(epochs: list[Epoch]) -> list[ndarray]

GCRF states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: GCRF state at each epoch (meters, m/s).

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_gcrf(epochs)

states_in_frame method descriptor

states_in_frame(frame: CelestialFrame, epochs: list[Epoch]) -> list[ndarray]

States at several epochs expressed in an arbitrary reference frame.

Parameters:

Name Type Description Default
frame CelestialFrame

Reference frame to express the states in.

required
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: State in frame at each epoch (meters, m/s).

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_in_frame(bh.CelestialFrame.GCRF, epochs)

states_itrf method descriptor

states_itrf(epochs: list[Epoch]) -> list[ndarray]

ITRF states at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: ITRF state at each epoch (meters, m/s).

Example
1
2
3
4
5
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
states = sat.states_itrf(epochs)

states_koe_mean method descriptor

states_koe_mean(epochs: list[Epoch], angle_format: AngleFormat) -> list[ndarray]

Mean Keplerian elements at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required
angle_format AngleFormat

Angle format of the angular elements.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: Mean elements [a, e, i, raan, argp, mean_anomaly] at each epoch.

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
elements = sat.states_koe_mean(epochs, bh.AngleFormat.DEGREES)

states_koe_osc method descriptor

states_koe_osc(epochs: list[Epoch], angle_format: AngleFormat) -> list[ndarray]

Osculating Keplerian elements at several epochs.

Parameters:

Name Type Description Default
epochs list[Epoch]

Epochs to evaluate.

required
angle_format AngleFormat

Angle format of the angular elements.

required

Returns:

Type Description
list[ndarray]

list[numpy.ndarray]: Osculating elements [a, e, i, raan, argp, mean_anomaly] at each epoch.

Example
1
2
3
4
5
6
7
import brahe as bh

bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
epochs = [sat.start_epoch + 300.0 * k for k in range(3)]
elements = sat.states_koe_osc(epochs, bh.AngleFormat.DEGREES)

to_trajectory method descriptor

to_trajectory() -> OrbitTrajectory

Convert the samples to an ITRF trajectory.

The trajectory is a Cartesian OrbitTrajectory in the ITRF frame with the name, ID, and UUID of the satellite and Lagrange interpolation of degree interpolation_degree, or the number of samples less one for a satellite with fewer samples. The state at each sample is the one the satellite provides at that epoch. Gaps are not marked in the trajectory; see gaps().

Returns:

Name Type Description
OrbitTrajectory OrbitTrajectory

The trajectory.

Raises:

Type Description
BraheError

If the satellite has a single sample.

Example
1
2
3
4
5
6
7
import brahe as bh
bh.initialize_eop()

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
trajectory = sat.to_trajectory()
assert len(trajectory) == len(sat)
gcrf = trajectory.to_gcrf()

velocities method descriptor

velocities() -> ndarray

Velocities the file carries for the valid samples.

Only velocity records read from the file are returned; nothing is derived from the positions. Use the state methods for a velocity at any epoch.

Returns:

Type Description
ndarray

numpy.ndarray: Array of shape (N, 3) with the ITRF velocity of each sample in meters per second, NaN where the file has none.

Example
1
2
3
4
5
6
import brahe as bh
import numpy as np

sat = bh.SP3.from_file("test_assets/sp3/example-a-2.sp3").satellites()[0]
velocities = sat.velocities()
assert velocities.shape == (len(sat), 3)

with_id method descriptor

with_id(id: int) -> SP3Satellite

Set the numeric ID and return self (builder pattern).

Parameters:

Name Type Description Default
id int

Numeric ID to assign.

required

Returns:

Name Type Description
SP3Satellite SP3Satellite

Self with the ID set.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat = sat.with_id(5)

with_identity method descriptor

with_identity(name: str | None, uuid_str: str | None, id: int | None) -> SP3Satellite

Set every identity field and return self (builder pattern).

Parameters:

Name Type Description Default
name str | None

Name to assign.

required
uuid_str str | None

UUID string to assign.

required
id int | None

Numeric ID to assign.

required

Returns:

Name Type Description
SP3Satellite SP3Satellite

Self with the identity set.

Raises:

Type Description
ValueError

If uuid_str is not a valid UUID.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat = sat.with_identity("G05", None, 5)

with_name method descriptor

with_name(name: str) -> SP3Satellite

Set the name and return self (builder pattern).

Parameters:

Name Type Description Default
name str

Name to assign.

required

Returns:

Name Type Description
SP3Satellite SP3Satellite

Self with the name set.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat = sat.with_name("GPS IIR-M G05")

with_new_uuid method descriptor

with_new_uuid() -> SP3Satellite

Generate a new UUID, set it, and return self (builder pattern).

Returns:

Name Type Description
SP3Satellite SP3Satellite

Self with a new UUID set.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat = sat.with_new_uuid()

with_uuid method descriptor

with_uuid(uuid_str: str) -> SP3Satellite

Set the UUID and return self (builder pattern).

Parameters:

Name Type Description Default
uuid_str str

UUID string to assign.

required

Returns:

Name Type Description
SP3Satellite SP3Satellite

Self with the UUID set.

Raises:

Type Description
ValueError

If uuid_str is not a valid UUID.

Example
1
2
3
4
import brahe as bh

sat = bh.SP3.from_file("test_assets/sp3/COD0OPSFIN_20243150000_01D_05M_ORB_subset.SP3").satellite("G05")
sat = sat.with_uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8")

SP3Header

SP3Header

SP3Header(*, agency: str | None = None, time_system: SP3TimeSystem | str | None = None, coordinate_system: str | None = None, orbit_type: SP3OrbitType | str | None = None, data_used: str | None = None, has_velocity: bool | None = None, comments: list[str] | None = None, position_base: float | None = None, clock_base: float | None = None)

Header of an SP3 file.

Mirrors the header fields of the file. SP3.header returns a copy; modify the copy and assign it back with sp3.header = header. The start epoch, epoch count, GPS week, seconds of week, MJD, and fractional day of the header lines follow from the epochs of the file and are properties of SP3.

An argument left as None keeps the default: SP3-d with velocity records, data used ORBIT, coordinate system IGS20, orbit type EXT, agency BRHE, GPS time, a 900 s epoch interval, no standard deviation bases, and no comments.

Parameters:

Name Type Description Default
agency str | None

Producing agency; at most 4 characters to be written.

None
time_system SP3TimeSystem | str | None

Time system of the epochs.

None
coordinate_system str | None

Coordinate system label; at most 5 characters to be written.

None
orbit_type SP3OrbitType | str | None

Orbit type; at most 3 characters to be written.

None
data_used str | None

Data used descriptor; at most 5 characters to be written.

None
has_velocity bool | None

Whether the file carries velocity records.

None
comments list[str] | None

Comment lines, at most 77 characters each to be written.

None
position_base float | None

Base of the position standard deviation exponents, millimeters.

None
clock_base float | None

Base of the clock standard deviation exponents, picoseconds.

None
Example
1
2
3
4
5
6
7
8
import brahe as bh

header = bh.SP3Header(agency="ESA", orbit_type=bh.SP3OrbitType.FIT)
assert header.version == bh.SP3Version.D
assert header.coordinate_system == "IGS20"

sp3 = bh.SP3(["G01"], 900.0, header)
assert sp3.header.agency == "ESA"

Initialize instance.

accuracies property

accuracies: list[float | None]

Accuracy of each satellite in header order.

Returns:

Type Description
list[float | None]

list[float | None]: Accuracies in meters; None for an unknown accuracy.

agency property

agency: str

Producing agency; at most 4 characters to be written.

Returns:

Name Type Description
str str

Agency label.

clock_base property

clock_base: float | None

Base of the clock and clock rate standard deviation exponents.

Returns:

Type Description
float | None

float | None: Base in ps (or 1e-4 ps/s); None if the file declares none.

comments property

comments: list[str]

Comment lines.

Returns:

Type Description
list[str]

list[str]: Comments in file order.

coordinate_system property

coordinate_system: str

Coordinate system label; at most 5 characters to be written.

Returns:

Name Type Description
str str

Label, for example IGS20.

data_used property

data_used: str

Data used descriptor; at most 5 characters to be written.

Returns:

Name Type Description
str str

Descriptor, for example ORBIT.

epoch_interval property

epoch_interval: float

Spacing of the epoch grid.

Returns:

Name Type Description
float float

Epoch interval, seconds.

file_type property

file_type: SP3FileType

Satellite system covered by the file. Assignment accepts an SP3FileType or its code letter.

Returns:

Name Type Description
SP3FileType SP3FileType

The file type.

has_velocity property

has_velocity: bool

Whether the file carries velocity records.

Returns:

Name Type Description
bool bool

True if velocity records are present.

orbit_type property

orbit_type: SP3OrbitType

Orbit type; at most 3 characters to be written.

Returns:

Name Type Description
SP3OrbitType SP3OrbitType

The orbit type.

position_base property

position_base: float | None

Base of the position and velocity standard deviation exponents.

Returns:

Type Description
float | None

float | None: Base in mm (or 1e-4 mm/s); None if the file declares none.

time_system property

time_system: SP3TimeSystem

Time system of the epochs.

Returns:

Name Type Description
SP3TimeSystem SP3TimeSystem

The time system.

version property

version: SP3Version

SP3 format version. Assignment accepts an SP3Version or its letter.

Returns:

Name Type Description
SP3Version SP3Version

The version.

SP3Record

SP3Record

SP3Record(position: ndarray, *, clock: float | None = None, velocity: ndarray | None = None, clock_rate: float | None = None, position_std: Sequence[float | None] | None = None, clock_std: float | None = None, velocity_std: Sequence[float | None] | None = None, clock_rate_std: float | None = None, clock_event: bool = False, clock_predicted: bool = False, maneuver: bool = False, orbit_predicted: bool = False, position_correlation: SP3Correlation | None = None, velocity_correlation: SP3Correlation | None = None)

One satellite state at one epoch of an SP3 file.

All quantities are SI: meters, meters per second, seconds and seconds per second. Optional fields are None when the file leaves them blank or does not carry them. Properties return copies; to change a record held by an SP3, modify a copy and pass it to SP3.set_record.

Parameters:

Name Type Description Default
position ndarray

Position in the file's coordinate system, meters, shape (3,).

required
clock float | None

Clock offset, seconds.

None
velocity ndarray | None

Velocity, meters per second, shape (3,).

None
clock_rate float | None

Clock rate of change, seconds per second.

None
position_std Sequence[float | None] | None

Standard deviations of the position, meters.

None
clock_std float | None

Standard deviation of the clock, seconds.

None
velocity_std Sequence[float | None] | None

Standard deviations of the velocity, meters per second.

None
clock_rate_std float | None

Standard deviation of the clock rate, seconds per second.

None
clock_event bool

Whether a clock discontinuity occurred; defaults to False.

False
clock_predicted bool

Whether the clock is predicted; defaults to False.

False
maneuver bool

Whether a maneuver occurred; defaults to False.

False
orbit_predicted bool

Whether the orbit is predicted; defaults to False.

False
position_correlation SP3Correlation | None

Position and clock correlation record.

None
velocity_correlation SP3Correlation | None

Velocity and clock rate correlation record.

None

Raises:

Type Description
ValueError

If a vector argument does not have three components.

Example
import brahe as bh
import numpy as np

record = bh.SP3Record(
    np.array([15.0e6, 20.0e6, 5.0e6]),
    velocity=np.array([1000.0, -2000.0, 500.0]),
    clock=2.5e-5,
)
assert record.clock == 2.5e-5
assert record.clock_rate is None

Initialize instance.

clock property

clock: float | None

Clock offset.

Returns:

Type Description
float | None

float | None: Clock offset, seconds; None if absent.

clock_event property

clock_event: bool

Clock event flag.

Returns:

Name Type Description
bool bool

True if a clock discontinuity occurred at this epoch.

clock_predicted property

clock_predicted: bool

Clock prediction flag.

Returns:

Name Type Description
bool bool

True if the clock value is predicted.

clock_rate property

clock_rate: float | None

Clock rate of change.

Returns:

Type Description
float | None

float | None: Clock rate, seconds per second; None if absent.

clock_rate_std property

clock_rate_std: float | None

Standard deviation of the clock rate.

Returns:

Type Description
float | None

float | None: Standard deviation, seconds per second; None where unknown.

clock_std property

clock_std: float | None

Standard deviation of the clock.

Returns:

Type Description
float | None

float | None: Standard deviation, seconds; None where unknown.

maneuver property

maneuver: bool

Maneuver flag.

Returns:

Name Type Description
bool bool

True if the satellite maneuvered since the previous epoch.

orbit_predicted property

orbit_predicted: bool

Orbit prediction flag.

Returns:

Name Type Description
bool bool

True if the orbit is predicted.

position property

position: ndarray

Position in the file's coordinate system.

Returns:

Type Description
ndarray

numpy.ndarray: Position, meters, shape (3,).

position_correlation property

position_correlation: SP3Correlation | None

Position and clock correlation record (EP).

Returns:

Type Description
SP3Correlation | None

SP3Correlation | None: A copy of the record; None if absent.

position_std property

position_std: tuple[float | None, float | None, float | None]

Standard deviations of the position.

Returns:

Type Description
tuple[float | None, float | None, float | None]

tuple[float | None, float | None, float | None]: Standard deviations, meters; None where unknown.

velocity property

velocity: ndarray | None

Velocity in the file's coordinate system.

Returns:

Type Description
ndarray | None

numpy.ndarray | None: Velocity, meters per second, shape (3,); None if absent.

velocity_correlation property

velocity_correlation: SP3Correlation | None

Velocity and clock rate correlation record (EV).

Returns:

Type Description
SP3Correlation | None

SP3Correlation | None: A copy of the record; None if absent.

velocity_std property

velocity_std: tuple[float | None, float | None, float | None]

Standard deviations of the velocity.

Returns:

Type Description
tuple[float | None, float | None, float | None]

tuple[float | None, float | None, float | None]: Standard deviations, meters per second; None where unknown.

SP3Correlation

SP3Correlation

SP3Correlation(std: Sequence[float | None] | None = None, clock_std: float | None = None, xy: float | None = None, xz: float | None = None, xc: float | None = None, yz: float | None = None, yc: float | None = None, zc: float | None = None)

Standard deviations and correlations of an SP3-c/d correlation record.

EP records carry position (m) and clock (s) values and EV records carry velocity (m/s) and clock rate (s/s) values. A correlation coefficient whose column is blank in the file is unknown and is None, distinct from an explicit 0. Properties return copies; assign the object back to its owner to change it.

Parameters:

Name Type Description Default
std Sequence[float | None] | None

Standard deviations of x, y, z; defaults to all unknown.

None
clock_std float | None

Standard deviation of the clock.

None
xy float | None

Correlation between x and y; defaults to None (unknown).

None
xz float | None

Correlation between x and z; defaults to None (unknown).

None
xc float | None

Correlation between x and the clock; defaults to None (unknown).

None
yz float | None

Correlation between y and z; defaults to None (unknown).

None
yc float | None

Correlation between y and the clock; defaults to None (unknown).

None
zc float | None

Correlation between z and the clock; defaults to None (unknown).

None
Example
1
2
3
4
5
6
import brahe as bh

corr = bh.SP3Correlation(std=(0.01, 0.01, 0.02), clock_std=1e-11, xy=0.1)
assert corr.std[2] == 0.02
assert corr.xy == 0.1
assert corr.yz is None

Initialize instance.

clock_std property

clock_std: float | None

Standard deviation of the clock.

Returns:

Type Description
float | None

float | None: Standard deviation in s (EP) or s/s (EV); None where unknown.

std property

std: tuple[float | None, float | None, float | None]

Standard deviations of x, y, z.

Returns:

Type Description
tuple[float | None, float | None, float | None]

tuple[float | None, float | None, float | None]: Standard deviations in m (EP) or m/s (EV); None where unknown.

xc property

xc: float | None

Correlation between x and the clock.

Returns:

Type Description
float | None

float | None: Correlation coefficient; None if unknown.

xy property

xy: float | None

Correlation between x and y.

Returns:

Type Description
float | None

float | None: Correlation coefficient; None if unknown.

xz property

xz: float | None

Correlation between x and z.

Returns:

Type Description
float | None

float | None: Correlation coefficient; None if unknown.

yc property

yc: float | None

Correlation between y and the clock.

Returns:

Type Description
float | None

float | None: Correlation coefficient; None if unknown.

yz property

yz: float | None

Correlation between y and z.

Returns:

Type Description
float | None

float | None: Correlation coefficient; None if unknown.

zc property

zc: float | None

Correlation between z and the clock.

Returns:

Type Description
float | None

float | None: Correlation coefficient; None if unknown.

SP3SatelliteId

SP3SatelliteId

SP3SatelliteId(system: GNSSSystem | str, number: int)

Identifier of a satellite in an SP3 file: a system and a number.

Identifiers print as the system code followed by a two-digit number (G05) and order by system, then number.

Parameters:

Name Type Description Default
system GNSSSystem | str

Satellite system, or its one-letter code or name.

required
number int

Satellite number within the system, 1 to 99 inclusive.

required

Raises:

Type Description
BraheError

If the system is unknown or the number is outside 1 to 99.

Example
1
2
3
4
5
6
7
8
import brahe as bh

sat = bh.SP3SatelliteId(bh.GNSSSystem.GPS, 5)
assert str(sat) == "G05"
assert bh.SP3SatelliteId.parse("G 5") == sat
assert bh.SP3SatelliteId("G", 5) == sat
assert sat == "G05"
assert hash(sat) == hash("G05")

An identifier also equals any string that parse reads as the same identifier. Its hash equals the hash of the canonical string str(sat) only, so a non-canonical spelling such as "G 5" compares equal but hashes differently.

Initialize instance.

number property

number: int

Satellite number within the system.

Returns:

Name Type Description
int int

Number from 1 to 99.

system property

system: GNSSSystem

Satellite system.

Returns:

Name Type Description
GNSSSystem GNSSSystem

The system.

parse staticmethod

parse(s: str) -> SP3SatelliteId

Parse an identifier as written in an SP3 file.

The identifier has three characters: a system letter (a space means GPS) and a two-digit number, which may be space padded.

Parameters:

Name Type Description Default
s str

Identifier such as G05, G 5 or 5.

required

Returns:

Name Type Description
SP3SatelliteId SP3SatelliteId

The identifier.

Raises:

Type Description
BraheError

If the text is not a valid identifier.

Example
1
2
3
import brahe as bh

assert bh.SP3SatelliteId.parse("R12").system == bh.GNSSSystem.GLONASS

SP3Version

SP3Version

SP3Version()

SP3 format version.

Versions a through d are described by the NGS SP3 documentation and the IGS format specifications.

Example
1
2
3
4
import brahe as bh

assert bh.SP3Version.from_char("D") == bh.SP3Version.D
assert str(bh.SP3Version.D) == "d"

Initialize instance.

A class-attribute

A: SP3Version = SP3Version.A

SP3 format version.

Versions a through d are described by the NGS SP3 documentation and the IGS format specifications.

Example
1
2
3
4
import brahe as bh

assert bh.SP3Version.from_char("D") == bh.SP3Version.D
assert str(bh.SP3Version.D) == "d"

B class-attribute

B: SP3Version = SP3Version.B

SP3 format version.

Versions a through d are described by the NGS SP3 documentation and the IGS format specifications.

Example
1
2
3
4
import brahe as bh

assert bh.SP3Version.from_char("D") == bh.SP3Version.D
assert str(bh.SP3Version.D) == "d"

C class-attribute

C: SP3Version = SP3Version.C

SP3 format version.

Versions a through d are described by the NGS SP3 documentation and the IGS format specifications.

Example
1
2
3
4
import brahe as bh

assert bh.SP3Version.from_char("D") == bh.SP3Version.D
assert str(bh.SP3Version.D) == "d"

D class-attribute

D: SP3Version = SP3Version.D

SP3 format version.

Versions a through d are described by the NGS SP3 documentation and the IGS format specifications.

Example
1
2
3
4
import brahe as bh

assert bh.SP3Version.from_char("D") == bh.SP3Version.D
assert str(bh.SP3Version.D) == "d"

as_char method descriptor

as_char() -> str

Lowercase version letter as written in the first header line.

Returns:

Name Type Description
str str

One of a, b, c, d.

Example
1
2
3
import brahe as bh

assert bh.SP3Version.B.as_char() == "b"

from_char staticmethod

from_char(c: str) -> SP3Version

Parse a version letter, ignoring case.

Parameters:

Name Type Description Default
c str

Version letter, one of a, b, c, d in either case.

required

Returns:

Name Type Description
SP3Version SP3Version

The version.

Raises:

Type Description
BraheError

If the letter is not a known version.

Example
1
2
3
import brahe as bh

assert bh.SP3Version.from_char("c") == bh.SP3Version.C

GNSSSystem

GNSSSystem

GNSSSystem()

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

Initialize instance.

BEIDOU class-attribute

BEIDOU: GNSSSystem = GNSSSystem.BEIDOU

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

GALILEO class-attribute

GALILEO: GNSSSystem = GNSSSystem.GALILEO

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

GLONASS class-attribute

GLONASS: GNSSSystem = GNSSSystem.GLONASS

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

GPS class-attribute

GPS: GNSSSystem = GNSSSystem.GPS

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

IRNSS class-attribute

IRNSS: GNSSSystem = GNSSSystem.IRNSS

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

LEO class-attribute

LEO: GNSSSystem = GNSSSystem.LEO

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

QZSS class-attribute

QZSS: GNSSSystem = GNSSSystem.QZSS

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

SBAS class-attribute

SBAS: GNSSSystem = GNSSSystem.SBAS

Satellite navigation system of an SP3 satellite identifier.

Each system has a one-letter code used as the first character of the satellite identifier (G05, R12, ...).

Example
1
2
3
4
5
import brahe as bh

assert bh.GNSSSystem.from_code("E") == bh.GNSSSystem.GALILEO
assert bh.GNSSSystem.BEIDOU.code == "C"
assert str(bh.GNSSSystem.GLONASS) == "GLONASS"

code property

code: str

One-letter system code used in satellite identifiers.

Returns:

Name Type Description
str str

The code letter.

from_code staticmethod

from_code(code: str) -> GNSSSystem

Parse a system code letter.

Parameters:

Name Type Description Default
code str

One of G, R, E, C, J, I, S, L.

required

Returns:

Name Type Description
GNSSSystem GNSSSystem

The system.

Raises:

Type Description
BraheError

If the code is not a known system letter.

Example
1
2
3
import brahe as bh

assert bh.GNSSSystem.from_code("R") == bh.GNSSSystem.GLONASS

SP3FileType

SP3FileType

SP3FileType()

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

Initialize instance.

BEIDOU class-attribute

BEIDOU: SP3FileType = SP3FileType.BEIDOU

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

GALILEO class-attribute

GALILEO: SP3FileType = SP3FileType.GALILEO

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

GLONASS class-attribute

GLONASS: SP3FileType = SP3FileType.GLONASS

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

GPS class-attribute

GPS: SP3FileType = SP3FileType.GPS

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

IRNSS class-attribute

IRNSS: SP3FileType = SP3FileType.IRNSS

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

LEO class-attribute

LEO: SP3FileType = SP3FileType.LEO

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

MIXED class-attribute

MIXED: SP3FileType = SP3FileType.MIXED

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

QZSS class-attribute

QZSS: SP3FileType = SP3FileType.QZSS

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

SBAS class-attribute

SBAS: SP3FileType = SP3FileType.SBAS

Satellite system covered by an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3FileType.from_code("M") == bh.SP3FileType.MIXED
assert bh.SP3FileType.GPS.code == "G"
assert str(bh.SP3FileType.MIXED) == "Mixed"

code property

code: str

One-letter file type code written in the header.

Returns:

Name Type Description
str str

The code letter.

from_code staticmethod

from_code(code: str) -> SP3FileType

Parse a file type code letter.

Parameters:

Name Type Description Default
code str

One of G, R, E, C, J, I, S, L, M.

required

Returns:

Name Type Description
SP3FileType SP3FileType

The file type.

Raises:

Type Description
BraheError

If the code is not a known file type letter.

Example
1
2
3
import brahe as bh

assert bh.SP3FileType.from_code("E") == bh.SP3FileType.GALILEO

SP3TimeSystem

SP3TimeSystem

SP3TimeSystem()

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

Initialize instance.

BDT class-attribute

BDT: SP3TimeSystem = SP3TimeSystem.BDT

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

GAL class-attribute

GAL: SP3TimeSystem = SP3TimeSystem.GAL

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

GLO class-attribute

GLO: SP3TimeSystem = SP3TimeSystem.GLO

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

GPS class-attribute

GPS: SP3TimeSystem = SP3TimeSystem.GPS

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

IRN class-attribute

IRN: SP3TimeSystem = SP3TimeSystem.IRN

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

QZS class-attribute

QZS: SP3TimeSystem = SP3TimeSystem.QZS

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

TAI class-attribute

TAI: SP3TimeSystem = SP3TimeSystem.TAI

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

UTC class-attribute

UTC: SP3TimeSystem = SP3TimeSystem.UTC

Time system of the epochs in an SP3 file.

Example
1
2
3
4
5
import brahe as bh

assert bh.SP3TimeSystem.parse("GAL") == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.GAL.to_time_system() == bh.TimeSystem.GST
assert bh.SP3TimeSystem.GLO.to_time_system() is None

from_time_system staticmethod

from_time_system(time_system: TimeSystem) -> SP3TimeSystem | None

Convert a Brahe time system to the SP3 label.

Parameters:

Name Type Description Default
time_system TimeSystem

Brahe time system.

required

Returns:

Type Description
SP3TimeSystem | None

SP3TimeSystem | None: The SP3 time system, or None if SP3 has no label for it.

Example
1
2
3
4
import brahe as bh

assert bh.SP3TimeSystem.from_time_system(bh.TimeSystem.GST) == bh.SP3TimeSystem.GAL
assert bh.SP3TimeSystem.from_time_system(bh.TimeSystem.TT) is None

parse staticmethod

parse(s: str) -> SP3TimeSystem

Parse a time system label.

Surrounding whitespace is ignored. The ccc placeholder that SP3-a and SP3-b files carry maps to GPS time.

Parameters:

Name Type Description Default
s str

Time system label, for example GPS or UTC.

required

Returns:

Name Type Description
SP3TimeSystem SP3TimeSystem

The time system.

Raises:

Type Description
BraheError

If the label is not a known time system.

Example
1
2
3
import brahe as bh

assert bh.SP3TimeSystem.parse(" UTC ") == bh.SP3TimeSystem.UTC

to_time_system method descriptor

to_time_system() -> TimeSystem | None

Brahe time system equivalent to this SP3 time system.

Returns:

Type Description
TimeSystem | None

TimeSystem | None: The Brahe time system, or None for GLO, QZS and IRN, which Brahe does not implement.

Example
1
2
3
import brahe as bh

assert bh.SP3TimeSystem.BDT.to_time_system() == bh.TimeSystem.BDT

SP3OrbitType

SP3OrbitType

SP3OrbitType()

Orbit type label of an SP3 file.

The four standard labels are class attributes. Any other label found in a file is preserved verbatim by parse.

Example
1
2
3
4
import brahe as bh

assert bh.SP3OrbitType.parse("FIT") == bh.SP3OrbitType.FIT
assert str(bh.SP3OrbitType.parse("BHN")) == "BHN"

Initialize instance.

BCT class-attribute

BCT: SP3OrbitType = SP3OrbitType.parse('BCT')

Orbit type label of an SP3 file.

The four standard labels are class attributes. Any other label found in a file is preserved verbatim by parse.

Example
1
2
3
4
import brahe as bh

assert bh.SP3OrbitType.parse("FIT") == bh.SP3OrbitType.FIT
assert str(bh.SP3OrbitType.parse("BHN")) == "BHN"

EXT class-attribute

EXT: SP3OrbitType = SP3OrbitType.parse('EXT')

Orbit type label of an SP3 file.

The four standard labels are class attributes. Any other label found in a file is preserved verbatim by parse.

Example
1
2
3
4
import brahe as bh

assert bh.SP3OrbitType.parse("FIT") == bh.SP3OrbitType.FIT
assert str(bh.SP3OrbitType.parse("BHN")) == "BHN"

FIT class-attribute

FIT: SP3OrbitType = SP3OrbitType.parse('FIT')

Orbit type label of an SP3 file.

The four standard labels are class attributes. Any other label found in a file is preserved verbatim by parse.

Example
1
2
3
4
import brahe as bh

assert bh.SP3OrbitType.parse("FIT") == bh.SP3OrbitType.FIT
assert str(bh.SP3OrbitType.parse("BHN")) == "BHN"

HLM class-attribute

HLM: SP3OrbitType = SP3OrbitType.parse('HLM')

Orbit type label of an SP3 file.

The four standard labels are class attributes. Any other label found in a file is preserved verbatim by parse.

Example
1
2
3
4
import brahe as bh

assert bh.SP3OrbitType.parse("FIT") == bh.SP3OrbitType.FIT
assert str(bh.SP3OrbitType.parse("BHN")) == "BHN"

parse staticmethod

parse(s: str) -> SP3OrbitType

Parse an orbit type label.

Surrounding whitespace is ignored. Labels other than the four standard ones are kept as written.

Parameters:

Name Type Description Default
s str

Orbit type label, for example FIT or EXT.

required

Returns:

Name Type Description
SP3OrbitType SP3OrbitType

The orbit type.

Example
1
2
3
4
import brahe as bh

assert bh.SP3OrbitType.parse(" EXT ") == bh.SP3OrbitType.EXT
assert bh.SP3OrbitType.parse("XYZ") != bh.SP3OrbitType.EXT

See Also