datasetOrbit Class
Ability to plot orbits from Datasets. Like CSV files.
Class Initialization
plot_title
(str): The title of the plot.name
(str): The name of the celestial object or dataset.fps
(int, optional): Frames per second for animation (default is 30).
Plot Styling
background_color
(str): The background color of the plot (e.g., "dark_background" or "#F3EEEA").
This method is used to customize the appearance of the plot, including background color, axis colors, grid color, text and label colors, and more.
Data Loading and Plotting
plot_steps
(int): The number of data points to plot for each orbit.n_orbits
(int): The number of orbits to display.data
(str, optional): The path to a CSV file containing orbital data (default is None).color
(str, optional): The color of the celestial object's orbit (default is None).trajectory
(bool, optional): Whether to plot the trajectory of the object (default is False).sun
(bool, optional): Whether to display the Sun at the origin (default is True).random_color
(bool, optional): Generate random colors for objects if not specified (default is False).delimiter
(str, optional): Delimiter used in the CSV file (default is ",").
This method loads orbital data from a CSV file and plots the orbits of celestial objects. You can specify various parameters such as color, trajectory, and whether to include the Sun.
Animation
dpi
(int): Dots per inch for the exported animation.save
(bool, optional): Whether to save the animation (default is False).export_zoom
(float, optional): Zoom factor for the animation (default is None).font_size
(str, optional): Font size for the legend (default is "xx-small").export_folder
(str, optional): Folder to save the animation ifsave
is True (default is None).x_lim
(list, optional): Limits for the X-axis (default is None).y_lim
(list, optional): Limits for the Y-axis (default is None).z_lim
(list, optional): Limits for the Z-axis (default is None).x_label
(str, optional): Label for the X-axis (default is "X-Axis").y_label
(str, optional): Label for the Y-axis (default is "Y-Axis").z_label
(str, optional): Label for the Z-axis (default is "Z-Axis").animation_interval
(int, optional): Interval between animation frames (default is 40).
This method generates and displays an animated 3D plot of the celestial object's orbit. You can customize the animation settings, labels, and limits. If save
is True, it also saves the animation as a GIF.
Limiting the Plot
x_lim
(list): List of two values specifying X-axis limits.y_lim
(list): List of two values specifying Y-axis limits.z_lim
(list): List of two values specifying Z-axis limits.
These methods allow you to set limits for the X, Y, and Z axes of the plot.
Labeling the Plot
x_label
(str): Label for the X-axis.y_label
(str): Label for the Y-axis.z_label
(str): Label for the Z-axis.
These methods allow you to set labels for the X, Y, and Z axes of the plot.
Setting Columns in the Dataset
column_semi_major_axis
(str): The column name for semi-major axis data.column_perihelion
(str): The column name for perihelion data.column_eccentricity
(str): The column name for eccentricity data.column_inclination
(str): The column name for inclination data.column_longitude_of_ascending_node
(str): The column name for longitude of ascending node data.column_argument_of_perihelion
(str): The column name for argument of perihelion data.column_color
(str): The column name for object color data.column_name
(str): The column name for object name data.
These methods allow you to specify the names of columns in the CSV file that contain relevant orbital data.
Setting the Filename
file_name
(str): The path to the CSV file containing orbital data.
Use this method to specify the filename of the dataset to be loaded.
Styling Parameters
face_color
(str): Background color of the 3D plot.pane_color
(str): Color of the axes planes.grid_color
(str): Color of grid lines.orbit_transparency
(float): Transparency of orbit lines (0.0 to 1.0).label_color
(str): Color of axis labels.tick_color
(str): Color of axis ticks.
These methods allow you to customize various styling parameters for the plot.
Setting the Number of Rows Allowed
num_rows_allowed
(int or list): The number of rows allowed to be loaded from the dataset. It can be an integer or a list of two integers to specify a range of rows.
Use this method to limit the number of rows loaded from the dataset.
Setting the Sun and Planet Size
sun_size
(int): Size of the Sun marker in the plot.planet_size
(int): Size of the celestial object markers in the plot.
These methods allow you to set the size of the Sun and celestial objects in the plot.
Inclination Plot
color
(str): Color of the inclination plot.
Use this method to enable plotting of inclination and specify the color for the inclination plot.
Example Usage
This example demonstrates how to use the datasetOrbit
class to create and customize 3D orbital plots for celestial objects. You can customize various aspects of the plot, load data from a CSV file, and create an animated orbit plot with specific styling and parameters.
Last updated