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
60d0921c
Commit
60d0921c
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
change parameterisation for injections
parent
db8c93e0
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
tupak/gw/detector.py
+18
-11
18 additions, 11 deletions
tupak/gw/detector.py
with
18 additions
and
11 deletions
tupak/gw/detector.py
+
18
−
11
View file @
60d0921c
...
...
@@ -642,9 +642,9 @@ def get_empty_interferometer(name):
def
get_interferometer_with_open_data
(
name
,
trigger_time
,
time_duration
=
4
,
epoch
=
None
,
alpha
=
0.25
,
psd_offset
=-
1024
,
psd_duration
=
100
,
cache
=
True
,
outdir
=
'
outdir
'
,
plot
=
True
,
filter_freq
=
1024
,
raw_data_file
=
None
,
**
kwargs
):
name
,
trigger_time
,
time_duration
=
4
,
epoch
=
None
,
alpha
=
0.25
,
psd_offset
=-
1024
,
psd_duration
=
100
,
cache
=
True
,
outdir
=
'
outdir
'
,
plot
=
True
,
filter_freq
=
1024
,
raw_data_file
=
None
,
**
kwargs
):
"""
Helper function to obtain an Interferometer instance with appropriate
PSD and data, given an center_time.
...
...
@@ -754,9 +754,9 @@ def get_interferometer_with_open_data(
def
get_interferometer_with_fake_noise_and_injection
(
name
,
injection_polarizations
,
injection_parameters
,
sampling_frequency
=
4096
,
time_duration
=
4
,
outdir
=
'
outdir
'
,
plot
=
Tru
e
,
save
=
True
,
zero_noise
=
False
):
name
,
injection_polarizations
,
injection_parameters
,
sampling_frequency
=
4096
,
time_duration
=
4
,
epoch
=
Non
e
,
outdir
=
'
outdir
'
,
plot
=
True
,
save
=
True
,
zero_noise
=
False
):
"""
Helper function to obtain an Interferometer instance with appropriate
power spectral density and data, given an center_time.
...
...
@@ -774,6 +774,9 @@ def get_interferometer_with_fake_noise_and_injection(
sampling frequency for data, should match injection signal
time_duration: float
length of data, should be the same as used for signal generation
epoch: float
Beginning of data segment, if None, injection is placed 2s before
end of segment.
outdir: str
directory in which to store output
plot: bool
...
...
@@ -792,17 +795,21 @@ def get_interferometer_with_fake_noise_and_injection(
utils
.
check_directory_exists_and_if_not_mkdir
(
outdir
)
if
epoch
is
None
:
epoch
=
injection_parameters
[
'
geocent_time
'
]
+
2
-
time_duration
if
injection_parameters
[
'
geocent_time
'
]
<
epoch
or
injection_parameters
[
'
geocent_time
'
]
>
epoch
-
time_duration
:
logging
.
warning
(
'
Injecting signal outside segment, epoch={}, merger time={}.
'
.
format
(
epoch
,
injection_parameters
[
'
geocent_time
'
]))
interferometer
=
get_empty_interferometer
(
name
)
if
zero_noise
:
interferometer
.
set_data
(
sampling_frequency
=
sampling_frequency
,
duration
=
time_duration
,
zero_noise
=
True
,
epoch
=
(
injection_parameters
[
'
geocent_time
'
]
+
2
)
-
time_duration
)
zero_noise
=
True
,
epoch
=
epoch
)
else
:
interferometer
.
set_data
(
sampling_frequency
=
sampling_frequency
,
duration
=
time_duration
,
from_power_spectral_density
=
True
,
epoch
=
(
injection_parameters
[
'
geocent_time
'
]
+
2
)
-
time_duration
)
from_power_spectral_density
=
True
,
epoch
=
epoch
)
interferometer
.
inject_signal
(
waveform_polarizations
=
injection_polarizations
,
parameters
=
injection_parameters
)
...
...
@@ -884,7 +891,7 @@ def get_event_data(
for
name
in
interferometer_names
:
try
:
interferometers
.
append
(
get_interferometer_with_open_data
(
name
,
event_time
,
time_duration
=
time_duration
,
alpha
=
alpha
,
name
,
trigger_time
=
event_time
,
time_duration
=
time_duration
,
alpha
=
alpha
,
psd_offset
=
psd_offset
,
psd_duration
=
psd_duration
,
cache
=
cache
,
outdir
=
outdir
,
plot
=
plot
,
filter_freq
=
filter_freq
,
raw_data_file
=
raw_data_file
,
**
kwargs
))
...
...
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