Skip to content
Snippets Groups Projects
user avatar
Jameson Graef Rollins authored
new suspension_thermal() function for calculating thermal noise of a
single suspended optic.

ifo SuspensionThermal Noise class modified to handle specific case of
Fabry-Perot Michelson.
080b9fb9
History

pipeline status

Python port of GW Interferometer Noise Calculator

gwinc

This is a collection of mostly analytic noise calculations (e.g. quantum, thermal)

basic usage

pygwinc creates noise budgets based on detector descriptions provided in either .yml or .mat files (see below). Once the detector description is loaded, the noise budget can be calculated and plotted:

>>> import gwinc
>>> import numpy as np
>>> freq = np.logspace(1, 3, 1000)
>>> Budget = gwinc.load_budget('aLIGO')
>>> ifo = gwinc.precompIFO(freq, Budget.ifo)
>>> traces = Budget(freq, ifo=ifo).run()
>>> fig = gwinc.plot_noise(freq, traces)
>>> fig.show()

command line interface

You can make gwinc plots directly from the command line by executing the package directly:

$ python3 -m gwinc aLIGO

detector description files

pygwinc can load budget descriptions in different formats: python package/module, .yaml YAML file, and MATLAB gwinc .mat or .m files.

pygwinc includes budgets for various canonical detectors:

noise budgets

GWINC provides an nb package for defining arbitrary noise budgets:

import numpy as np
from gwinc import nb
from gwinc import noise


class ExcessGas(nb.Noise):
    """Excess gas"""
    style = dict(
        label='Excess Gas',
        color='#ad900d',
        linestyle='--',
    )

    def calc(self):
        return noise.residualgas.gas(self.freq, self.ifo)


class MeasuredNoise(nb.Noise):
    """My measured noise"""
    style = dict(
        label='Measured Noise',
        color='#838209',
        linestyle='-',
    )

    def load(self):
        psd, freq = np.loadtxt('/path/to/measured/psd.txt')
        self.data = self.interpolate(f, psd)

    def calc(self):
        return self.data


class MyBudget(nb.Budget):
    noises = [
        ExcessGas,
        MeasuredNoise,
    ]

comparison with MATLAB gwinc

pygwinc includes the ability use MATLAB gwinc directly via the MATLAB python interface (see the CLI '--matlab' option above). This also allows for easy direct comparison between the pygwinc and matgwinc noise budgets.

If you have a local checkout of matgwinc (at e.g. /path/to/gwinc) and a local installation of MATLAB and it's python interface (at e.g. /opt/matlab/python/lib/python3.6/site-packages) you can run the comparison as so:

$ export GWINCPATH=/path/to/matgwinc
$ export PYTHONPATH=/opt/matlab/python/lib/python3.6/site-packages
$ python3 -m gwinc.test -p aLIGO

This will produce a summary page of the various noise spectra that differ between matgwinc and pygwinc.

Latest comparison plots from continuous integration: