Skip to content

Shared Types

Types and functions shared by both the CelesTrak and Space-Track ephemeris clients.

GPRecord

GPRecord

GPRecord()

General Perturbations (OMM) record from the GP request class.

Contains orbital elements and metadata for a single satellite. All fields are optional strings since Space-Track may omit fields.

Attributes:

Name Type Description
ccsds_omm_vers str | None

CCSDS OMM version

comment str | None

Comment field

creation_date str | None

Record creation date

originator str | None

Data originator

object_name str | None

Satellite common name

object_id str | None

International designator

center_name str | None

Center name

ref_frame str | None

Reference frame

time_system str | None

Time system

mean_element_theory str | None

Mean element theory

epoch str | None

Epoch of orbital elements

mean_motion float | None

Mean motion (rev/day)

eccentricity float | None

Eccentricity

inclination float | None

Inclination (degrees)

ra_of_asc_node float | None

RAAN (degrees)

arg_of_pericenter float | None

Argument of pericenter (degrees)

mean_anomaly float | None

Mean anomaly (degrees)

ephemeris_type int | None

Ephemeris type

classification_type str | None

Classification type

norad_cat_id int | None

NORAD catalog ID

element_set_no int | None

Element set number

rev_at_epoch int | None

Revolution number at epoch

bstar float | None

BSTAR drag coefficient

mean_motion_dot float | None

First derivative of mean motion

mean_motion_ddot float | None

Second derivative of mean motion

semimajor_axis float | None

Semi-major axis (km)

period float | None

Orbital period (minutes)

apoapsis float | None

Apoapsis altitude (km)

periapsis float | None

Periapsis altitude (km)

object_type str | None

Object type

rcs_size str | None

RCS size category

country_code str | None

Country code

launch_date str | None

Launch date

site str | None

Launch site

decay_date str | None

Decay date

file int | None

File number

gp_id int | None

GP record ID

tle_line0 str | None

TLE line 0

tle_line1 str | None

TLE line 1

tle_line2 str | None

TLE line 2

Example
1
2
3
4
5
6
import brahe as bh

client = bh.SpaceTrackClient("user@example.com", "password")
query = bh.SpaceTrackQuery(bh.RequestClass.GP).filter("NORAD_CAT_ID", "25544").limit(1)
records = client.query_gp(query)
print(records[0].object_name)  # "ISS (ZARYA)"

Initialize instance.

apoapsis property

apoapsis: Any

arg_of_pericenter property

arg_of_pericenter: Any

bstar property

bstar: Any

ccsds_omm_vers property

ccsds_omm_vers: Any

center_name property

center_name: Any

classification_type property

classification_type: Any

comment property

comment: Any

country_code property

country_code: Any

creation_date property

creation_date: Tuple[int, ...]

decay_date property

decay_date: Tuple[int, ...]

eccentricity property

eccentricity: Any

element_set_no property

element_set_no: Any

ephemeris_type property

ephemeris_type: Any

epoch property

epoch: Any

file property

file: Any

gp_id property

gp_id: Any

inclination property

inclination: Any

launch_date property

launch_date: Tuple[int, ...]

mean_anomaly property

mean_anomaly: Any

mean_element_theory property

mean_element_theory: Any

mean_motion property

mean_motion: Any

mean_motion_ddot property

mean_motion_ddot: Any

mean_motion_dot property

mean_motion_dot: Any

norad_cat_id property

norad_cat_id: Any

object_id property

object_id: Any

object_name property

object_name: Any

object_type property

object_type: Any

originator property

originator: Any

periapsis property

periapsis: Any

period property

period: Any

ra_of_asc_node property

ra_of_asc_node: Any

rcs_size property

rcs_size: Any

ref_frame property

ref_frame: Any

rev_at_epoch property

rev_at_epoch: Any

semimajor_axis property

semimajor_axis: ndarray

site property

site: Any

time_system property

time_system: Any

tle_line0 property

tle_line0: Any

tle_line1 property

tle_line1: Any

tle_line2 property

tle_line2: Any

from_json builtin

from_json(json_str: str) -> GPRecord

Construct a GPRecord from a JSON string.

Accepts both SpaceTrack format (all strings) and Celestrak format (native numbers). The JSON should represent a single GP record object.

Parameters:

Name Type Description Default
json_str str

JSON string representing a single GP record.

required

Returns:

Name Type Description
GPRecord GPRecord

Parsed GP record.

Raises:

Type Description
BraheError

If the JSON is malformed or cannot be parsed.

Example
1
2
3
4
5
import brahe as bh

json_str = '{"OBJECT_NAME": "ISS (ZARYA)", "NORAD_CAT_ID": "25544", "EPOCH": "2024-01-15T12:00:00.000"}'
record = bh.GPRecord.from_json(json_str)
print(record.object_name)  # "ISS (ZARYA)"

to_numerical_orbit_propagator method descriptor

to_numerical_orbit_propagator(force_config: ForceModelConfig, propagation_config: NumericalPropagationConfig | None = None, params: ndarray | None = None) -> NumericalOrbitPropagator

Create a NumericalOrbitPropagator from this GP record.

