Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Sylvia Biscoveanu
bilby
Commits
31bf72b9
Commit
31bf72b9
authored
6 years ago
by
Matthew David Pitkin
Committed by
Gregory Ashton
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixes "The "create your own time domain source model" example doesn't "work""
parent
52d56233
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/injection_examples/create_your_own_time_domain_source_model.py
+11
-8
11 additions, 8 deletions
...tion_examples/create_your_own_time_domain_source_model.py
with
11 additions
and
8 deletions
examples/injection_examples/create_your_own_time_domain_source_model.py
+
11
−
8
View file @
31bf72b9
...
...
@@ -12,36 +12,39 @@ import bilby
# define the time-domain model
def
time_domain_damped_sinusoid
(
time
,
amplitude
,
damping_time
,
frequency
,
phase
):
time
,
amplitude
,
damping_time
,
frequency
,
phase
,
t0
):
"""
This example only creates a linearly polarised signal with only plus
polarisation.
"""
plus
=
amplitude
*
np
.
exp
(
-
time
/
damping_time
)
*
\
np
.
sin
(
2
*
np
.
pi
*
frequency
*
time
+
phase
)
plus
=
np
.
zeros
(
len
(
time
))
tidx
=
time
>=
t0
plus
[
tidx
]
=
amplitude
*
np
.
exp
(
-
(
time
[
tidx
]
-
t0
)
/
damping_time
)
*
\
np
.
sin
(
2
*
np
.
pi
*
frequency
*
(
time
[
tidx
]
-
t0
)
+
phase
)
cross
=
np
.
zeros
(
len
(
time
))
return
{
'
plus
'
:
plus
,
'
cross
'
:
cross
}
# define parameters to inject.
injection_parameters
=
dict
(
amplitude
=
5e-22
,
damping_time
=
0.1
,
frequency
=
50
,
phase
=
0
,
ra
=
0
,
dec
=
0
,
psi
=
0
,
geocent_time
=
0.
)
phase
=
0
,
ra
=
0
,
dec
=
0
,
psi
=
0
,
t0
=
0.
,
geocent_time
=
0.
)
duration
=
0.5
sampling_frequency
=
2048
duration
=
1.0
sampling_frequency
=
1024
outdir
=
'
outdir
'
label
=
'
time_domain_source_model
'
# call the waveform_generator to create our waveform model.
waveform
=
bilby
.
gw
.
waveform_generator
.
WaveformGenerator
(
duration
=
duration
,
sampling_frequency
=
sampling_frequency
,
time_domain_source_model
=
time_domain_damped_sinusoid
)
time_domain_source_model
=
time_domain_damped_sinusoid
,
start_time
=
injection_parameters
[
'
geocent_time
'
]
-
0.5
)
# inject the signal into three interferometers
ifos
=
bilby
.
gw
.
detector
.
InterferometerList
([
'
H1
'
,
'
L1
'
])
ifos
.
set_strain_data_from_power_spectral_densities
(
sampling_frequency
=
sampling_frequency
,
duration
=
duration
,
start_time
=
injection_parameters
[
'
geocent_time
'
]
-
3
)
start_time
=
injection_parameters
[
'
geocent_time
'
]
-
0.5
)
ifos
.
inject_signal
(
waveform_generator
=
waveform
,
parameters
=
injection_parameters
)
...
...
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