contrailopt.Track

class contrailopt.Track(*, lon: NDArray[floating], lat: NDArray[floating], node_time: NDArray[datetime64])[source]

An ordered sequence of timed waypoints along a flown path.

The flight-profile optimizer (contrailopt.optimize.solve_track()) follows a fixed lateral path, so it needs only the ordered nodes, their times, and along-track distances.

This interface supplies lon, lat, node_time, cum_dist, segment_dist, n_nodes, h_origin, h_dest computed straight from the coordinates, so it can often be used in place of HorizontalDAG.

__init__(*, lon: NDArray[floating], lat: NDArray[floating], node_time: NDArray[datetime64]) → None

Methods

__init__(*, lon, lat, node_time)

plot([ax, linewidth])

Plot the track on a cartopy map.

Attributes

lon

lat

node_time

crosses_antimeridian

Whether the origin-to-destination span wraps the antimeridian.

cum_dist

Cumulative along-track distance at each waypoint (n,), starting at zero.

h_dest

Index of the destination node (always the last waypoint).

h_origin

Index of the origin node (always the first waypoint).

n_nodes

The number of waypoints.

segment_dist

Great-circle distance between consecutive waypoints (n - 1,).

property n_nodes: int

The number of waypoints.

property h_origin: int

Index of the origin node (always the first waypoint).

property h_dest: int

Index of the destination node (always the last waypoint).

property segment_dist: NDArray[floating]

Great-circle distance between consecutive waypoints (n - 1,).

property cum_dist: NDArray[floating]

Cumulative along-track distance at each waypoint (n,), starting at zero.

property crosses_antimeridian: bool

Whether the origin-to-destination span wraps the antimeridian.

plot(ax: GeoAxes | None = None, linewidth: float = 2.0) → GeoAxes[source]

Plot the track on a cartopy map.