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
b2108893
Commit
b2108893
authored
5 years ago
by
Virginia d'Emilio
Committed by
Gregory Ashton
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GW170817 in open_data_examples
parent
c08d62b8
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/prior_files/GW170817.prior
+21
-0
21 additions, 0 deletions
bilby/gw/prior_files/GW170817.prior
examples/open_data_examples/GW170817.py
+14
-12
14 additions, 12 deletions
examples/open_data_examples/GW170817.py
with
35 additions
and
12 deletions
bilby/gw/prior_files/GW170817.prior
0 → 100644
+
21
−
0
View file @
b2108893
# Example of priors for GW170817
# mass_1 = Constraint(name='mass_1', minimum=1.2, maximum=1.99)
# mass_2 = Constraint(name='mass_2', minimum=1., maximum=1.4)
chirp_mass = Uniform(name='chirp_mass', minimum=0.87, maximum=1.74, unit='$M_{\odot}$', boundary=None)
mass_ratio = Uniform(name='mass_ratio', minimum=0.125, maximum=1.0, boundary=None)
a_1 = Uniform(name='a_1', minimum=0, maximum=0.05, boundary='reflective')
a_2 = Uniform(name='a_2', minimum=0, maximum=0.05, boundary='reflective')
tilt_1 = Sine(name='tilt_1', boundary='reflective')
tilt_2 = Sine(name='tilt_2', boundary='reflective')
phi_12 = Uniform(name='phi_12', minimum=0, maximum=2 * np.pi, boundary='periodic')
phi_jl = Uniform(name='phi_jl', minimum=0, maximum=2 * np.pi, boundary='periodic')
luminosity_distance = bilby.gw.prior.UniformSourceFrame(name='luminosity_distance', minimum=10, maximum=100, unit='Mpc', boundary=None)
dec = Cosine(name='dec', boundary='reflective')
ra = Uniform(name='ra', minimum=0, maximum=2 * np.pi, boundary='periodic')
theta_jn = Sine(name='theta_jn', boundary='reflective')
psi = Uniform(name='psi', minimum=0, maximum=np.pi, boundary='periodic')
phase = Uniform(name='phase', minimum=0, maximum=2 * np.pi, boundary='periodic')
# lambda_1 = Constraint(name='lambda_1', minimum=0, maximum=5000)
# lambda_2 = Constraint(name='lambda_2', minimum=0, maximum=5000)
lambda_tilde = Uniform(name='lambda_tilde', minimum=0, maximum=1000, boundary=None)
delta_lambda_tilde = Uniform(name='delta_lambda_tilde', minimum=-5000, maximum=5000, boundary=None)
This diff is collapsed.
Click to expand it.
examples/open_data_examples/GW170817.py
+
14
−
12
View file @
b2108893
...
...
@@ -31,10 +31,10 @@ filter_freq = None # low pass filter frequency to cut signal content above
kwargs
=
{}
# Data are stored by LOSC at 4096 Hz, however
# there may be event-related data releases with a 16384 Hz rate.
kwargs
[
"
sample_rate
"
]
=
4096
kwargs
[
'
sample_rate
'
]
=
4096
# For O2 events a "tag" is required to download the data.
# CLN = clean data; C0
0 or C01
= raw data
kwargs
[
"
tag
"
]
=
'
C0
0
'
# CLN = clean data; C0
2
= raw data
kwargs
[
'
tag
'
]
=
'
C0
2
'
interferometers
=
bilby
.
gw
.
detector
.
get_event_data
(
label
,
interferometer_names
=
interferometer_names
,
...
...
@@ -46,30 +46,32 @@ interferometers = bilby.gw.detector.get_event_data(
filter_freq
=
filter_freq
,
**
kwargs
)
# CHOOSE PRIOR FILE
prior
=
bilby
.
gw
.
prior
.
BNSPriorDict
(
filename
=
'
binary_neutron_stars
.prior
'
)
prior
=
bilby
.
gw
.
prior
.
BNSPriorDict
(
filename
=
'
GW170817
.prior
'
)
deltaT
=
0.1
prior
[
"
geocent_time
"
]
=
bilby
.
core
.
prior
.
Uniform
(
prior
[
'
geocent_time
'
]
=
bilby
.
core
.
prior
.
Uniform
(
minimum
=
time_of_event
-
deltaT
/
2
,
maximum
=
time_of_event
+
deltaT
/
2
,
name
=
"
geocent_time
"
,
latex_label
=
"
$t_c$
"
,
unit
=
"
$s$
"
)
name
=
'
geocent_time
'
,
latex_label
=
'
$t_c$
'
,
unit
=
'
$s$
'
)
# GENERATE WAVEFORM
# OVERVIEW OF APPROXIMANTS:
# https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/Waveforms/Overview
duration
=
None
# duration and sampling frequency will be overwritten
# to match the ones in interferometers.
sampling_frequency
=
kwargs
[
"
sample_rate
"
]
sampling_frequency
=
kwargs
[
'
sample_rate
'
]
start_time
=
0
# set the starting time of the time array
waveform_arguments
=
{
'
waveform_approximant
'
:
'
TaylorF2
'
,
'
reference_frequency
'
:
20
}
'
waveform_approximant
'
:
'
IMRPhenomPv2_NRTidal
'
,
'
reference_frequency
'
:
20
}
source_model
=
bilby
.
gw
.
source
.
lal_binary_neutron_star
convert_bns
=
bilby
.
gw
.
conversion
.
convert_to_lal_binary_neutron_star_parameters
waveform_generator
=
bilby
.
gw
.
WaveformGenerator
(
duration
=
duration
,
sampling_frequency
=
sampling_frequency
,
start_time
=
start_time
,
frequency_domain_source_model
=
source_model
,
parameter_conversion
=
convert_bns
,
waveform_arguments
=
waveform_arguments
,)
# CHOOSE LIKELIHOOD FUNCTION
...
...
@@ -97,6 +99,6 @@ result = bilby.run_sampler(
sampler
=
sampler
,
npoints
=
npoints
,
use_ratio
=
False
,
injection
_parameters
=
None
,
conversion_function
=
None
)
conversion_function
=
bilby
.
gw
.
conversion
.
generate_all_bns
_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