Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PTAInterpretation
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Hannah Middleton
PTAInterpretation
Commits
c6f3b815
Commit
c6f3b815
authored
Jun 02, 2023
by
Hannah Middleton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using astro cosmo and constants
parent
92d416d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
mergerrate.py
models/galaxy_model/mergerrate.py
+16
-14
No files found.
models/galaxy_model/mergerrate.py
View file @
c6f3b815
...
@@ -3,13 +3,15 @@ import numpy.random as nr
...
@@ -3,13 +3,15 @@ import numpy.random as nr
import
scipy.optimize
as
so
import
scipy.optimize
as
so
import
scipy.integrate
as
si
import
scipy.integrate
as
si
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
from
astropy
import
constants
as
const
import
astropy.units
as
u
#cosmological functions begin
#cosmological functions begin
def
invE
(
z
):
def
invE
(
z
):
OmegaM
=
0.3
OmegaM
=
cosmo
.
Om0
#
0.3
Omegak
=
0.
Omegak
=
cosmo
.
Ok0
#
0.
OmegaLambda
=
0.7
OmegaLambda
=
cosmo
.
Ode0
#
0.7
return
1.
/
np
.
sqrt
(
OmegaM
*
(
1.
+
z
)
**
3.
+
Omegak
*
(
1.
+
z
)
**
2.
+
OmegaLambda
)
return
1.
/
np
.
sqrt
(
OmegaM
*
(
1.
+
z
)
**
3.
+
Omegak
*
(
1.
+
z
)
**
2.
+
OmegaLambda
)
def
dtdz
(
z
):
def
dtdz
(
z
):
...
@@ -19,13 +21,13 @@ def dtdz(z):
...
@@ -19,13 +21,13 @@ def dtdz(z):
return
t0
/
(
1.
+
z
)
*
invE
(
z
)
return
t0
/
(
1.
+
z
)
*
invE
(
z
)
def
dVcdz
(
z
):
def
dVcdz
(
z
):
c
=
3.e8
c
=
const
.
c
.
value
#
3.e8
H0
=
70.e3
H0
=
cosmo
.
H
(
0
)
.
value
*
1.e3
# 70.e3 -> check with Siyuan
return
4.
*
np
.
pi
*
c
/
H0
*
invE
(
z
)
*
DM
(
z
)
*
DM
(
z
)
return
4.
*
np
.
pi
*
c
/
H0
*
invE
(
z
)
*
DM
(
z
)
*
DM
(
z
)
def
DM
(
z
):
def
DM
(
z
):
c
=
3.e8
c
=
const
.
c
.
value
#
3.e8
H0
=
70.e3
H0
=
cosmo
.
H
(
0
)
.
value
*
1.e3
# 70.e3 -> check with Siyuan
return
c
/
H0
*
si
.
quad
(
invE
,
0.
,
z
)[
0
]
return
c
/
H0
*
si
.
quad
(
invE
,
0.
,
z
)[
0
]
def
mchirpq
(
q
):
def
mchirpq
(
q
):
...
@@ -49,11 +51,11 @@ def mfractionp(m):
...
@@ -49,11 +51,11 @@ def mfractionp(m):
#cosmological functions end
#cosmological functions end
#spectrum computation functions begin
#spectrum computation functions begin
Gu
=
6.673848e-11
Gu
=
const
.
G
.
value
#
6.673848e-11
cu
=
2.997925e8
cu
=
const
.
G
.
value
#
2.997925e8
Msun
=
1.98855e30
Msun
=
const
.
M_sun
.
value
#
1.98855e30
pc
=
3.0856776e16
pc
=
1.
*
u
.
parsec
.
to
(
u
.
m
)
#
3.0856776e16
Gyr
=
3.15576e16
Gyr
=
1.e9
*
1.
*
u
.
year
.
to
(
u
.
s
)
#
3.15576e16
G
=
Gu
*
Msun
/
pc
**
3.0
G
=
Gu
*
Msun
/
pc
**
3.0
c
=
cu
/
pc
c
=
cu
/
pc
...
@@ -401,8 +403,8 @@ class mergerrate(object):
...
@@ -401,8 +403,8 @@ class mergerrate(object):
def
hdrop
(
self
,
n0
,
f
,
fbin
):
def
hdrop
(
self
,
n0
,
f
,
fbin
):
if
fbin
is
None
:
if
fbin
is
None
:
return
n0
return
n0
c
=
3.e8
c
=
const
.
c
.
value
#
3.e8
G
=
1.33e20
G
=
1.33e20
# should we use const.G.value here too (not sure what the unit is here)
fhigh
=
f
+
fbin
fhigh
=
f
+
fbin
flow
=
f
-
fbin
flow
=
f
-
fbin
Mcbh
=
np
.
linspace
(
5
,
11
,
30
)
Mcbh
=
np
.
linspace
(
5
,
11
,
30
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment