diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e0a190b6bb3e36632db68584029a83e90ad9de3..8913d916a336e0f8118b25e7c195b145ab73d820 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,7 @@ test: - for ifo in aLIGO Aplus Voyager CE1 CE2; do - python3 -m gwinc $ifo -s $ifo.png - done + - python3 -m gwinc.ifo -s all_compare.png - python3 -m gwinc.test -r gwinc_test_report.pdf after_script: - rm gitID.txt @@ -32,6 +33,7 @@ test: - Voyager.png - CE1.png - CE2.png + - all_compare.png - gwinc_test_report.pdf pages: @@ -43,6 +45,7 @@ pages: - for ifo in aLIGO Aplus Voyager CE1 CE2; do - mv $ifo.png public/ - done + - mv all_compare.png public/ || true - mv gwinc_test_report.pdf public/ || true - apt-get install -y -qq python3-pip python3-dev make - pip3 install sphinx sphinx-rtd-theme diff --git a/IFO.md b/IFO.md new file mode 100644 index 0000000000000000000000000000000000000000..b2774d51603a27fb37ce164b72beb09ca28c58e3 --- /dev/null +++ b/IFO.md @@ -0,0 +1,44 @@ +# Canonical IFOs + +CI-generated plots and data for all IFOs included in pygwinc. + + + +## aLIGO + +* [ifo.yaml](gwinc/ifo/aLIGO/ifo.yaml) +* [aLIGO.h5](https://gwinc.docs.ligo.org/pygwinc/aLIGO.h5) + + + + +## A+ + +* [ifo.yaml](gwinc/ifo/Aplus/ifo.yaml) +* [Aplus.h5](https://gwinc.docs.ligo.org/pygwinc/Aplus.h5) + + + + +## Voyager + +* [ifo.yaml](gwinc/ifo/Voyager/ifo.yaml) +* [Voyager.h5](https://gwinc.docs.ligo.org/pygwinc/Voyager.h5) + + + + +## Cosmic Explorer 1 + +* [ifo.yaml](gwinc/ifo/CE1/ifo.yaml) +* [CE1.h5](https://gwinc.docs.ligo.org/pygwinc/CE1.h5) + + + + +## Cosmic Explorer 2 + +* [ifo.yaml](gwinc/ifo/CE2/ifo.yaml) +* [CE2.h5](https://gwinc.docs.ligo.org/pygwinc/CE2.h5) + + diff --git a/gwinc/ifo/__main__.py b/gwinc/ifo/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e5b3cba1d1d39bfd828bb7eeddc382903df51be --- /dev/null +++ b/gwinc/ifo/__main__.py @@ -0,0 +1,64 @@ +import argparse +import numpy as np +import matplotlib.pyplot as plt + +from . import IFOS, PLOT_STYLE +from .. import load_budget + + +FLO = 3 +FHI = 10000 +NPOINTS = 3000 +YLIM = (1e-25, 1e-20) + + +def main(): + parser = argparse.ArgumentParser( + description="Reference IFO comparison plot", + ) + parser.add_argument( + '--save', '-s', + help="save plot to file (.pdf/.png/.svg)") + args = parser.parse_args() + + fig = plt.figure() + ax = fig.add_subplot(1, 1, 1) + + freq = np.logspace(np.log10(FLO), np.log10(FHI), NPOINTS) + + for ifo in IFOS: + Budget = load_budget(ifo) + data = Budget(freq).calc() + label = Budget.name + + ax.loglog(freq, np.sqrt(data), label=label) + + ax.grid( + True, + which='both', + lw=0.5, + ls='-', + alpha=0.5, + ) + + ax.legend( + # ncol=2, + fontsize='small', + ) + + ax.autoscale(enable=True, axis='y', tight=True) + ax.set_ylim(*YLIM) + ax.set_xlim(freq[0], freq[-1]) + + ax.set_xlabel('Frequency [Hz]') + ax.set_ylabel(PLOT_STYLE['ylabel']) + ax.set_title("PyGWINC reference IFO strain comparison") + + if args.save: + fig.savefig(args.save) + else: + plt.show() + + +if __name__ == '__main__': + main()