Trajectories – ephemerista.coords.trajectories

The trajectories.py module.

This module provides the Trajectory class.

class ephemerista.coords.trajectories.Event(*, time, crossing)

The Event class.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ephemerista.coords.trajectories.Trajectory(trajectory=None, *, type='spacecraft', startTime, origin=Origin(name='Earth'), frame=ReferenceFrame(abbreviation='ICRF'), states, attitude=None, name=None)

Generic trajectory model.

property cartesian_states: list[Cartesian]

List of states in the trajectory.

property datetimes: list[datetime]

Return the time steps of the trajectory as a list of datetime.datetime objects.

find_events(func)

Find events along the trajectory.

This method will find all zero-crossings of the provided callback function.

Return type:

list[Event]

classmethod from_csv(path, scale='TAI', frame=ReferenceFrame(abbreviation='ICRF'), origin=Origin(name='Earth'), **kwargs)

Read a trajectory from a CSV file.

Return type:

Self

interpolate(time)

Interpolates the state of the trajectory at a given time.

Parameters:

time (Time) – Time at which to interpolate the state

Returns:

Interpolated state of the trajectory

Return type:

Cartesian

interpolate_batch(times)

Interpolates the state of the trajectory at multiple times.

Parameters:

times (list[Time]) – Times at which to interpolate the state

Returns:

List of interpolated states

Return type:

list[Cartesian]

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

plot_3d()

Plot a 3D representation of the trajectory.

Return type:

Scatter3d

property simulation_time: list[float]

Array of simulation time steps.

property times: list[Time]

List of times in the trajectory.

to_csv(path, **kwargs)

Write the trajectory to a CSV file.

to_frame(frame)

Rotate all states of the trajectory to a different reference frame.

Return type:

Trajectory

to_origin(origin)

Translate all states of the trajectory to a different coordinate origin.

Return type:

Trajectory