Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby_SSB_test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Rachel Langgin
bilby_SSB_test
Commits
56a58aeb
Commit
56a58aeb
authored
11 months ago
by
Rhiannon Udall
Committed by
Colm Talbot
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: Separate adding SNRs per IFO to a sample into a new function
parent
01575b9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bilby/gw/conversion.py
+8
-10
8 additions, 10 deletions
bilby/gw/conversion.py
bilby/gw/likelihood/base.py
+14
-0
14 additions, 0 deletions
bilby/gw/likelihood/base.py
with
22 additions
and
10 deletions
bilby/gw/conversion.py
+
8
−
10
View file @
56a58aeb
...
...
@@ -2254,17 +2254,15 @@ def compute_snrs(sample, likelihood, npool=1):
new_samples
=
[
_compute_snrs
(
xx
)
for
xx
in
tqdm
(
fill_args
,
file
=
sys
.
stdout
)]
for
ii
,
ifo
in
enumerate
(
likelihood
.
interferometers
):
matched_filter_snrs
=
list
()
optimal_snrs
=
list
()
mf_key
=
'
{}_matched_filter_snr
'
.
format
(
ifo
.
name
)
optimal_key
=
'
{}_optimal_snr
'
.
format
(
ifo
.
name
)
snr_updates
=
dict
()
for
key
in
new_samples
[
0
][
ii
].
snrs_as_sample
.
keys
():
snr_updates
[
f
"
{
ifo
.
name
}
_
{
key
}
"
]
=
list
()
for
new_sample
in
new_samples
:
matched_filter_snrs
.
append
(
new_sample
[
ii
].
complex_matched_filter_snr
)
optimal_snrs
.
append
(
new_sample
[
ii
].
optimal_snr_squared
.
real
**
0.5
)
sample
[
mf_key
]
=
matched_filter_snrs
sample
[
optimal_key
]
=
optimal_snrs
snr_update
=
new_sample
[
ii
].
snrs_as_sample
for
key
,
val
in
snr_update
.
items
():
snr_updates
[
f
"
{
ifo
.
name
}
_
{
key
}
"
].
append
(
val
)
for
k
,
v
in
snr_updates
.
items
():
sample
[
k
]
=
v
else
:
logger
.
debug
(
'
Not computing SNRs.
'
)
...
...
This diff is collapsed.
Click to expand it.
bilby/gw/likelihood/base.py
+
14
−
0
View file @
56a58aeb
...
...
@@ -128,6 +128,20 @@ class GravitationalWaveTransient(Likelihood):
setattr
(
self
,
key
,
other
)
return
self
@property
def
snrs_as_sample
(
self
)
->
dict
:
"""
Get the SNRs of this object as a sample dictionary
Returns
=======
dict
The dictionary of SNRs labelled accordingly
"""
return
{
"
matched_filter_snr
"
:
self
.
complex_matched_filter_snr
,
"
optimal_snr
"
:
self
.
optimal_snr_squared
.
real
**
0.5
}
def
__init__
(
self
,
interferometers
,
waveform_generator
,
time_marginalization
=
False
,
distance_marginalization
=
False
,
phase_marginalization
=
False
,
calibration_marginalization
=
False
,
priors
=
None
,
...
...
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