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
1feb9438
There was a problem fetching the pipeline summary.
Commit
1feb9438
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
start setting up some post processing
parent
67c21364
No related branches found
No related tags found
1 merge request
!25
start setting up some post processing
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
peyote/result.py
+30
-0
30 additions, 0 deletions
peyote/result.py
peyote/sampler.py
+2
-0
2 additions, 0 deletions
peyote/sampler.py
with
32 additions
and
0 deletions
peyote/result.py
+
30
−
0
View file @
1feb9438
import
logging
import
os
import
numpy
as
np
import
deepdish
from
chainconsumer
import
ChainConsumer
import
pandas
as
pd
class
Result
(
dict
):
...
...
@@ -113,4 +115,32 @@ class Result(dict):
fig
=
c
.
plotter
.
plot_distributions
(
**
kwargs
)
return
fig
def
samples_to_data_frame
(
self
):
"""
Convert array of samples to data frame.
:return:
"""
data_frame
=
pd
.
DataFrame
(
self
.
samples
,
columns
=
self
.
search_parameter_keys
)
self
.
posterior
=
data_frame
for
key
in
self
.
fixed_parameter_keys
:
self
.
posterior
[
key
]
=
self
.
prior
[
key
].
sample
(
len
(
self
.
posterior
))
def
construct_cbc_derived_parameters
(
self
):
"""
Construct widely used derived parameters of CBCs
:return:
"""
self
.
posterior
[
'
mass_chirp
'
]
=
(
self
.
posterior
.
mass_1
*
self
.
posterior
.
mass_2
)
**
0.6
\
/
(
self
.
posterior
.
mass_1
+
self
.
posterior
.
mass_2
)
**
0.2
self
.
posterior
[
'
q
'
]
=
self
.
posterior
.
mass_2
/
self
.
posterior
.
mass_1
self
.
posterior
[
'
eta
'
]
=
(
self
.
posterior
.
mass_1
*
self
.
posterior
.
mass_2
)
\
/
(
self
.
posterior
.
mass_1
+
self
.
posterior
.
mass_2
)
**
2
self
.
posterior
[
'
chi_eff
'
]
=
(
self
.
posterior
.
a_1
*
np
.
cos
(
self
.
posterior
.
tilt_1
)
+
self
.
posterior
.
q
*
self
.
posterior
.
a_2
*
np
.
cos
(
self
.
posterior
.
tilt_2
))
\
/
(
1
+
self
.
posterior
.
q
)
self
.
posterior
[
'
chi_p
'
]
=
max
(
self
.
posterior
.
a_1
*
np
.
sin
(
self
.
posterior
.
tilt_1
),
(
4
*
self
.
posterior
.
q
+
3
)
/
(
3
*
self
.
posterior
.
q
+
4
)
*
self
.
posterior
.
q
*
self
.
posterior
.
a_2
*
np
.
sin
(
self
.
posterior
.
tilt_2
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
peyote/sampler.py
+
2
−
0
View file @
1feb9438
...
...
@@ -300,6 +300,8 @@ def run_sampler(likelihood, priors, label='label', outdir='outdir',
else
:
result
.
log_bayes_factor
=
result
.
logz
-
result
.
noise_logz
result
.
injection_parameters
=
injection_parameters
result
.
prior
=
prior
result
.
samples_to_data_frame
()
result
.
save_to_file
(
outdir
=
outdir
,
label
=
label
)
return
result
else
:
...
...
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