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
4cba0ca9
Commit
4cba0ca9
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
make parameters kwargs optional
parent
dda0369d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!195
Improve conversion / change internal parameter logic
Pipeline
#31259
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tupak/gw/waveform_generator.py
+18
-3
18 additions, 3 deletions
tupak/gw/waveform_generator.py
with
18 additions
and
3 deletions
tupak/gw/waveform_generator.py
+
18
−
3
View file @
4cba0ca9
...
...
@@ -83,12 +83,19 @@ class WaveformGenerator(object):
.
format
(
self
.
duration
,
self
.
sampling_frequency
,
self
.
start_time
,
fdsm_name
,
tdsm_name
,
param_conv_name
,
self
.
waveform_arguments
)
def
frequency_domain_strain
(
self
,
parameters
):
def
frequency_domain_strain
(
self
,
parameters
=
None
):
"""
Rapper to source_model.
Converts self.parameters with self.parameter_conversion before handing it off to the source model.
Automatically refers to the time_domain_source model via NFFT if no frequency_domain_source_model is given.
Parameters
----------
parameters: dict, optional
Parameters to evaluate the waveform for, this overwrites
`self.parameters`.
If not provided will fall back to `self.parameters`.
Returns
-------
array_like: The frequency domain strain for the given set of parameters
...
...
@@ -105,13 +112,20 @@ class WaveformGenerator(object):
transformed_model
=
self
.
time_domain_source_model
,
transformed_model_data_points
=
self
.
time_array
)
def
time_domain_strain
(
self
,
parameters
):
def
time_domain_strain
(
self
,
parameters
=
None
):
"""
Rapper to source_model.
Converts self.parameters with self.parameter_conversion before handing it off to the source model.
Automatically refers to the frequency_domain_source model via INFFT if no frequency_domain_source_model is
given.
Parameters
----------
parameters: dict, optional
Parameters to evaluate the waveform for, this overwrites
`self.parameters`.
If not provided will fall back to `self.parameters`.
Returns
-------
array_like: The time domain strain for the given set of parameters
...
...
@@ -130,7 +144,8 @@ class WaveformGenerator(object):
def
_calculate_strain
(
self
,
model
,
model_data_points
,
transformation_function
,
transformed_model
,
transformed_model_data_points
,
parameters
):
self
.
parameters
=
parameters
.
copy
()
if
parameters
is
not
None
:
self
.
parameters
=
parameters
.
copy
()
if
model
is
not
None
:
model_strain
=
self
.
_strain_from_model
(
model_data_points
,
model
)
elif
transformed_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