.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/interfaces.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_interfaces.py: Combining Interfaces ==================== This example demonstrates the power of `arguslib`'s interface system by stacking multiple interfaces together. We will create a complex visualization that includes: 1. A `CameraArray` to show multiple camera views simultaneously. 2. A `RadarInterface` to overlay radar data on top of the camera array. 3. An `AircraftInterface` to plot flight tracks over both the cameras and radar data. This showcases how different data sources can be combined into a single, comprehensive plot. .. GENERATED FROM PYTHON SOURCE LINES 18-25 .. code-block:: Python import datetime from arguslib.aircraft import AircraftInterface from arguslib.radar.radar import Radar from arguslib.camera.camera_array import CameraArray from arguslib.camera.undistorted_camera import UndistortedCamera from arguslib.radar.radar_interface import RadarInterface .. GENERATED FROM PYTHON SOURCE LINES 26-34 Stacking Interfaces for a Composite View ---------------------------------------- We can combine multiple cameras with flight tracks and radar data using nested interfaces. Here, we build up the final visualization step-by-step. First, we define the core instruments: a `Radar` and a `CameraArray` composed of `UndistortedCamera` instances to provide a wide, distortion-free field of view. .. GENERATED FROM PYTHON SOURCE LINES 34-42 .. code-block:: Python dt = datetime.datetime(2025, 5, 1, 7, 30, 23) radar = Radar.from_config("COBALT") multicam = CameraArray.from_config("COBALTArray", camera_class=UndistortedCamera) # # Next, we wrap the `CameraArray` with a `RadarInterface` to overlay the radar # data. cri = RadarInterface(radar, multicam) # .. GENERATED FROM PYTHON SOURCE LINES 43-50 Finally, we wrap the `RadarInterface` with an `AircraftInterface`. This allows us to load flight data and plot aircraft tracks on top of the combined radar-on-camera view. The `show()` method on the outermost interface renders the entire scene, showing the aircraft tracks and their intersection with the radar scan over the multi-camera background. .. GENERATED FROM PYTHON SOURCE LINES 50-58 .. code-block:: Python ai_on_ri_on_multicam = AircraftInterface(cri) ai_on_ri_on_multicam.load_flight_data(dt) ax = ai_on_ri_on_multicam.show( dt, tlen=45 * 60, color_icao=True, ) .. image-sg:: /auto_examples/images/sphx_glr_interfaces_001.png :alt: ncas-mobile-ka-band-radar-1 220.9 Deg. 2025-05-01T07:30:23Z Equivalent reflectivity factor :srcset: /auto_examples/images/sphx_glr_interfaces_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Loading ADS-B data from: /disk1/Data/ADS-B/COBALT/20250501_ADS-B Loading ADS-B data: 0acft [00:00, ?acft/s] Loading ADS-B data: 3404acft [00:00, 34034.11acft/s] Loading ADS-B data: 3814acft [00:00, 34031.55acft/s] Attempting to assign ERA5 wind data to fleet... Grouping flight data by time interval... Assigning ERA5 wind data to fleet positions... Processing 4D time chunks: 0%| | 0/8 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: interfaces.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: interfaces.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_