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
aa4a8ee9
Commit
aa4a8ee9
authored
6 years ago
by
Virginia d'Emilio
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted typos, comments and conversation function after feedback.
parent
8a1d603d
No related branches found
No related tags found
1 merge request
!315
detailed tutorial for open data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/open_data_examples/advanced_opendata.py
+10
-11
10 additions, 11 deletions
examples/open_data_examples/advanced_opendata.py
with
10 additions
and
11 deletions
examples/open_data_examples/advanced_opendata.py
+
10
−
11
View file @
aa4a8ee9
...
...
@@ -19,11 +19,10 @@ bilby.core.utils.setup_logger(outdir=outdir, label=label)
interferometer_names
=
[
'
H1
'
,
'
L1
'
]
# can also include 'V1'
duration
=
4
# length of data segment containing the signal
roll_off
=
0.2
# smoothness of transition from no signal
# to max signal in a Tu
r
key Window.
# to max signal in a Tukey Window.
psd_offset
=
-
1024
# PSD is estimated using data from
# 'center_time + psd_offset' to 'center_time + psd_offset + psd_duration'
psd_duration
=
100
coherence_test
=
False
# coherence between detectors
filter_freq
=
None
# low pass filter frequency to cut signal content above
# Nyquist frequency. The condition is 2 * filter_freq >= sampling_frequency
...
...
@@ -46,12 +45,12 @@ interferometers = bilby.gw.detector.get_event_data(
# CHOOSE PRIOR FILE
# DEFAULT PRIOR FILES: GW150914.prior, binary_black_holes.prior,
# binary_neutron_stars.prior
, comoving.txt
# binary_neutron_stars.prior
# Needs to specify path for any other prior file.
prior
=
bilby
.
gw
.
prior
.
BBHPriorDict
(
filename
=
'
GW150914.prior
'
)
# GENERATE WAVEFORM
duration
=
None
# dura
n
tion and sampling frequency will be overwritten
duration
=
None
# duration and sampling frequency will be overwritten
# to match the ones in the interferometers.
sampling_frequency
=
kwargs
[
"
sample_rate
"
]
# same at which the data is stored
start_time
=
0
# set the starting time of the time array
...
...
@@ -66,11 +65,11 @@ source_model = bilby.gw.source.lal_binary_black_hole
waveform_generator
=
bilby
.
gw
.
WaveformGenerator
(
duration
=
duration
,
sampling_frequency
=
sampling_frequency
,
start_time
=
start_time
,
frequency_domain_source_model
=
source_model
,
frequency_domain_source_model
=
source_model
,
waveform_arguments
=
waveform_arguments
)
# CHOOSE LIKELIHOOD FUNCTION
# Time marginalisation uses FFT.
# Time marginalisation uses FFT
and can use a prior file
.
# Distance marginalisation uses a look up table calculated at run time.
# Phase marginalisation is done analytically using a Bessel function.
# If prior given, used in the distance and phase marginalization.
...
...
@@ -82,18 +81,18 @@ likelihood = bilby.gw.likelihood.GravitationalWaveTransient(
# RUN SAMPLER
# Can use log_likelihood_ratio, rather than just the log_likelihood.
# If using simulated data, pass a dictionary of injection parameters.
# A function can be specified in 'conversion_function' and
#
applied
to posterior to generate additional parameters.
# A function can be specified in 'conversion_function' and
applied
# to posterior to generate additional parameters
e.g. source-frame masses
.
# Implemented Samplers:
# LIST OF AVAILABLE SAMPLERS: Run -> bilby.sampler.implemented_samplers
npoints
=
5
12
# number of live points for the MCMC
npoints
=
5
00
# number of live points for the MCMC
sampler
=
'
dynesty
'
result
=
bilby
.
run_sampler
(
likelihood
,
prior
,
outdir
=
outdir
,
label
=
label
,
sampler
=
sampler
,
npoints
=
npoints
,
use_ratio
=
False
,
injection_parameters
=
None
,
conversion_function
=
None
,
default_priors_file
=
None
)
injection_parameters
=
None
,
conversion_function
=
bilby
.
gw
.
conversion
.
generate_all_bbh_parameters
)
result
.
plot_corner
()
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