Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_phenomD_utils.py
Go to the documentation of this file.
1# -*- coding: utf-8 -*-
2#
3# Copyright (C) 2020 Sebastian Khan
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http: //www.gnu.org/licenses/>.
17
18"""Test PhenomD utility functions
19"""
20
21import sys
22import pytest
23import lal
24import lalsimulation
25
26# -- test functions ---------------------
27
28FDamp0_test_data = [
29 (100,1,2.357052240844003e-21),
30 (110,2,1.4260166057106217e-21),
31 (120,3,1.1313850756051214e-21),
32 (130,4,9.958545717565913e-22)
33]
34
35@pytest.mark.parametrize("mtot, distance, expected", FDamp0_test_data)
36def test_SimPhenomUtilsFDamp0(mtot, distance, expected):
37 """
38 mtot: total mass in solar masses
39 distance: distance to source in Mpc
40 expected: expected value from lalsimulation.SimPhenomUtilsFDamp0
41 """
42 value = lalsimulation.SimPhenomUtilsFDamp0(mtot, distance*1e6*lal.PC_SI)
43
44 assert value == expected, (
45 "lalsimulation.SimPhenomUtilsFDamp0 test failed"
46 )
47
48# -- run the tests ------------------------------
49
50if __name__ == '__main__':
51 args = sys.argv[1:] or ["-v", "-rs", "--junit-xml=junit-phenomD_utils.xml"]
52 sys.exit(pytest.main(args=[__file__] + args))
def test_SimPhenomUtilsFDamp0(mtot, distance, expected)
mtot: total mass in solar masses distance: distance to source in Mpc expected: expected value from la...