Skip to content
Snippets Groups Projects
Commit 9be8007f authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

script to generate comparison plot of all IFOs

implement as __main__ for `gwinc.ifo`

also add to CI.  closes #48
parent 1f5087c5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
IFO.md 0 → 100644
# Canonical IFOs
CI-generated plots and data for all IFOs included in pygwinc.
![IFO compare](https://gwinc.docs.ligo.org/pygwinc/all_compare.png)
## aLIGO
* [ifo.yaml](gwinc/ifo/aLIGO/ifo.yaml)
* [aLIGO.h5](https://gwinc.docs.ligo.org/pygwinc/aLIGO.h5)
![aLIGO](https://gwinc.docs.ligo.org/pygwinc/aLIGO.png)
## A+
* [ifo.yaml](gwinc/ifo/Aplus/ifo.yaml)
* [Aplus.h5](https://gwinc.docs.ligo.org/pygwinc/Aplus.h5)
![Aplus](https://gwinc.docs.ligo.org/pygwinc/Aplus.png)
## Voyager
* [ifo.yaml](gwinc/ifo/Voyager/ifo.yaml)
* [Voyager.h5](https://gwinc.docs.ligo.org/pygwinc/Voyager.h5)
![Voyager](https://gwinc.docs.ligo.org/pygwinc/Voyager.png)
## Cosmic Explorer 1
* [ifo.yaml](gwinc/ifo/CE1/ifo.yaml)
* [CE1.h5](https://gwinc.docs.ligo.org/pygwinc/CE1.h5)
![CE1](https://gwinc.docs.ligo.org/pygwinc/CE1.png)
## Cosmic Explorer 2
* [ifo.yaml](gwinc/ifo/CE2/ifo.yaml)
* [CE2.h5](https://gwinc.docs.ligo.org/pygwinc/CE2.h5)
![CE2](https://gwinc.docs.ligo.org/pygwinc/CE2.png)
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment