Skip to content
Snippets Groups Projects
Commit 3a4c36e2 authored by Yifan Wang's avatar Yifan Wang
Browse files

add mpvinverse parametrization for testing birefringence

parent 202d440f
Branches
No related tags found
No related merge requests found
import numpy
def integrand_parityamu_mpvinverse(redshift):
"""
The integrand:
(1.0 + z)^parity_beta / sqrt(Omega_m (1+z)^3 + Omega_Lambda)
"""
omega_m = 0.3075 #pycbc.cosmology.get_cosmology().Om0 # matter density
omega_l = 0.6910098821161554 #pycbc.cosmology.get_cosmology().Ode0 # dark energy density
return (1.0+redshift)/ numpy.sqrt(omega_m*(1.0+redshift)**3.0 + omega_l)
def gen(**kwds):
from pycbc.waveform import get_fd_waveform
from pycbc import cosmology
import lal
#print(kwds)
if 'approximant' in kwds:
kwds.pop("approximant")
if kwds['baseapprox'] is None:
raise ValueError("A base waveform approximant is required.")
hp, hc = get_fd_waveform(approximant=kwds['baseapprox'], **kwds)
zz = cosmology.redshift(kwds['distance'])
intz = integrate.quad(integrand_parityamu_mpv 0, zz)[0]
temp = kwds['parity_mpvinverse'] * intz / 1e9 / lal.QE_SI * lal.H_SI * lal.PI * lal.PI / lal.H0_SI
hp_parity = hp + hc * temp * hp.sample_frequencies **2
hc_parity = hc - hp * temp * hp.sample_frequencies **2
return hp_parity, hc_parity
\ No newline at end of file
"""
setup.py file for testing birefringence pycbc waveform plugin package
"""
from setuptools import Extension, setup, Command
from setuptools import find_packages
VERSION = '0.0.dev0'
setup (
name = 'pycbc-birefringence-mpvinverse',
version = VERSION,
description = 'A waveform plugin for PyCBC',
author = 'Yifan Wang',
author_email = 'yifan.wang@aei.mpg.de',
url = 'http://www.pycbc.org/',
#download_url = 'https://github.com/gwastro/revchirp/tarball/v%s' % VERSION,
keywords = ['pycbc', 'signal processing', 'gravitational waves'],
py_modules = ['mpvwaveform'],
entry_points = {"pycbc.waveform.fd":"mpvinverse=mpvwaveform:gen"},
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Physics',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment