boinor.plotting.aitoff¶
Aitoff projection sky map plotting in J2000 equatorial coordinates.
Classes¶
All-sky map plotter using Aitoff projection in J2000 equatorial coordinates. |
Module Contents¶
- class boinor.plotting.aitoff.AitoffPlotter(epoch=None, ax=None, figsize=(12, 8), style='dark_background', show_ecliptic=True, ecliptic_obliquity=23.439281)¶
All-sky map plotter using Aitoff projection in J2000 equatorial coordinates.
This class provides functionality to plot celestial bodies and spacecraft positions on an all-sky Aitoff projection. It operates in J2000 equatorial coordinates (right ascension and declination) without Earth-orientation or horizon effects, making it suitable for inertial sky visualization.
- Parameters:
epoch (Time, optional) – Epoch for the sky map. Defaults to current time.
ax (Axes, optional) – Matplotlib axes to use. If None, creates a new figure with Aitoff projection.
figsize (tuple, optional) – Figure size in inches. Defaults to (12, 8).
style (str, optional) – Matplotlib style to use. Defaults to ‘dark_background’ for night sky appearance.
show_ecliptic (bool, optional) – Whether to plot the ecliptic reference line. Defaults to True.
ecliptic_obliquity (float, optional) – Mean obliquity of the ecliptic in degrees (J2000). Defaults to 23.439281.
Examples
>>> from boinor.plotting.aitoff import AitoffPlotter >>> from astropy.time import Time >>> plotter = AitoffPlotter(epoch=Time.now()) >>> plotter.plot_ra_dec(ra=0*u.deg, dec=0*u.deg, label="Test") >>> plotter.show()
Notes
The Aitoff projection is a modified azimuthal map projection that displays the entire celestial sphere. Longitude values are converted to matplotlib’s expected format ([-π, π]) and inverted to match standard sky map conventions where 0° longitude is on the left.
References
Aitoff projection: https://en.wikipedia.org/wiki/Aitoff_projection
J2000 coordinate system: https://en.wikipedia.org/wiki/Epoch_(astronomy)#J2000.0
Overview of Reference Frames and Coordinate Systems in SPICE: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/17_frames_and_coordinate_systems.pdf
- epoch¶
- show_ecliptic = True¶
- ecliptic_obliquity¶
- plot_ra_dec(ra, dec, label=None, color=None, marker='o', markersize=12, **kwargs)¶
Plot a point on the sky map using right ascension and declination.
- Parameters:
ra (Quantity or float) – Right ascension. If float, assumed to be in radians.
dec (Quantity or float) – Declination. If float, assumed to be in radians.
label (str, optional) – Label for the plotted point.
color (str, optional) – Color for the marker. If None, uses matplotlib default.
marker (str, optional) – Marker style. Defaults to ‘o’.
markersize (float, optional) – Size of the marker. Defaults to 12.
**kwargs – Additional keyword arguments passed to matplotlib’s plot function.
- Returns:
The plotted line/marker object.
- Return type:
- plot_spice_position(target, observer='EARTH', frame='J2000', abcorr='LT+S', label=None, color=None, marker='o', markersize=12, **kwargs)¶
Plot a body position using SPICE ephemeris.
- Parameters:
observer (str or int, optional) – SPICE observer name or NAIF ID code. Defaults to “EARTH”.
frame (str, optional) – Reference frame. Defaults to “J2000”.
abcorr (str, optional) – Aberration correction. Defaults to “LT+S” (light time + stellar aberration).
label (str, optional) – Label for the plotted point.
color (str, optional) – Color for the marker. If None, uses matplotlib default.
marker (str, optional) – Marker style. Defaults to ‘o’.
markersize (float, optional) – Size of the marker. Defaults to 12.
**kwargs – Additional keyword arguments passed to matplotlib’s plot function.
- Returns:
The plotted line/marker object.
- Return type:
- Raises:
ImportError – If spiceypy is not installed.
Notes
This method requires SPICE kernels to be loaded beforehand using
spiceypy.furnsh(). The position is computed in the specified frame and converted to J2000 equatorial coordinates (RA/Dec).
- set_title(title=None)¶
Set the plot title.
- Parameters:
title (str, optional) – Title text. If None, uses the epoch in UTC format.
- set_labels()¶
Set standard axis labels for the sky map.
- set_ticks()¶
Set standard tick labels for right ascension in hours.
- show()¶
Display the plot with legend and grid.