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
01c83baf
Commit
01c83baf
authored
4 years ago
by
Sylvia Biscoveanu
Committed by
Shanika Galaudage
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix some issues with distance and phase marginalization
parent
82872fe5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/gw/likelihood.py
+11
-3
11 additions, 3 deletions
bilby/gw/likelihood.py
with
11 additions
and
3 deletions
bilby/gw/likelihood.py
+
11
−
3
View file @
01c83baf
...
...
@@ -167,6 +167,9 @@ class GravitationalWaveTransient(Likelihood):
self
.
distance_prior_array
=
np
.
array
(
[
self
.
priors
[
'
luminosity_distance
'
].
prob
(
distance
)
for
distance
in
self
.
_distance_array
])
if
self
.
phase_marginalization
:
max_bound
=
np
.
ceil
(
10
+
np
.
log10
(
self
.
_dist_multiplier
))
self
.
_setup_phase_marginalization
(
max_bound
=
max_bound
)
self
.
_setup_distance_marginalization
(
distance_marginalization_lookup_table
)
for
key
in
[
'
redshift
'
,
'
comoving_distance
'
]:
...
...
@@ -600,6 +603,11 @@ class GravitationalWaveTransient(Likelihood):
"""
Median distance in priors
"""
return
self
.
priors
[
'
luminosity_distance
'
].
rescale
(
0.5
)
@property
def
_dist_multiplier
(
self
):
'''
Maximum value of ref_dist/dist_array
'''
return
self
.
_ref_dist
/
self
.
_distance_array
[
0
]
@property
def
_optimal_snr_squared_ref_array
(
self
):
"""
Optimal filter snr at fiducial distance of ref_dist Mpc
"""
...
...
@@ -714,10 +722,10 @@ class GravitationalWaveTransient(Likelihood):
self
.
_dist_margd_loglikelihood_array
-=
log_norm
self
.
cache_lookup_table
()
def
_setup_phase_marginalization
(
self
):
def
_setup_phase_marginalization
(
self
,
min_bound
=-
5
,
max_bound
=
10
):
self
.
_bessel_function_interped
=
interp1d
(
np
.
logspace
(
-
5
,
10
,
int
(
1e6
)),
np
.
logspace
(
-
5
,
10
,
int
(
1e6
))
+
np
.
log
([
i0e
(
snr
)
for
snr
in
np
.
logspace
(
-
5
,
10
,
int
(
1e6
))]),
np
.
logspace
(
-
5
,
max_bound
,
int
(
1e6
)),
np
.
logspace
(
-
5
,
max_bound
,
int
(
1e6
))
+
np
.
log
([
i0e
(
snr
)
for
snr
in
np
.
logspace
(
-
5
,
max_bound
,
int
(
1e6
))]),
bounds_error
=
False
,
fill_value
=
(
0
,
np
.
nan
))
def
_setup_time_marginalization
(
self
):
...
...
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