Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
bilby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
12
Merge Requests
12
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
bilby
Commits
46778b7d
Commit
46778b7d
authored
May 17, 2018
by
Colm Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change an attribute name, update docstring
parent
8b6da1c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
tupak/waveform_generator.py
tupak/waveform_generator.py
+19
-9
No files found.
tupak/waveform_generator.py
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment