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
91dec665
There was a problem fetching the pipeline summary.
Commit
91dec665
authored
6 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Update of various docstrings
parent
3d31a6e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tupak/detector.py
+11
-10
11 additions, 10 deletions
tupak/detector.py
tupak/likelihood.py
+32
-0
32 additions, 0 deletions
tupak/likelihood.py
tupak/waveform_generator.py
+8
-6
8 additions, 6 deletions
tupak/waveform_generator.py
with
51 additions
and
16 deletions
tupak/detector.py
+
11
−
10
View file @
91dec665
...
...
@@ -398,7 +398,7 @@ class PowerSpectralDensity:
def
__init__
(
self
,
asd_file
=
None
,
psd_file
=
'
aLIGO_ZERO_DET_high_P_psd.txt
'
):
"""
Instantiate a new P
SD
object.
Instantiate a new P
owerSpectralDensity
object.
Only one of the asd_file or psd_file needs to be specified.
If multiple are given, the first will be used.
...
...
@@ -498,15 +498,16 @@ def get_empty_interferometer(name):
The available instruments are:
H1, L1, V1, GEO600
Detector positions taken from LIGO-T980044-10 for L1/H1 and from arXiv:gr-qc/0008066 [45] for V1/GEO600
Detector positions taken from LIGO-T980044-10 for L1/H1 and from
arXiv:gr-qc/0008066 [45] for V1/GEO600
Parameters
----------
name: str
Interferometer identifier.
Return
------
Return
s
------
-
interferometer: Interferometer
Interferometer instance
"""
...
...
@@ -546,7 +547,7 @@ def get_interferometer_with_open_data(
raw_data_file
=
None
,
**
kwargs
):
"""
Helper function to obtain an Interferometer instance with appropriate
PSD and data, given an center_time
PSD and data, given an center_time
.
Parameters
----------
...
...
@@ -576,6 +577,7 @@ def get_interferometer_with_open_data(
-------
interferometer: `tupak.detector.Interferometer`
An Interferometer instance with a PSD and frequency-domain strain data.
"""
utils
.
check_directory_exists_and_if_not_mkdir
(
outdir
)
...
...
@@ -647,14 +649,15 @@ def get_interferometer_with_fake_noise_and_injection(
save
=
True
):
"""
Helper function to obtain an Interferometer instance with appropriate
PSD
and data, given an center_time
power spectral density
and data, given an center_time
.
Parameters
----------
name: str
Detector name, e.g.,
'
H1
'
.
injection_polarizations: dict
polarizations of waveform to inject, output of waveform_generator.get_frequency_domain_signal
polarizations of waveform to inject, output of
`waveform_generator.get_frequency_domain_signal`
injection_parameters: dict
injection parameters, needed for sky position and timing
sampling_frequency: float
...
...
@@ -672,6 +675,7 @@ def get_interferometer_with_fake_noise_and_injection(
-------
interferometer: `tupak.detector.Interferometer`
An Interferometer instance with a PSD and frequency-domain strain data.
"""
utils
.
check_directory_exists_and_if_not_mkdir
(
outdir
)
...
...
@@ -716,9 +720,6 @@ def get_event_data(
"""
Get open data for a specified event.
We currently know about:
GW150914
Parameters
----------
event: str
...
...
This diff is collapsed.
Click to expand it.
tupak/likelihood.py
+
32
−
0
View file @
91dec665
...
...
@@ -12,6 +12,36 @@ import logging
class
GravitationalWaveTransient
(
object
):
"""
A gravitational-wave transient likelihood object
This is the usual likelihood object to use for transient gravitational
wave parameter estimation. It computes the log-likelihood in the frequency
domain assuming a colored Gaussian noise model described by a power
spectral density
Parameters
----------
interferometers: list
A list of `tupak.detector.Interferometer` instances - contains the
detector data and power spectral densities
waveform_generator: `tupak.waveform_generator.WaveformGenerator`
An object which computes the frequency-domain strain of the signal,
given some set of parameters
distance_marginalization: bool
If true, analytic distance marginalization
phase_marginalization: bool
If true, analytic phase marginalization
prior: dict
If given, used in the distance and phase marginalization.
Returns
-------
Likelihood: `tupak.likelihood.Likelihood`
A likehood object, able to compute the likelihood of the data given
some model parameters
"""
def
__init__
(
self
,
interferometers
,
waveform_generator
,
distance_marginalization
=
False
,
phase_marginalization
=
False
,
prior
=
None
):
# GravitationalWaveTransient.__init__(self, interferometers, waveform_generator)
...
...
@@ -148,7 +178,9 @@ def get_binary_black_hole_likelihood(interferometers):
A list of `tupak.detector.Interferometer` instances, typically the
output of either `tupak.detector.get_interferometer_with_open_data`
or `tupak.detector.get_interferometer_with_fake_noise_and_injection`
Returns
-------
likelihood: tupak.likelihood.GravitationalWaveTransient
The likelihood to pass to `run_sampler`
"""
...
...
This diff is collapsed.
Click to expand it.
tupak/waveform_generator.py
+
8
−
6
View file @
91dec665
import
inspect
import
tupak
from
.
import
utils
import
numpy
as
np
class
WaveformGenerator
(
object
):
"""
A waveform generator
...
...
@@ -24,13 +24,15 @@ class WaveformGenerator(object):
parameters: dict
Initial values for the parameters
parameter_conversion: func
Function to convert from sampled parameters to parameters of the waveform generator
Function to convert from sampled parameters to parameters of the
waveform generator
non_standard_sampling_parameter_keys: list
List of parameter name for *non-standard* sampling parameters.
Note: the arguments of frequency_domain_source_model (except the first, which is the
frequencies at which to compute the strain) will be added to the
WaveformGenerator object and initialised to `None`.
Note: the arguments of frequency_domain_source_model (except the first,
which is the frequencies at which to compute the strain) will be added to
the WaveformGenerator object and initialised to `None`.
"""
def
__init__
(
self
,
time_duration
,
sampling_frequency
,
frequency_domain_source_model
=
None
,
...
...
@@ -52,7 +54,7 @@ class WaveformGenerator(object):
"""
Wrapper to source_model
"""
if
self
.
parameter_conversion
is
not
None
:
added_keys
=
self
.
parameter_conversion
(
self
.
parameters
,
self
.
non_standard_sampling_parameter_keys
)
if
self
.
frequency_domain_source_model
is
not
None
:
model_frequency_strain
=
self
.
frequency_domain_source_model
(
self
.
frequency_array
,
**
self
.
parameters
)
elif
self
.
time_domain_source_model
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
Gregory Ashton
@gregory.ashton
mentioned in issue
#67 (closed)
·
6 years ago
mentioned in issue
#67 (closed)
mentioned in issue #67
Toggle commit list
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