A Gabbard diagram plots orbital period versus apogee and perigee altitude, providing a unique visualization for analyzing debris clouds, satellite breakups, and orbital constellations. Each object appears as two points: one for apogee altitude and one for perigee altitude, both at the same orbital period. This creates a characteristic pattern that reveals the distribution and evolution of orbital populations.
"""Gabbard Diagram Example - Plotly BackendThis script demonstrates how to create an interactive Gabbard diagram using the plotly backend.A Gabbard diagram plots orbital period vs apogee/perigee altitude, useful for analyzingdebris clouds or satellite constellations."""importosimportpathlibimportsysimportbraheasbh# Add plots directory to path for importing brahe_themesys.path.insert(0,str(pathlib.Path(__file__).parent.parent.parent))frombrahe_themeimportsave_themed_html# ConfigurationSCRIPT_NAME=pathlib.Path(__file__).stemOUTDIR=pathlib.Path(os.getenv("BRAHE_FIGURE_OUTPUT_DIR","./docs/figures/"))os.makedirs(OUTDIR,exist_ok=True)# Initialize EOP databh.initialize_eop()# Get Ephmeris and debris for major events:cosmos_1408_debris=bh.celestrak.get_tles_as_propagators("cosmos-1408-debris",60.0)fengyun_debris=bh.celestrak.get_tles_as_propagators("fengyun-1c-debris",60.0)iridium_debris=bh.celestrak.get_tles_as_propagators("iridium-33-debris",60.0)cosmos_2251_debris=bh.celestrak.get_tles_as_propagators("cosmos-2251-debris",60.0)all_debris=cosmos_1408_debris+fengyun_debris+iridium_debris+cosmos_2251_debrisprint(f"Cosmos 1408 debris objects: {len(cosmos_1408_debris)}")print(f"Fengyun-1C debris objects: {len(fengyun_debris)}")print(f"Iridium 33 debris objects: {len(iridium_debris)}")print(f"Cosmos 2251 debris objects: {len(cosmos_2251_debris)}")print(f"Total debris objects loaded: {len(all_debris)}")# Get epoch of first debris objectepoch=all_debris[0].epoch# Get ISS ephemeris for reference altitude lineiss=bh.celestrak.get_tle_by_id_as_propagator(25544,60.0,"active")iss_state=iss.state_eci(epoch)iss_oe=bh.state_eci_to_koe(iss_state,bh.AngleFormat.RADIANS)iss_altitude_km=(iss_oe[0]-bh.R_EARTH)/1e3# Convert to kmprint(f"ISS altitude at epoch: {iss_altitude_km:.1f} km")# Create Gabbard diagramfig=bh.plot_gabbard_diagram(all_debris,epoch,backend="plotly")# Add ISS altitude reference linefig.add_hline(y=iss_altitude_km,line_dash="dash",line_color="orange",line_width=2,annotation_text=f"ISS Altitude ({iss_altitude_km:.1f} km)",annotation_position="right",)# Save themed HTML fileslight_path,dark_path=save_themed_html(fig,OUTDIR/SCRIPT_NAME)print(f"✓ Generated {light_path}")print(f"✓ Generated {dark_path}")
"""Gabbard Diagram Example - Matplotlib BackendThis script demonstrates how to create a Gabbard diagram using the matplotlib backend.A Gabbard diagram plots orbital period vs apogee/perigee altitude, useful for analyzingdebris clouds or satellite constellations."""importosimportpathlibimportbraheasbhimportmatplotlib.pyplotasplt# ConfigurationSCRIPT_NAME=pathlib.Path(__file__).stemOUTDIR=pathlib.Path(os.getenv("BRAHE_FIGURE_OUTPUT_DIR","./docs/figures/"))os.makedirs(OUTDIR,exist_ok=True)# Initialize EOP databh.initialize_eop()# Get Ephmeris and debris for major events:cosmos_1408_debris=bh.celestrak.get_tles_as_propagators("cosmos-1408-debris",60.0)fengyun_debris=bh.celestrak.get_tles_as_propagators("fengyun-1c-debris",60.0)iridium_debris=bh.celestrak.get_tles_as_propagators("iridium-33-debris",60.0)cosmos_2251_debris=bh.celestrak.get_tles_as_propagators("cosmos-2251-debris",60.0)all_debris=cosmos_1408_debris+fengyun_debris+iridium_debris+cosmos_2251_debrisprint(f"Cosmos 1408 debris objects: {len(cosmos_1408_debris)}")print(f"Fengyun-1C debris objects: {len(fengyun_debris)}")print(f"Iridium 33 debris objects: {len(iridium_debris)}")print(f"Cosmos 2251 debris objects: {len(cosmos_2251_debris)}")print(f"Total debris objects loaded: {len(all_debris)}")# Get epoch of first debris objectepoch=all_debris[0].epoch# Get ISS ephemeris for reference altitude lineiss=bh.celestrak.get_tle_by_id_as_propagator(25544,60.0,"active")iss_state=iss.state_eci(epoch)iss_oe=bh.state_eci_to_koe(iss_state,bh.AngleFormat.RADIANS)iss_altitude_km=(iss_oe[0]-bh.R_EARTH)/1e3# Convert to kmprint(f"ISS altitude at epoch: {iss_altitude_km:.1f} km")# Create Gabbard diagram in light modefig=bh.plot_gabbard_diagram(all_debris,epoch,backend="matplotlib")# Add ISS altitude reference lineax=fig.get_axes()[0]ax.axhline(y=iss_altitude_km,color="green",linestyle="--",linewidth=2,label=f"ISS Altitude ({iss_altitude_km:.1f} km)",)ax.legend()# Save light mode figurelight_path=OUTDIR/f"{SCRIPT_NAME}_light.svg"fig.savefig(light_path,dpi=300,bbox_inches="tight")print(f"✓ Generated {light_path}")plt.close(fig)# Create Gabbard diagram in dark modewithplt.style.context("dark_background"):fig=bh.plot_gabbard_diagram(all_debris,epoch,backend="matplotlib")# Set background color to match Plotly dark themefig.patch.set_facecolor("#1c1e24")foraxinfig.get_axes():ax.set_facecolor("#1c1e24")# Add ISS altitude reference lineax=fig.get_axes()[0]ax.axhline(y=iss_altitude_km,color="orange",linestyle="--",linewidth=2,label=f"ISS Altitude ({iss_altitude_km:.1f} km)",)ax.legend()# Save dark mode figuredark_path=OUTDIR/f"{SCRIPT_NAME}_dark.svg"fig.savefig(dark_path,dpi=300,bbox_inches="tight")print(f"✓ Generated {dark_path}")plt.close(fig)