.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_smbh/plot_source_time_evolving.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_smbh_plot_source_time_evolving.py: Time-evolving parameter estimation ================================= Corner plot of select parameters for a single source showing how parameter estimation changes with observing time. .. GENERATED FROM PYTHON SOURCE LINES 9-24 .. code-block:: default import matplotlib.pyplot as plt from chainconsumer import ChainConsumer from lisacattools.catalog import GWCatalogs from lisacattools.catalog import GWCatalogType # Find the list of catalogs catPath = "../../tutorial/data/mbh" catalogs = GWCatalogs.create(GWCatalogType.MBH, catPath, "*.h5") last_cat = catalogs.get_last_catalog() detections_attr = last_cat.get_attr_detections() detections = last_cat.get_detections(detections_attr) .. GENERATED FROM PYTHON SOURCE LINES 25-27 Choose a source from the list of detections and get its history through the different catalogs Pick a source, any source .. GENERATED FROM PYTHON SOURCE LINES 27-29 .. code-block:: default sourceIdx = "MBH005546845" .. GENERATED FROM PYTHON SOURCE LINES 30-32 Load chains for different observing epochs of selected source Get source history and display table with parameters and observing weeks containing source .. GENERATED FROM PYTHON SOURCE LINES 32-49 .. code-block:: default srcHist = catalogs.get_lineage(last_cat.name, sourceIdx) srcHist.drop_duplicates(subset="Log Likelihood", keep="last", inplace=True) srcHist.sort_values(by="Observation Week", ascending=True, inplace=True) srcHist[ [ "Observation Week", "Parent", "Log Likelihood", "Mass 1", "Mass 2", "Luminosity Distance", ] ] # Load chains for different observing epochs of selected source allEpochs = catalogs.get_lineage_data(srcHist) .. GENERATED FROM PYTHON SOURCE LINES 50-51 Create corner for multiple observing epochs .. GENERATED FROM PYTHON SOURCE LINES 51-73 .. code-block:: default # Choose weeks for plot from source history table wks = [4, 8, 10] # select subset of parameters to plot parameters = ["Mass 1", "Mass 2", "Luminosity Distance"] parameter_labels = [ r"$m_1\ [{\rm M}_\odot]$", r"$m_2\ [{\rm M}_\odot]$", r"$D_L\ [{\rm Gpc}]$", ] ranges = [(10000, 50000), (1000, 5000), (16, 40)] c = ChainConsumer() for idx, wk in enumerate(wks): epoch = allEpochs[allEpochs["Observation Week"] == wk] samples = epoch[parameters].values c.add_chain(samples, parameters=parameter_labels, name="Week " + str(wk)) c.configure(cmap="plasma") fig = c.plotter.plot(figsize=1.5, log_scales=False, extents=ranges) plt.show() .. image:: /examples_smbh/images/sphx_glr_plot_source_time_evolving_001.png :alt: plot source time evolving :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 3.145 seconds) .. _sphx_glr_download_examples_smbh_plot_source_time_evolving.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_source_time_evolving.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_source_time_evolving.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_