Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Commits
0f8a09c2
Commit
0f8a09c2
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
use different methods for time and frequency domain
parent
8834bae2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!367
Allow time domain approximants
Pipeline
#49572
passed
6 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bilby/gw/source.py
+19
-21
19 additions, 21 deletions
bilby/gw/source.py
bilby/gw/utils.py
+29
-0
29 additions, 0 deletions
bilby/gw/utils.py
with
48 additions
and
21 deletions
bilby/gw/source.py
+
19
−
21
View file @
0f8a09c2
...
...
@@ -3,12 +3,13 @@ from __future__ import division, print_function
import
numpy
as
np
from
..core
import
utils
from
..core.utils
import
logger
from
.utils
import
(
lalsim_SimInspiralTransformPrecessingNewInitialConditions
,
lalsim_GetApproximantFromString
,
from
..core.utils
import
logger
,
spherical_to_cartesian
from
.utils
import
(
lalsim_GetApproximantFromString
,
lalsim_SimInspiralFD
,
lalsim_SimInspiralChooseFDWaveform
,
lalsim_SimInspiralWaveformParamsInsertTidalLambda1
,
lalsim_SimInspiralWaveformParamsInsertTidalLambda2
)
from
.conversion
import
transform_precessing_spins
try
:
import
lal
...
...
@@ -60,7 +61,7 @@ def lal_binary_black_hole(
waveform_approximant
=
'
IMRPhenomPv2
'
,
reference_frequency
=
50.0
,
minimum_frequency
=
20.0
,
maximum_frequency
=
frequency_array
[
-
1
])
waveform_kwargs
.
update
(
kwargs
)
return
_base_lal_cbc_waveform
(
return
_base_lal_cbc_
fd_
waveform
(
frequency_array
=
frequency_array
,
mass_1
=
mass_1
,
mass_2
=
mass_2
,
luminosity_distance
=
luminosity_distance
,
iota
=
iota
,
phase
=
phase
,
a_1
=
a_1
,
a_2
=
a_2
,
tilt_1
=
tilt_1
,
tilt_2
=
tilt_2
,
phi_12
=
phi_12
,
...
...
@@ -120,7 +121,7 @@ def lal_binary_neutron_star(
phi_12
=
0.0
phi_jl
=
0.0
waveform_kwargs
.
update
(
kwargs
)
return
_base_lal_cbc_waveform
(
return
_base_lal_cbc_
fd_
waveform
(
frequency_array
=
frequency_array
,
mass_1
=
mass_1
,
mass_2
=
mass_2
,
luminosity_distance
=
luminosity_distance
,
iota
=
iota
,
phase
=
phase
,
a_1
=
a_1
,
a_2
=
a_2
,
tilt_1
=
tilt_1
,
tilt_2
=
tilt_2
,
phi_12
=
phi_12
,
...
...
@@ -160,13 +161,13 @@ def lal_eccentric_binary_black_hole_no_spins(
waveform_approximant
=
'
EccentricFD
'
,
reference_frequency
=
10.0
,
minimum_frequency
=
10.0
,
maximum_frequency
=
frequency_array
[
-
1
])
waveform_kwargs
.
update
(
kwargs
)
return
_base_lal_cbc_waveform
(
return
_base_lal_cbc_
fd_
waveform
(
frequency_array
=
frequency_array
,
mass_1
=
mass_1
,
mass_2
=
mass_2
,
luminosity_distance
=
luminosity_distance
,
iota
=
iota
,
phase
=
phase
,
eccentricity
=
eccentricity
,
**
waveform_kwargs
)
def
_base_lal_cbc_waveform
(
def
_base_lal_cbc_
fd_
waveform
(
frequency_array
,
mass_1
,
mass_2
,
luminosity_distance
,
iota
,
phase
,
a_1
=
0.0
,
a_2
=
0.0
,
tilt_1
=
0.0
,
tilt_2
=
0.0
,
phi_12
=
0.0
,
phi_jl
=
0.0
,
lambda_1
=
0.0
,
lambda_2
=
0.0
,
eccentricity
=
0.0
,
**
waveform_kwargs
):
...
...
@@ -229,15 +230,11 @@ def _base_lal_cbc_waveform(
mass_2
=
mass_2
*
utils
.
solar_mass
if
tilt_1
==
0
and
tilt_2
==
0
:
spin_1x
=
0
spin_1y
=
0
spin_1z
=
a_1
spin_2x
=
0
spin_2y
=
0
spin_2z
=
a_2
spin_1x
,
spin_1y
,
spin_1z
=
spherical_to_cartesian
(
a_1
,
0.0
,
0.0
)
spin_2x
,
spin_2y
,
spin_2z
=
spherical_to_cartesian
(
a_2
,
0.0
,
0.0
)
else
:
iota
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
=
(
lalsim_SimInspiralT
ransform
P
recessing
NewInitialConditio
ns
(
t
ransform
_p
recessing
_spi
ns
(
iota
,
phi_jl
,
tilt_1
,
tilt_2
,
phi_12
,
a_1
,
a_2
,
mass_1
,
mass_2
,
reference_frequency
,
phase
))
...
...
@@ -250,18 +247,19 @@ def _base_lal_cbc_waveform(
approximant
=
lalsim_GetApproximantFromString
(
waveform_approximant
)
hplus
,
hcross
=
lalsim_SimInspiralFD
(
if
lalsim
.
SimInspiralImplementedFDApproximants
(
approximant
):
wf_func
=
lalsim_SimInspiralChooseFDWaveform
else
:
wf_func
=
lalsim_SimInspiralFD
hplus
,
hcross
=
wf_func
(
mass_1
,
mass_2
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
,
luminosity_distance
,
iota
,
phase
,
longitude_ascending_nodes
,
eccentricity
,
mean_per_ano
,
delta_frequency
,
minimum_frequency
,
maximum_frequency
,
reference_frequency
,
waveform_dictionary
,
approximant
)
h_plus
=
hplus
.
data
.
data
h_cross
=
hcross
.
data
.
data
h_plus
=
h_plus
[:
len
(
frequency_array
)]
*
frequency_bounds
h_cross
=
h_cross
[:
len
(
frequency_array
)]
*
frequency_bounds
h_plus
=
hplus
.
data
.
data
[:
len
(
frequency_array
)]
*
frequency_bounds
h_cross
=
hcross
.
data
.
data
[:
len
(
frequency_array
)]
*
frequency_bounds
return
{
'
plus
'
:
h_plus
,
'
cross
'
:
h_cross
}
...
...
@@ -399,7 +397,7 @@ def roq(frequency_array, mass_1, mass_2, luminosity_distance, a_1, tilt_1,
spin_2z
=
a_2
else
:
iota
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
=
\
lalsim
.
SimInspiralT
ransform
P
recessing
NewInitialConditio
ns
(
t
ransform
_p
recessing
_spi
ns
(
iota
,
phi_jl
,
tilt_1
,
tilt_2
,
phi_12
,
a_1
,
a_2
,
mass_1
,
mass_2
,
reference_frequency
,
phase
)
...
...
This diff is collapsed.
Click to expand it.
bilby/gw/utils.py
+
29
−
0
View file @
0f8a09c2
...
...
@@ -770,6 +770,35 @@ def lalsim_SimInspiralFD(
waveform_dictionary
,
approximant
)
def
lalsim_SimInspiralChooseFDWaveform
(
mass_1
,
mass_2
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
,
luminosity_distance
,
iota
,
phase
,
longitude_ascending_nodes
,
eccentricity
,
mean_per_ano
,
delta_frequency
,
minimum_frequency
,
maximum_frequency
,
reference_frequency
,
waveform_dictionary
,
approximant
):
# Convert values to floats
[
mass_1
,
mass_2
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
,
luminosity_distance
,
iota
,
phase
,
longitude_ascending_nodes
,
eccentricity
,
mean_per_ano
,
delta_frequency
,
minimum_frequency
,
maximum_frequency
,
reference_frequency
]
=
convert_args_list_to_float
(
mass_1
,
mass_2
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
,
luminosity_distance
,
iota
,
phase
,
longitude_ascending_nodes
,
eccentricity
,
mean_per_ano
,
delta_frequency
,
minimum_frequency
,
maximum_frequency
,
reference_frequency
)
# Note, this is the approximant number returns by GetApproximantFromString
if
isinstance
(
approximant
,
int
)
is
False
:
raise
ValueError
(
"
approximant not an int
"
)
return
lalsim
.
SimInspiralChooseFDWaveform
(
mass_1
,
mass_2
,
spin_1x
,
spin_1y
,
spin_1z
,
spin_2x
,
spin_2y
,
spin_2z
,
luminosity_distance
,
iota
,
phase
,
longitude_ascending_nodes
,
eccentricity
,
mean_per_ano
,
delta_frequency
,
minimum_frequency
,
maximum_frequency
,
reference_frequency
,
waveform_dictionary
,
approximant
)
def
lalsim_SimInspiralWaveformParamsInsertTidalLambda1
(
waveform_dictionary
,
lambda_1
):
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment