Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yifan Wang
SEOBNRE
Commits
29c48597
Commit
29c48597
authored
Jan 17, 2021
by
Yifan Wang
Browse files
add time length for pycbc injection
parent
7882f1bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
SEOBNRE.py
View file @
29c48597
...
...
@@ -2,18 +2,28 @@ from ctypes import *
import
numpy
from
pycbc.types
import
TimeSeries
,
FrequencySeries
import
os
def
SEOBNRE_td
(
**
kwargs
):
lib
=
CDLL
(
'$LD_LIBRARY_PATH/libSEOBNRE.so'
)
waveform_generation
=
lib
.
genwaveform
waveform_generation
.
argtypes
=
[
POINTER
(
c_double
),
POINTER
(
c_double
),
\
f
=
lib
.
genwaveform
f
.
argtypes
=
[
POINTER
(
c_double
),
POINTER
(
c_double
),
\
POINTER
(
c_double
),
POINTER
(
c_int
),
\
c_double
,
c_double
,
c_double
,
c_double
,
c_double
,
c_double
,
c_double
,
c_double
,
c_double
,
c_double
,
c_double
]
params
=
{
'coa_phase'
:
0.0
,
'delta_t'
:
None
,
'mass1'
:
None
,
'mass2'
:
None
,
\
'spin1z'
:
0.0
,
'spin2z'
:
0.0
,
'f_lower'
:
None
,
'eccentricity'
:
0.0
,
'distance'
:
1.0
,
'inclination'
:
0.0
,
\
'long_asc_nodes'
:
0.0
}
# initiate the waveform parameters
params
=
{
'coa_phase'
:
0.0
,
'delta_t'
:
None
,
'mass1'
:
None
,
'mass2'
:
None
,
'spin1z'
:
0.0
,
'spin2z'
:
0.0
,
'f_lower'
:
None
,
'eccentricity'
:
0.0
,
'distance'
:
1.0
,
'inclination'
:
0.0
,
'long_asc_nodes'
:
0.0
}
for
value
in
params
:
if
value
in
kwargs
:
params
[
value
]
=
kwargs
[
value
]
...
...
@@ -28,7 +38,7 @@ def SEOBNRE_td(**kwargs):
t0
=
numpy
.
array
([
1.
])
# Generate the waveform
waveform_generation
(
hplus
.
ctypes
.
data_as
(
POINTER
(
c_double
)),
hcross
.
ctypes
.
data_as
(
POINTER
(
c_double
)),
f
(
hplus
.
ctypes
.
data_as
(
POINTER
(
c_double
)),
hcross
.
ctypes
.
data_as
(
POINTER
(
c_double
)),
t0
.
ctypes
.
data_as
(
POINTER
(
c_double
)),
truesize
.
ctypes
.
data_as
(
POINTER
(
c_int
)),
params
[
'coa_phase'
],
params
[
'delta_t'
],
params
[
'mass1'
],
params
[
'mass2'
],
params
[
'spin1z'
],
params
[
'spin2z'
],
params
[
'f_lower'
],
params
[
'eccentricity'
],
params
[
'distance'
],
params
[
'inclination'
],
params
[
'long_asc_nodes'
])
...
...
@@ -44,8 +54,13 @@ def SEOBNRE_td(**kwargs):
return
hp
,
hc
def
SEOBNRE_fd
(
**
kwargs
):
hp
,
hc
=
SEOBNRE_td
(
**
kwargs
)
return
(
hp
.
to_frequencyseries
(),
hc
.
to_frequencyseries
())
def
add_me
(
**
kwds
):
kwds
[
'cpu_td'
][
'SEOBNRE'
]
=
SEOBNRE_td
kwds
[
'filter_time_lengths'
][
'SEOBNRE'
]
=
kwds
[
'filter_time_lengths'
][
'SEOBNRv4'
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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