{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Plotting Data on a Map\n\nThis example demonstrates how to use the `MapInterface` to plot instrument\ndata, such as radar scans, on a geographical map.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import datetime\nfrom arguslib import MapInstrument, Radar, Position\nfrom arguslib.camera.camera_array import CameraArray\nfrom arguslib.misc.plotting import plot_range_rings\n\ndt = datetime.datetime(2025, 3, 25, 9, 0, 0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting a Radar Scan on a Map\n\nThe ``MapInstrument`` can be used to annotate ``Positions`` on a map. We can\nuse it to visualise the position of other instruments.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "mapper = MapInstrument.from_config(\"uk_wide\")\nax = mapper.show(dt) # Time is not used, but required for interface consistency\nmapper.annotate_positions(\n [Position(-0.17915, 51.49934, 0.0)],\n dt,\n ax,\n color=\"blue\",\n marker=\"x\",\n label=\"Imperial College London\",\n)\nmapper.annotate_positions(\n [Position(-2.80896, 54.05547, 0.0)],\n dt,\n ax,\n color=\"red\",\n marker=\"x\",\n label=\"Lancaster Castle\",\n)\n\nmulticam = CameraArray.from_config(\"COBALTArray\")\nplot_range_rings(\n mapper, multicam, None, ax=ax, ranges=[10], label=\"10 km from a COBALT camera\"\n)\nax.legend()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.5" } }, "nbformat": 4, "nbformat_minor": 0 }