Internally creates an SGP4 propagator from the OMM elements, computes the ECI state at epoch, then initializes a numerical propagator with the specified force model.

Parameters:

Name Type Description Default
force_config ForceModelConfig

Force model configuration (required).

required
propagation_config NumericalPropagationConfig | None

Integrator config. Default: NumericalPropagationConfig default.

None
params ndarray | None

Parameter vector [mass, drag_area, Cd, srp_area, Cr, ...]. Required when force_config includes drag or SRP.

None

Returns:

Name Type Description
NumericalOrbitPropagator NumericalOrbitPropagator

Initialized numerical propagator at the record's epoch.

Raises:

Type Description
BraheError

If required orbital element fields are missing.

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

record = bh.GPRecord.from_json('{"OBJECT_NAME": "ISS", "NORAD_CAT_ID": 25544, ...}')
prop = record.to_numerical_orbit_propagator(
    force_config=bh.ForceModelConfig.two_body_gravity(),
)

to_sgp_propagator method descriptor

to_sgp_propagator(step_size: float = 60.0) -> SGPPropagator

Create an SGPPropagator from this GP record using OMM elements directly.

Preserves full OMM numeric precision without TLE text round-tripping.

Parameters:

Name Type Description Default
step_size float

Propagation step size in seconds. Default: 60.0

60.0

Returns:

Name Type Description
SGPPropagator SGPPropagator

Initialized SGP4 propagator at the record's epoch.

Raises:

Type Description
BraheError

If required orbital element fields are missing.

Example
1
2
3
4
5
import brahe as bh

record = bh.GPRecord.from_json('{"OBJECT_NAME": "ISS", "NORAD_CAT_ID": 25544, ...}')
prop = record.to_sgp_propagator()
state = prop.state_eci(prop.epoch)

Operator Functions

Filter operator functions for constructing query filter values. In Python, access these via brahe.spacetrack.operators:

from brahe.spacetrack import operators as op
op.greater_than("25544")  # ">25544"

Comparison Operators

spacetrack_greater_than builtin

spacetrack_greater_than(value: str) -> str

Greater-than operator for SpaceTrack queries.

Parameters:

Name Type Description Default
value str

The comparison value.

required

Returns:

Name Type Description
str str

Formatted operator string ">value".

Example
from brahe.spacetrack import operators as op
op.greater_than("25544")  # ">25544"

spacetrack_less_than builtin

spacetrack_less_than(value: str) -> str

Less-than operator for SpaceTrack queries.

Parameters:

Name Type Description Default
value str

The comparison value.

required

Returns:

Name Type Description
str str

Formatted operator string "<value".

spacetrack_not_equal builtin

spacetrack_not_equal(value: str) -> str

Not-equal operator for SpaceTrack queries.

Parameters:

Name Type Description Default
value str

The comparison value.

required

Returns:

Name Type Description
str str

Formatted operator string "<>value".

Range and Pattern Operators

spacetrack_inclusive_range builtin

spacetrack_inclusive_range(left: str, right: str) -> str

Inclusive range operator for SpaceTrack queries.

Parameters:

Name Type Description Default
left str

Lower bound (inclusive).

required
right str

Upper bound (inclusive).

required

Returns:

Name Type Description
str str

Formatted operator string "left--right".

Example
from brahe.spacetrack import operators as op
op.inclusive_range("25544", "25600")  # "25544--25600"

spacetrack_like builtin

spacetrack_like(value: str) -> str

Like/contains operator for SpaceTrack queries.

Parameters:

Name Type Description Default
value str

The pattern to match.

required

Returns:

Name Type Description
str str

Formatted operator string "~~value".

spacetrack_startswith builtin

spacetrack_startswith(value: str) -> str

Starts-with operator for SpaceTrack queries.

Parameters:

Name Type Description Default
value str

The prefix to match.

required

Returns:

Name Type Description
str str

Formatted operator string "^value".

Time References

spacetrack_now builtin

spacetrack_now() -> str

Current time reference for SpaceTrack queries.

Returns:

Name Type Description
str str

The string "now".

spacetrack_now_offset builtin

spacetrack_now_offset(days: int) -> str

Time offset from now for SpaceTrack queries.

Parameters:

Name Type Description Default
days int

Number of days offset (negative for past, positive for future).

required

Returns:

Name Type Description
str str

Formatted time reference "now-N" or "now+N".

Example
1
2
3
from brahe.spacetrack import operators as op
op.now_offset(-7)   # "now-7"
op.now_offset(14)   # "now+14"

Special Values

spacetrack_null_val builtin

spacetrack_null_val() -> str

Null value reference for SpaceTrack queries.

Returns:

Name Type Description
str str

The string "null-val".

spacetrack_or_list builtin

spacetrack_or_list(values: list[str]) -> str

OR list operator for SpaceTrack queries.

Parameters:

Name Type Description Default
values list[str]

List of values to match against.

required

Returns:

Name Type Description
str str

Comma-separated value string "val1,val2,val3".

Example
from brahe.spacetrack import operators as op
op.or_list(["25544", "25545"])  # "25544,25545"

See Also