From efd12e91504f125df530b3eb45b7066cd8233022 Mon Sep 17 00:00:00 2001 From: Alexander Harvey Nitz Date: Wed, 9 Aug 2023 12:21:18 -0400 Subject: [PATCH] fixes suggested by Ian --- docs/index.rst | 27 ++++++++++++++------------- examples/detector/ant.py | 2 -- examples/waveform/higher_modes.py | 17 ++++++++++++++--- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index b6d099d7884..1b32371bcfe 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,6 +23,20 @@ library and application suite. :show_shadows: :show_captions_below: + .. figure:: https://pycbc.org/pycbc/latest/html/_images/data.png + :height: 400px + :target: catalog.html + + Working with gravitational wave data + + .. figure:: + + .. figure:: https://pycbc.org/pycbc/latest/html/_images/plot_detwaveform.png + :height: 400px + :target: waveform.html + + Your interface to generating gravitational wave signals + .. figure:: https://collincapano.com/wp-content/uploads/2020/02/posterior3d-gw150914_masses-e1581860222179.png :height: 400px :target: inference.html @@ -35,19 +49,6 @@ library and application suite. Fast Parameter Estimation with Advanced Marginalizations - .. figure:: https://pycbc.org/pycbc/latest/html/_images/plot_detwaveform.png - :height: 400px - :target: waveform.html - - Your interface to generating gravitational wave signals - - .. figure:: https://pycbc.org/pycbc/latest/html/_images/data.png - :height: 400px - :target: catalog.html - - Working with gravitatoinal wave data - - .. figure:: .. toctree:: :hidden: diff --git a/examples/detector/ant.py b/examples/detector/ant.py index ed814f07648..a8137163a68 100644 --- a/examples/detector/ant.py +++ b/examples/detector/ant.py @@ -1,7 +1,5 @@ from pycbc.detector import Detector from pycbc.waveform import get_td_waveform -from matplotlib import pyplot as plt -import numpy as np # Time, orientation and location of the source in the sky ra = 1.7 diff --git a/examples/waveform/higher_modes.py b/examples/waveform/higher_modes.py index 88230ed4583..9c6db4ad084 100644 --- a/examples/waveform/higher_modes.py +++ b/examples/waveform/higher_modes.py @@ -5,7 +5,18 @@ pp.figure() # You can select sets of modes or individual modes using the 'mode_array' -for mode_select in [None, "22 33", "21", "22", "33", "32", "44",]: +# The standard format is to provide a list of (l, m) modes, however +# a string format is also provided to aid use in population from config files. +# e.g. "22 33" is also acceptable to select these two modes. +# "None" will result in the waveform return its default which is usually +# to return all implemented modes. +for mode_select in [None, + [(2, 2), (3, 3)], # Select two modes at once + [(2, 2)], + [(2, 1)], + [(3, 2)], + [(4, 4)], + ]: hp, hc = get_td_waveform(approximant="IMRPhenomXPHM", mass1=7, mass2=40, @@ -20,11 +31,11 @@ label = 'Full Waveform' a = hp.max() else: - label = "l,m=" + mode_select + label = "l, m = " + ' '.join([f"{l}, {m}" for l, m in mode_select]) (hp / a).plot(label=label) -pp.xlim(-2, 0.3) +pp.xlim(-1, 0.05) pp.legend() pp.xlabel('Time [s]') pp.ylabel('Relative Strain')