astrix.plots package

class CartPlot(width=12.0, aspect=0.6)[source]

Bases: object

Parameters:
  • width (float)

  • aspect (float)

add_path(path, color='r', style='-', label=None, show_label=True)[source]

Add a path to the map. :type path: Path :param path: The path to add. :type path: Path :type color: str :param color: The color of the path. Defaults to “r”. :type color: str, optional :type style: str :param style: The style of the path. Defaults to “-“. :type style: str, optional

Parameters:
  • path (Path)

  • color (str)

  • style (str)

  • label (str | None)

  • show_label (bool)

add_point(point, color='r', marker='o', ms=6.0, label=None, ha='left', fw='normal', bgc='none')[source]
Parameters:
  • point (Point)

  • color (str)

  • marker (str)

  • ms (float)

  • label (str | None)

  • ha (str)

  • fw (str)

  • bgc (str)

add_rays(rays, length=200000.0, color='g')[source]
Parameters:
  • rays (Ray)

  • length (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])

  • color (str)

add_vectors(points1, points2, color='grey')[source]
Parameters:
legend(loc='upper right')[source]
Parameters:

loc (str)

save(filename, dpi=300)[source]
Parameters:
  • filename (str)

  • dpi (int)

show()[source]
class Plot3D(size=900, aspect_ratio=1.0, aa='ms')[source]

Bases: object

Parameters:
  • size (int)

  • aspect_ratio (float)

add_2d_text(name, text, pos=(50, 50), font_size=12, from_tl=True)[source]
Parameters:
  • name (str)

  • text (str)

  • pos (tuple[float, float])

  • font_size (int)

add_box(name, lat_bounds, lon_bounds, fill=True, fill_color=None, line_color=None, alpha=0.3, line_width=2.0, resolution=40, alt=50.0)[source]
Parameters:
  • name (str)

  • lat_bounds (Sequence[float])

  • lon_bounds (Sequence[float])

  • fill (bool)

  • fill_color (str | int | None)

  • line_color (str | int | None)

  • alpha (float)

  • line_width (float)

  • resolution (int)

  • alt (float)

add_circle(name, center, radius_km, fill=True, fill_color=None, line_color=None, alpha=0.3, line_width=2.0, resolution=120, alt=150.0)[source]
Parameters:
  • name (str)

  • center (tuple[float, float])

  • radius_km (float)

  • fill (bool)

  • fill_color (str | int | None)

  • line_color (str | int | None)

  • alpha (float)

  • line_width (float)

  • resolution (int)

  • alt (float)

add_grid(lat_bounds, lon_bounds, spacing=5.0)[source]
Parameters:
  • lat_bounds (Sequence[float])

  • lon_bounds (Sequence[float])

  • spacing (float)

add_ground_track(name, path, dt=10.0, line_width=1.0, color='white', alpha=0.6)[source]
Parameters:
  • name (str)

  • path (Path)

  • dt (float)

  • line_width (float)

  • color (str | int | None)

  • alpha (float)

add_labelled_point(name, text, position, font_size=14, text_color='lightgrey', marker_color='red', marker_size=6.0, show_points=True, bold=False, always_visible=True)[source]
Parameters:
  • name (str)

  • text (str)

  • position (Point)

  • font_size (int)

  • text_color (str | int)

  • marker_color (str | int)

  • marker_size (float)

  • show_points (bool)

  • bold (bool)

  • always_visible (bool)

add_legend(labels, pos_x=0.7)[source]

Add a legend to the plot

Parameters:
  • labels (list[tuple[str, str]]) – List of (data_name, label) tuples

  • font_size – Font size for the legend text

  • pos_x (float)

add_path(name, path, path_max=None, line_width=2.0, color=None, alpha=1.0)[source]
Parameters:
  • name (str)

  • path (Path)

  • path_max (Path | None)

  • line_width (float)

  • color (str | int | None)

  • alpha (float)

add_point(name, point, size=2.0, color=None, alpha=1.0)[source]
Parameters:
  • name (str)

  • point (Point)

  • size (float)

  • color (str | int | None)

  • alpha (float)

add_ray(name, ray, length=100000.0, color='grey', alpha=0.5, line_width=1.0)[source]
Parameters:
  • name (str)

  • ray (Ray)

  • length (float | ndarray[tuple[Any, ...], dtype[_ScalarT]])

  • color (str | int)

  • alpha (float)

  • line_width (float)

add_texture(lat_bounds, lon_bounds, alpha=0.6)[source]
Parameters:
  • lat_bounds (Sequence[float])

  • lon_bounds (Sequence[float])

autocomplete(bounds=None)[source]
Parameters:

bounds (tuple[tuple[float, float], tuple[float, float]] | None)

calc_bounds(buffer=0.3)[source]
Return type:

tuple[tuple[float, float], tuple[float, float]]

clear_ground_track(name)[source]
Parameters:

name (str)

clear_path(name)[source]
Parameters:

name (str)

clear_point(name)[source]
Parameters:

name (str)

close()[source]
frame()[source]
render()[source]
save(filepath='./plot3d_screenshot.png', scale=1.0)[source]
Parameters:
  • filepath (str)

  • scale (float)

set_view(cent, heading=180, pitch=-45, zoom=1.0, parrallel=False)[source]
Parameters:
  • cent (Point)

  • heading (float)

  • pitch (float)

  • zoom (float)

  • parrallel (bool)

show()[source]
start_animation(filepath='./animation.mp4', fps=30)[source]
Parameters:
  • filepath (str)

  • fps (int)

update_2d_text(name, text)[source]
Parameters:
  • name (str)

  • text (str)

update_ground_track(name, path)[source]
Parameters:
  • name (str)

  • path (Path)

update_labelled_point_pos(name, position)[source]
Parameters:
  • name (str)

  • position (Point)

update_path(name, path)[source]
Parameters:
  • name (str)

  • path (Path)

update_point(name, point)[source]
Parameters:
  • name (str)

  • point (Point)

update_ray(name, ray, length=100000.0)[source]
Parameters:
  • name (str)

  • ray (Ray | None)

  • length (float | ndarray[tuple[Any, ...], dtype[_ScalarT]])

aspect_ratio: float
data: dict[str, PlotData]
p: Plotter
text_actors: dict[str, Actor]

Submodules