ssapy.plotUtils

Utility functions for plotting.

Functions

calculate_orbital_elements(r_, v_[, ...])

Calculate the Keplerian orbital elements from position and velocity vectors.

check_numpy_array(variable)

Checks if the input variable is a NumPy array, a list of NumPy arrays, or neither.

check_type(t)

Determines the type of the input and provides a description based on its structure.

draw_dashed_circle(ax, normal_vector, ...[, ...])

Draw a dashed circle on a 3D axis with a given normal vector.

draw_earth(time[, ngrid, R, rfactor])

param time:

If float (array), then should correspond to GPS seconds;

draw_moon(time[, ngrid, R, rfactor])

param time:

If float (array), then should correspond to GPS seconds;

find_file(filename[, ext])

Find a file in the current directory or the ssapy datadir.

find_smallest_bounding_cube(r[, pad])

Find the smallest bounding cube for a set of 3D coordinates, with optional padding.

format_date_axis(time_array, ax)

Format the x-axis of a plot with time-based labels depending on the span of the time array.

gcrf_to_itrf(r_gcrf, t[, v])

Converts a position vector in the GCRF (Geocentric Celestial Reference Frame) to the ITRF (International Terrestrial Reference Frame) in Cartesian coordinates.

gcrf_to_lunar(r, t[, v])

Transform position and velocity vectors from the GCRF (Geocentric Celestial Reference Frame) to a lunar-centric frame.

gcrf_to_lunar_fixed(r, t[, v])

Transform position and velocity vectors from the GCRF (Geocentric Celestial Reference Frame) to a Moon-fixed (lunar-centric) frame.

get_body(name[, model])

Get a Body object for a named body.

globe_plot(r, t[, limits, title, figsize, ...])

Plot a 3D scatter plot of position vectors on a globe representation.

groundTrack(orbit, time[, propagator, format])

Calculate satellite ground track on the outer product of all supplied times and state vectors or orbits.

groundTrackVideo(r, time)

param r:

Position of orbiting object in meters.

ground_track_plot(r, t[, ground_stations, ...])

param r:

koe_hist_2d(stable_data[, title, limits, ...])

Create a 2D histogram plot for various Keplerian orbital elements of stable cislunar orbits.

koe_plot(r, v[, t, elements, save_path, body])

Plot Keplerian orbital elements over time for a given trajectory.

lagrange_points_lunar_frame()

Calculate the positions of the lunar Lagrange points in the lunar frame, This frame is defined by the coordinate transformation in utils.py gcrf_to_lunar().

load_earth_file()

Loads and resizes an image of the Earth.

load_moon_file()

Loads and resizes an image of the Moon.

orbit_divergence_plot(rs[, r_moon, t, ...])

Plot multiple cislunar orbits in the GCRF frame with respect to the Earth and Moon.

orbit_plot(r[, t, title, figsize, ...])

Plots the trajectory of one or more orbits in various views and coordinate frames.

save_animated_gif(gif_name, frames[, fps])

Create a GIF from a sequence of image frames.

save_plot(figure, save_path[, dpi])

Save a Python figure as a PNG/JPG/PDF/ect.

save_plot_to_pdf(figure, pdf_path)

Save a Matplotlib figure to a PDF file, with support for merging with existing PDFs.

scatter_2d(x, y, cs[, xlabel, ylabel, ...])

Create a 2D scatter plot with optional color mapping.

scatter_3d(x[, y, z, cs, xlabel, ylabel, ...])

Create a 3D scatter plot with optional color mapping.

scatter_dot_colors_scaled(num_colors)

Generates a scaled array of colors using the rainbow colormap.

set_color_theme(fig, *axes, theme)

Set the color theme of the figure and axes to white or black and the text color to white or black.