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

tweak gwinc keyword argument for plotting

Use 'plot' instead of 'fig', which can be confused with matplotlib
figure.

and update README
parent 186fb750
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -9,18 +9,19 @@ ...@@ -9,18 +9,19 @@
`pygwinc` creates noise budgets based on detector descriptions `pygwinc` creates noise budgets based on detector descriptions
provided in either .yml or .mat files (see below). Once the detector provided in either .yml or .mat files (see below). Once the detector
description is loaded, the noise budget can be calculated with the description is loaded, the noise budget can be calculated and plotted:
`gwinc` command:
```python ```python
>>> import gwinc >>> import gwinc
>>> import numpy as np >>> import numpy as np
>>> ifo = gwinc.load_ifo('aLIGO')
>>> freq = np.logspace(1, 3, 1000) >>> freq = np.logspace(1, 3, 1000)
>>> score, data, ifo = gwinc.gwinc(freq, ifo) >>> ifo = gwinc.load_ifo('aLIGO')
>>> ifo = gwinc.precompIFO(ifo)
>>> noises = gwinc.noise_calc(ifo, freq)
>>> gwinc.plot_noise(ifo, noises)
``` ```
A convenience function to plot the resulting noise budget is included: Or the `gwinc` convenience function can be used to handle it all:
``` ```
>>> gwinc.plot_noise(data) >>> score, data, ifo = gwinc.gwinc(freq, ifo, plot=True)
``` ```
......
...@@ -106,7 +106,7 @@ def noise_calc(ifo, f): ...@@ -106,7 +106,7 @@ def noise_calc(ifo, f):
return noises return noises
def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True): def gwinc(freq, ifoin, source=None, plot=False, PRfixed=True):
"""Calculate strain noise budget for a specified interferometer model. """Calculate strain noise budget for a specified interferometer model.
Argument `freq` is the frequency array for which the noises will Argument `freq` is the frequency array for which the noises will
...@@ -117,7 +117,7 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True): ...@@ -117,7 +117,7 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True):
the detector to several potential gravitational wave the detector to several potential gravitational wave
sources. sources.
If `fig` is specified a plot of the budget will be created. If `plot` is True a plot of the budget will be created.
Returns tuple of (score, noises, ifo) Returns tuple of (score, noises, ifo)
...@@ -146,7 +146,7 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True): ...@@ -146,7 +146,7 @@ def gwinc(freq, ifoin, source=None, fig=False, PRfixed=True):
# -------------------------------------------------------- # --------------------------------------------------------
# output graphics # output graphics
if fig: if plot:
# Report input parameters # Report input parameters
if ifo.Optics.Type == 'DualCarrier_new': #include the case for Dual carrier if ifo.Optics.Type == 'DualCarrier_new': #include the case for Dual carrier
finesseA = 2*pi/ifo.Optics.ITM.TransmittanceD1 finesseA = 2*pi/ifo.Optics.ITM.TransmittanceD1
......
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