.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "report/full_run/transient_characterization/plot_characterization.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_full_run_transient_characterization_plot_characterization.py: Standard Cuts and Yields ======================== How many of the detected events can be *characterized*: observed often enough, brightly enough and early enough to be classified? A detection alone is not much. This page applies a set of standard cuts to the detected events of every transient type, and reports what is left as the expected number of UVEX events. The cuts are relatively relaxed, since they pick events that UVEX will get UV coverage of and that can probably be classified, but probably not early. Every setting is at the top of the page, so the same page answers the question for a different selection. Everything is read from the event summary table of the latest release, through :class:`~uvex_transients.utils.summary_report.SummaryReport`. .. GENERATED FROM PYTHON SOURCE LINES 17-27 .. code-block:: Python from dataclasses import replace import matplotlib.pyplot as plt from uvex_transients.utils.plotting import set_plot_style from uvex_transients.utils.summary_report import POPULATION_GROUPS, STANDARD_POPULATIONS, SummaryReport set_plot_style() .. GENERATED FROM PYTHON SOURCE LINES 28-34 Configuration -------------- The three cuts are the same for every type, apart from the longest allowed gap between the last non-detection and the first detection, which is set per type. Change any of them and the funnels, yields and figures below follow. .. GENERATED FROM PYTHON SOURCE LINES 34-55 .. code-block:: Python #: An event needs at least this many detections. MIN_DETECTIONS = 2 #: The highest-SNR measurement of an event must be brighter than this AB magnitude. PEAK_MAG_LIMIT = 23.0 #: The longest gap, in days, from the last constraining non-detection to the first detection, per type. MAX_GAP = {key: spec.max_gap for key, spec in STANDARD_POPULATIONS.items()} # MAX_GAP["tde"] = 15.0 # for example, to pin the explosion of a TDE down twice as tightly POPULATIONS = {key: replace(spec, max_gap=MAX_GAP[key]) for key, spec in STANDARD_POPULATIONS.items()} try: report = SummaryReport.from_release(POPULATIONS, min_detections=MIN_DETECTIONS, peak_mag_limit=PEAK_MAG_LIMIT) except (ConnectionError, LookupError, OSError, ValueError) as err: report = None print(f"Skipping this page's analysis, the release data is not available: {err}") else: print(f"{len(report.summary):,} detected events in the release's summary table.") .. rst-class:: sphx-glr-script-out .. code-block:: none 12,291 detected events in the release's summary table. .. GENERATED FROM PYTHON SOURCE LINES 56-102 The cuts --------- The cuts are cumulative: - **Repeat detections**: at least ``MIN_DETECTIONS`` epochs with SNR above threshold, since a lone detection is hard to tell apart from noise or an artifact. - **Bright peak**: the highest-SNR measurement is brighter than ``PEAK_MAG_LIMIT``. - **Bracketed explosion**: the gap between the last *constraining* non-detection (one whose rise to the first detection is significant at 3 sigma, so a marginal non-detection does not count) and the first detection is below a limit per type, so that the explosion time is pinned down. An event with no constraining non-detection has no bracket and is dropped. The default gap is set at roughly the time each type takes to rise, so that its explosion is pinned down while it is still bright: .. list-table:: :header-rows: 1 :widths: 18 12 70 * - Type - Max gap (days) - Reasoning * - Type Ia - 14 - Type Ia SNe reach peak roughly two to three weeks after explosion. * - Type Ib, Ic, Ic-BL - 10 - Stripped-envelope SNe reach peak in about two weeks. The broad-lined Ic is taken to be the same. * - Type IIP, IIb - 7 - The UV is brightest in the first days to weeks, during shock breakout and cooling, and the shock-cooling peak of a IIb arrives within about a week. * - SLSN-I - 60 - SLSNe rise slowly, over roughly 30 to 100 days in the rest frame (longer in the observer frame). * - TDE - 30 - TDEs rise over a few weeks, so a month brackets the rise itself. * - LFBOT - 5 - LFBOTs rise in a few days and fade over a few weeks. * - Kilonova - 3 - The UV emission fades within days, so the explosion has to be pinned down to a few days for the event to still be bright when it is found. .. GENERATED FROM PYTHON SOURCE LINES 104-112 Cut funnels ------------ How many events of each type survive each cut, in **expected UVEX events**: the Monte Carlo events that reach a stage times :math:`\mu_0 / n`, with :math:`n` the number generated and :math:`\mu_0` the number that exist in UVEX's footprint and observing window. The first bar is therefore :math:`\mu_0`. Black error bars are the Monte Carlo uncertainty on each stage and the pale band is the rate uncertainty, which scales every stage by the same factor. One funnel per group of types, to keep the bars legible. .. GENERATED FROM PYTHON SOURCE LINES 112-125 .. code-block:: Python if report is not None: for name, keys in POPULATION_GROUPS.items(): group = SummaryReport( report.summary, {key: report.populations[key] for key in keys}, min_detections=MIN_DETECTIONS, peak_mag_limit=PEAK_MAG_LIMIT, ) group.plot_funnel().axes[0].set_title(f"Detection funnel: {name}") plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_001.png :alt: Detection funnel: Type I SNe :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_001.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_002.png :alt: Detection funnel: Type II SNe :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_002.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_003.png :alt: Detection funnel: SLSNe :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_003.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_004.png :alt: Detection funnel: Exotic transients :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_004.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 126-132 Characterized events per type ------------------------------ The expected number of events that pass every cut. This is the same figure as the :ref:`detected events `, now for the selected ones: the black error bars are the Monte Carlo uncertainty and the pale band is the rate uncertainty. .. GENERATED FROM PYTHON SOURCE LINES 132-138 .. code-block:: Python if report is not None: report.plot_yields() plt.show() .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_005.png :alt: plot characterization :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_005.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 139-140 The numbers behind the bars, with the fraction of the events generated that is selected: .. GENERATED FROM PYTHON SOURCE LINES 140-144 .. code-block:: Python if report is not None: report.yield_table().pprint_all() .. rst-class:: sphx-glr-script-out .. code-block:: none Population Intrinsic UVEX events Selected / generated Fraction (90% CI) Expected selected events ---------- --------------------- -------------------- ---------------------- ------------------------------------------------ Type Ia 170,407 15 / 8358 0.18% (0.11% to 0.28%) 306 (+165 / -117 MC, +23.5 / -23.5 rate) Type Ib 52,029 0 / 2678 0.00% (0.00% to 0.11%) < 58.2 (90% upper limit) Type Ic 23,786 1 / 1196 0.08% (0.00% to 0.40%) 19.9 (+74.3 / -18.9 MC, +10.1 / -10.6 rate) Type Ic-BL 14,851 0 / 730 0.00% (0.00% to 0.41%) < 60.8 (90% upper limit) Type IIP 22,169,966 59 / 221247 0.03% (0.02% to 0.03%) 5,912 (+1,431 / -1,206 MC, +1,749 / -1,981 rate) Type IIb 7,538,332 13 / 188496 0.01% (0.00% to 0.01%) 520 (+307 / -212 MC, +236 / -249 rate) SLSN-I 25,531 54 / 1270 4.25% (3.36% to 5.30%) 1,086 (+269 / -227 MC, +406 / -588 rate) TDE 49,400 305 / 49607 0.61% (0.56% to 0.68%) 304 (+30.1 / -28 MC, +58.8 / -98 rate) llGRB 13,952 5 / 14063 0.04% (0.01% to 0.07%) 4.96 (+5.47 / -3.01 MC, +10.6 / -4.1 rate) LFBOT 1,149 102 / 11618 0.88% (0.74% to 1.03%) 10.1 (+1.79 / -1.58 MC, +2.52 / -9.18 rate) Kilonova 54.3 0 / 588 0.00% (0.00% to 0.51%) < 0.276 (90% upper limit) .. GENERATED FROM PYTHON SOURCE LINES 145-151 How often is each event detected? ---------------------------------- The percentage of the characterized events that are detected at least :math:`N` times. The cut on repeat detections keeps every curve at 100% up to :math:`N =` ``MIN_DETECTIONS``, and the rest of the curve is how much more than that is available. .. GENERATED FROM PYTHON SOURCE LINES 151-157 .. code-block:: Python if report is not None: report.plot_detection_counts(POPULATION_GROUPS) plt.show() .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_006.png :alt: Type I SNe, Type II SNe, SLSNe, Exotic transients :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_006.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 158-165 Example light curves --------------------- One characterized event of each type, rebuilt from the release's event catalog and observed with synthetic photometry against the schedule. Filled squares are detections, open triangles are upper limits, and the lines are the noiseless model. This needs the event catalog and the survey schedule as well, and the schedule is fetched fresh, so it can differ from the one the release was run against. .. GENERATED FROM PYTHON SOURCE LINES 165-214 .. code-block:: Python events = schedule = None if report is not None: try: from uvex_transients.simulation import EventCatalog from uvex_transients.surveys import get_schedule from uvex_transients.utils import get_results events = EventCatalog.from_disk(get_results(["events"])["events"]) schedule = get_schedule() except (ConnectionError, LookupError, OSError, ValueError) as err: print(f"Skipping the example light curves, a data product is not available: {err}") if events is not None: from uvex_transients.missions import uvex_fast as uvex from uvex_transients.transients.kilonovae import Kilonova from uvex_transients.transients.LFBOTs import LuminousFastBlueOpticalTransient from uvex_transients.transients.llgrb import LowLuminosityGRB from uvex_transients.transients.supernovae import ( MagnetarSLSNe, TypeIaSNe, TypeIbSNe, TypeIcBLSNe, TypeIcSNe, TypeIIbSNe, TypeIIPSNe, ) from uvex_transients.transients.TDEs import TidalDisruptionEvent transients = { "ia_sne": TypeIaSNe(), "ib_sne": TypeIbSNe(), "ic_sne": TypeIcSNe(), "icbl_sne": TypeIcBLSNe(), "iip_sne": TypeIIPSNe(), "iib_sne": TypeIIbSNe(), "slsne": MagnetarSLSNe(), "tde": TidalDisruptionEvent(), "llgrb": LowLuminosityGRB(), "lfbot": LuminousFastBlueOpticalTransient(), "kilonova": Kilonova(), } for key in report.populations: try: report.plot_example_event(key, events, transients, schedule, uvex) except ValueError as err: print(err) plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_007.png :alt: Type Ia event 255174 (z=0.080, 12 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_007.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_008.png :alt: Type Ic event 242731 (z=0.073, 9 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_008.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_009.png :alt: Type IIP event 295182 (z=0.234, 40 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_009.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_010.png :alt: Type IIb event 205255 (z=0.661, 9 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_010.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_011.png :alt: SLSN-I event 296163 (z=0.473, 12 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_011.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_012.png :alt: TDE event 257301 (z=0.396, 21 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_012.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_013.png :alt: llGRB event 139729 (z=0.839, 25 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_013.png :class: sphx-glr-multi-img * .. image-sg:: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_014.png :alt: LFBOT event 329015 (z=0.718, 27 observations) :srcset: /report/full_run/transient_characterization/images/sphx_glr_plot_characterization_014.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none Downloading final_catalog.ecsv: 0%| | 0.00/2.41M [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_characterization.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_characterization.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_