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
aae26944
There was a problem fetching the pipeline summary.
Commit
aae26944
authored
6 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Adds fixed_arguments to the wfg
parent
e8cf8c0c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!61
Adds fixed_arguments to the wfg
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/injection_examples/basic_tutorial.py
+7
-2
7 additions, 2 deletions
examples/injection_examples/basic_tutorial.py
tupak/gw/waveform_generator.py
+19
-5
19 additions, 5 deletions
tupak/gw/waveform_generator.py
with
26 additions
and
7 deletions
examples/injection_examples/basic_tutorial.py
+
7
−
2
View file @
aae26944
...
...
@@ -29,13 +29,18 @@ np.random.seed(88170235)
# spins of both black holes (a, tilt, phi), etc.
injection_parameters
=
dict
(
mass_1
=
36.
,
mass_2
=
29.
,
a_1
=
0.4
,
a_2
=
0.3
,
tilt_1
=
0.5
,
tilt_2
=
1.0
,
phi_12
=
1.7
,
phi_jl
=
0.3
,
luminosity_distance
=
2000.
,
iota
=
0.4
,
psi
=
2.659
,
phase
=
1.3
,
geocent_time
=
1126259642.413
,
waveform_approximant
=
'
IMRPhenomPv2
'
,
reference_frequency
=
50.
,
ra
=
1.375
,
dec
=-
1.2108
)
ra
=
1.375
,
dec
=-
1.2108
)
# Fixed arguments passed into the source model
fixed_arguments
=
dict
(
waveform_approximant
=
'
IMRPhenomPv2
'
,
reference_frequency
=
50.
)
# Create the waveform_generator using a LAL BinaryBlackHole source function
waveform_generator
=
tupak
.
WaveformGenerator
(
time_duration
=
time_duration
,
sampling_frequency
=
sampling_frequency
,
frequency_domain_source_model
=
tupak
.
gw
.
source
.
lal_binary_black_hole
,
parameters
=
injection_parameters
)
parameters
=
injection_parameters
,
fixed_arguments
=
fixed_arguments
)
hf_signal
=
waveform_generator
.
frequency_domain_strain
()
# Set up interferometers. In this case we'll use three interferometers (LIGO-Hanford (H1), LIGO-Livingston (L1),
...
...
This diff is collapsed.
Click to expand it.
tupak/gw/waveform_generator.py
+
19
−
5
View file @
aae26944
...
...
@@ -28,6 +28,8 @@ class WaveformGenerator(object):
waveform generator
non_standard_sampling_parameter_keys: list
List of parameter name for *non-standard* sampling parameters.
fixed_arguments: dict
A dictionary of fixed keyword arguments
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
...
...
@@ -37,7 +39,7 @@ class WaveformGenerator(object):
def
__init__
(
self
,
time_duration
,
sampling_frequency
,
frequency_domain_source_model
=
None
,
time_domain_source_model
=
None
,
parameters
=
None
,
parameter_conversion
=
None
,
non_standard_sampling_parameter_keys
=
None
):
non_standard_sampling_parameter_keys
=
None
,
fixed_arguments
=
{}
):
self
.
time_duration
=
time_duration
self
.
sampling_frequency
=
sampling_frequency
self
.
frequency_domain_source_model
=
frequency_domain_source_model
...
...
@@ -47,8 +49,11 @@ class WaveformGenerator(object):
self
.
parameter_conversion
=
parameter_conversion
self
.
non_standard_sampling_parameter_keys
=
non_standard_sampling_parameter_keys
self
.
parameters
=
parameters
self
.
fixed_arguments
=
fixed_arguments
self
.
__frequency_array_updated
=
False
self
.
__time_array_updated
=
False
self
.
__full_source_model_keyword_arguments
=
{}
self
.
__full_source_model_keyword_arguments
.
update
(
fixed_arguments
)
def
frequency_domain_strain
(
self
):
"""
Wrapper to source_model
"""
...
...
@@ -56,10 +61,15 @@ class WaveformGenerator(object):
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
)
self
.
__full_source_model_keyword_arguments
.
update
(
self
.
parameters
)
model_frequency_strain
=
self
.
frequency_domain_source_model
(
self
.
frequency_array
,
**
self
.
__full_source_model_keyword_arguments
)
elif
self
.
time_domain_source_model
is
not
None
:
model_frequency_strain
=
dict
()
time_domain_strain
=
self
.
time_domain_source_model
(
self
.
time_array
,
**
self
.
parameters
)
self
.
__full_source_model_keyword_arguments
.
update
(
self
.
parameters
)
time_domain_strain
=
self
.
time_domain_source_model
(
self
.
time_array
,
**
self
.
__full_source_model_keyword_arguments
)
if
isinstance
(
time_domain_strain
,
np
.
ndarray
):
return
utils
.
nfft
(
time_domain_strain
,
self
.
sampling_frequency
)
for
key
in
time_domain_strain
:
...
...
@@ -76,10 +86,14 @@ class WaveformGenerator(object):
if
self
.
parameter_conversion
is
not
None
:
added_keys
=
self
.
parameter_conversion
(
self
.
parameters
,
self
.
non_standard_sampling_parameter_keys
)
if
self
.
time_domain_source_model
is
not
None
:
model_time_series
=
self
.
time_domain_source_model
(
self
.
time_array
,
**
self
.
parameters
)
self
.
__full_source_model_keyword_arguments
.
update
(
self
.
parameters
)
model_time_series
=
self
.
time_domain_source_model
(
self
.
time_array
,
**
self
.
__full_source_model_keyword_arguments
)
elif
self
.
frequency_domain_source_model
is
not
None
:
model_time_series
=
dict
()
frequency_domain_strain
=
self
.
frequency_domain_source_model
(
self
.
frequency_array
,
**
self
.
parameters
)
self
.
__full_source_model_keyword_arguments
.
update
(
self
.
parameters
)
frequency_domain_strain
=
self
.
frequency_domain_source_model
(
self
.
frequency_array
,
**
self
.
__full_source_model_keyword_arguments
)
if
isinstance
(
frequency_domain_strain
,
np
.
ndarray
):
return
utils
.
infft
(
frequency_domain_strain
,
self
.
sampling_frequency
)
for
key
in
frequency_domain_strain
:
...
...
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