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
46778b7d
Commit
46778b7d
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
change an attribute name, update docstring
parent
8b6da1c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!31
Change sampled parameters
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tupak/waveform_generator.py
+19
-9
19 additions, 9 deletions
tupak/waveform_generator.py
with
19 additions
and
9 deletions
tupak/waveform_generator.py
+
19
−
9
View file @
46778b7d
...
...
@@ -10,22 +10,32 @@ class WaveformGenerator(object):
Parameters
----------
sampling_frequency: float
The sampling frequency
to sample at
The sampling frequency
time_duration: float
Time duration of data
source_model: func
frequency_domain_
source_model: func
A python function taking some arguments and returning the frequency
domain strain. Note the first argument must be the frequencies at
which to compute the strain
Note: the arguments of source_model (except the first, which is the
time_domain_source_model: func
A python function taking some arguments and returning the time
domain strain. Note the first argument must be the times at
which to compute the strain
parameters: dict
Initial values for the parameters
parameter_conversion: func
Function to convert from sampled parameters to parameters of the waveform generator
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`.
"""
def
__init__
(
self
,
time_duration
,
sampling_frequency
,
frequency_domain_source_model
=
None
,
time_domain_source_model
=
None
,
parameters
=
None
,
parameter_conversion
=
None
):
time_domain_source_model
=
None
,
parameters
=
None
,
parameter_conversion
=
None
,
sampling_parameter_keys
=
None
):
self
.
time_duration
=
time_duration
self
.
sampling_frequency
=
sampling_frequency
self
.
frequency_domain_source_model
=
frequency_domain_source_model
...
...
@@ -33,7 +43,7 @@ class WaveformGenerator(object):
self
.
time_duration
=
time_duration
self
.
sampling_frequency
=
sampling_frequency
self
.
parameter_conversion
=
parameter_conversion
self
.
s
earch
_parameter_keys
=
[]
self
.
s
ampling
_parameter_keys
=
sampling_parameter_keys
self
.
parameters
=
parameters
self
.
__frequency_array_updated
=
False
self
.
__time_array_updated
=
False
...
...
@@ -41,7 +51,7 @@ class WaveformGenerator(object):
def
frequency_domain_strain
(
self
):
"""
Wrapper to source_model
"""
if
self
.
parameter_conversion
is
not
None
:
added_keys
=
self
.
parameter_conversion
(
self
.
parameters
,
self
.
s
earch
_parameter_keys
)
added_keys
=
self
.
parameter_conversion
(
self
.
parameters
,
self
.
s
ampling
_parameter_keys
)
if
self
.
frequency_domain_source_model
is
not
None
:
model_frequency_strain
=
self
.
frequency_domain_source_model
(
self
.
frequency_array
,
**
self
.
parameters
)
...
...
@@ -62,7 +72,7 @@ class WaveformGenerator(object):
def
time_domain_strain
(
self
):
if
self
.
parameter_conversion
is
not
None
:
added_keys
=
self
.
parameter_conversion
(
self
.
parameters
,
self
.
s
earch
_parameter_keys
)
added_keys
=
self
.
parameter_conversion
(
self
.
parameters
,
self
.
s
ampling
_parameter_keys
)
if
self
.
time_domain_source_model
is
not
None
:
model_time_series
=
self
.
time_domain_source_model
(
self
.
time_array
,
**
self
.
parameters
)
elif
self
.
frequency_domain_source_model
is
not
None
:
...
...
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