Skip to content
Snippets Groups Projects
Commit 7ef8da5b authored by Colm Talbot's avatar Colm Talbot
Browse files

Merge branch 'master' of git.ligo.org:Monash/tupak

parents 69516f6d 7bae4bc8
No related branches found
No related tags found
No related merge requests found
Pipeline #
MIT License
Copyright (c) 2018 Paul D. Lasky
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -180,8 +180,6 @@ class Cosine(Prior):
def __init__(self, name=None, latex_label=None):
Prior.__init__(self, name, latex_label)
self.minimum = - np.pi / 2
self.maximum = np.pi / 2
def rescale(self, val):
"""
......@@ -205,8 +203,6 @@ class Sine(Prior):
def __init__(self, name=None, latex_label=None):
Prior.__init__(self, name, latex_label)
self.minimum = 0
self.maximum = np.pi
def rescale(self, val):
"""
......
......@@ -35,10 +35,21 @@ class WaveformGenerator(object):
def frequency_domain_strain(self):
""" Wrapper to source_model """
return self.frequency_domain_source_model(self.frequency_array, **self.parameters)
if self.frequency_domain_source_model is not None:
return self.frequency_domain_source_model(self.frequency_array, **self.parameters)
elif self.time_domain_source_model is not None:
fft_data, self.frequency_array = utils.nfft(self.time_domain_source_model(self.time_array, **self.parameters), self.sampling_frequency)
return fft_data
else:
raise RuntimeError("No source model given")
def time_domain_strain(self):
return self.time_domain_source_model(self.time_array, **self.parameters)
if self.time_domain_source_model is not None:
return self.time_domain_source_model(self.time_array, **self.parameters)
elif self.frequency_domain_source_model is not None:
return utils.infft(self.frequency_domain_source_model(self.frequency_array, **self.parameters))
else:
raise RuntimeError("No source model given")
@property
def frequency_array(self):
......@@ -49,6 +60,10 @@ class WaveformGenerator(object):
self.__frequency_array_updated = True
return self.__frequency_array
@frequency_array.setter
def frequency_array(self, frequency_array):
self.__frequency_array = frequency_array
@property
def time_array(self):
if self.__time_array_updated is False:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment