Skip to content

Commit

Permalink
Added Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kkacanja committed Oct 30, 2024
1 parent 2ebd50e commit f3d2c6f
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions pycbc/waveform/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,11 @@ def generate(self, **kwargs):
return h

@staticmethod
def select_rframe_generator(approximant, dm):
def select_rframe_generator(approximant, domain):
"""Returns a radiation frame generator class based on the approximant
string.
"""
return select_waveform_generator(approximant, domain=dm)
return select_waveform_generator(approximant, domain)


class FDomainDetFrameTwoPolGenerator(BaseFDomainDetFrameGenerator):
Expand Down Expand Up @@ -845,11 +845,11 @@ def generate(self, **kwargs):
return h

@staticmethod
def select_rframe_generator(approximant, dm):
def select_rframe_generator(approximant, domain):
"""Returns a radiation frame generator class based on the approximant
string.
"""
return select_waveform_generator(approximant, domain=dm)
return select_waveform_generator(approximant, domain)

class FDomainDetFrameTwoPolNoRespGenerator(BaseFDomainDetFrameGenerator):
"""Generates frequency-domain waveform in a specific frame.
Expand Down Expand Up @@ -944,11 +944,11 @@ def generate(self, **kwargs):
return h

@staticmethod
def select_rframe_generator(approximant, dm):
def select_rframe_generator(approximant, domain):
"""Returns a radiation frame generator class based on the approximant
string.
"""
return select_waveform_generator(approximant, domain=dm)
return select_waveform_generator(approximant, domain)


class FDomainDetFrameModesGenerator(BaseFDomainDetFrameGenerator):
Expand Down Expand Up @@ -1200,7 +1200,35 @@ def generate(self, **kwargs):


def select_waveform_generator(approximant, domain=None):
"""Returns the single-IFO generator for the approximant."""
"""Returns the single-IFO generator for the approximant.
Parameters
----------
approximant : str
Name of waveform approximant. Valid names can be found using
``pycbc.waveform`` methods.
domain : str or None
Name of the preferred waveform domain
('td' for time domain, 'fd' for frequency domain, None for default)
Returns
-------
generator : (PyCBC generator instance)
A waveform generator object.
Examples
--------
Get a list of available approximants:
>>> from pycbc import waveform
>>> waveform.fd_approximants()
>>> waveform.td_approximants()
>>> from pycbc.waveform import ringdown
>>> ringdown.ringdown_fd_approximants.keys()
Get generator object:
>>> from pycbc.waveform.generator import select_waveform_generator
>>> select_waveform_generator(waveform.fd_approximants()[0])
"""

generator_map = {
'fd': {
Expand Down

0 comments on commit f3d2c6f

Please sign in to comment.