.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "report/phase_space/plot_detection_maps.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_report_phase_space_plot_detection_maps.py: Detection Maps ============== How detectable is a transient of a given peak luminosity and decline time, in the FUV and in the NUV? A transient is **detected** if at least two observations reach :math:`5\sigma` in the band of the map, with an event that is only seen on the first visit to its field not counted. The pages around this one explain how a map is made and how to read it. Here are the maps of the latest release, one for each band, with the shipped transient classes shaded on them. The data is read through :func:`~uvex_transients.utils.results.get_phase_space_map`. Redrawing a map needs no simulation: the figure is made from the fitted map and the simulated points. .. GENERATED FROM PYTHON SOURCE LINES 15-26 .. code-block:: Python import matplotlib.pyplot as plt from astropy.table import Table from uvex_transients.phase_space.analysis.overlay import split_measurements from uvex_transients.phase_space.plotting import plot_map from uvex_transients.utils import get_phase_space_map from uvex_transients.utils.plotting import set_plot_style set_plot_style() .. GENERATED FROM PYTHON SOURCE LINES 27-32 Load the maps -------------- Each map is one band: ``map.ecsv`` is the fitted map on a grid, ``points.ecsv`` the simulated points it was fitted to and ``overlay.ecsv`` the measured transient classes. .. GENERATED FROM PYTHON SOURCE LINES 32-47 .. code-block:: Python MAPS = {"FUV": "fuv_detection", "NUV": "nuv_detection"} try: maps = {} for band, map_id in MAPS.items(): paths = get_phase_space_map(map_id, ["map", "points", "overlay"]) maps[band] = {key: Table.read(path, format="ascii.ecsv") for key, path in paths.items()} except (ConnectionError, LookupError, OSError, ValueError) as err: maps = None print(f"Skipping this page's analysis, the release data is not available: {err}") else: for band, tables in maps.items(): print(f"{band}: {len(tables['points'])} simulated points, {int(tables['points']['n'].sum()):,} events.") .. rst-class:: sphx-glr-script-out .. code-block:: none Extracting map.ecsv: 0%| | 0.00/1.08M [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_detection_maps.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_detection_maps.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_