Allows for any transform to be defined.

    Parameters
    ----------
    input_args : (list of) str
        The names of the input parameters.
    output_args : (list of) str
        The names of the output parameters.
    transform_functions : dict
        Dictionary mapping input args to a string giving a function call;
        e.g., ``{'q': 'q_from_mass1_mass2(mass1, mass2)'}``.
    jacobian : str, optional
        String giving a jacobian function. The function must be in terms of
        the input arguments.

    Examples
    --------
    Create a custom transform that converts mass1, mass2 to mtotal, q:

    >>> t = transforms.CustomTransform(['mass1', 'mass2'], ['mtotal', 'q'], {'mtotal': 'mass1+mass2', 'q': 'mass1/mass2'}, '(mass1 + mass2) / mass2**2')

    Evaluate a pair of masses:

    >>> t.transform({'mass1': 10., 'mass2': 5.})
    {'mass1': 10.0, 'mass2': 5.0, 'mtotal': 15.0, 'q': 2.0}

    The Jacobian for the same pair of masses:

    >>> t.jacobian({'mass1': 10., 'mass2': 5.})
    0.59999999999999998


Allows for any transform to be defined. Based on CustomTransform,
    but also supports multi-returning value functions.

    Parameters
    ----------
    input_args : (list of) str
        The names of the input parameters.
    output_args : (list of) str
        The names of the output parameters.
    transform_functions : dict
        Dictionary mapping input args to a string giving a function call;
        e.g., ``{'q': 'q_from_mass1_mass2(mass1, mass2)'}``.
    jacobian : str, optional
        String giving a jacobian function. The function must be in terms of
        the input arguments.


Converts chirp mass and mass ratio to component masses.


Converts chirp mass and symmetric mass ratio to component masses.


Converts chirp distance to luminosity distance, given the chirp mass.


Converts angles from total angular momentum J frame to orbital angular
     momentum L (waveform) frame


Converts spherical coordinates to cartesian.

    Parameters
    ----------
    x : str
        The name of the x parameter.
    y : str
        The name of the y parameter.
    z : str
        The name of the z parameter.
    radial : str
        The name of the radial parameter.
    azimuthal : str
        The name of the azimuthal angle parameter.
    polar : str
        The name of the polar angle parameter.


Converts spherical spin parameters (radial and two angles) to
    catesian spin parameters. This class only transforms spins for the first
    component mass.

    **Deprecation Warning:** This will be removed in a future update. Use
    :py:class:`SphericalToCartesian` with spin-parameter names passed in
    instead.


Converts distance to redshift.


Converts mass-weighted spins to cartesian z-axis spins.


Converts mass-weighted spins to cartesian x-y plane spins.


Converts cartesian spins to `chi_p`.


Transforms mass values corresponding to Lambda values for a given EOS
    interpolating from the mass-Lambda data for that EOS read in from an
    external ASCII file.

    The interpolation of the mass-Lambda data is a one-dimensional piecewise
    linear interpolation. If the ``redshift_mass`` keyword argument is ``True``
    (the default), the mass values to be transformed are assumed to be detector
    frame masses. In that case, a distance should be provided along with the
    mass for transformation to the source frame mass before the Lambda values
    are extracted from the interpolation. If the transform is read in from a
    config file, an example code block would be:

    .. code-block:: ini

        [{section}-lambda1]
        name = lambda_from_tov_file
        mass_param = mass1
        lambda_param = lambda1
        distance = 40
        mass_lambda_file = {filepath}

    If this transform is used in a parameter estimation analysis where
    distance is a variable parameter, the distance to be used will vary
    with each draw. In that case, the example code block will be:

    .. code-block:: ini

        [{section}-lambda1]
        name = lambda_from_tov_file
        mass_param = mass1
        lambda_param = lambda1
        mass_lambda_file = filepath

    If your prior is in terms of the source-frame masses (``srcmass``), then
    you can shut off the redshifting by adding ``do-not-redshift-mass`` to the
    config file. In this case you do not need to worry about a distance.
    Example:

    .. code-block:: ini

        [{section}-lambda1]
        name = lambda_from_tov_file
        mass_param = srcmass1
        lambda_param = lambda1
        mass_lambda_file = filepath
        do-not-redshift-mass =

    Parameters
    ----------
    mass_param : str
        The name of the mass parameter to transform.
    lambda_param : str
        The name of the tidal deformability parameter that mass_param is to
        be converted to interpolating from the data in the mass-Lambda file.
    mass_lambda_file : str
        Path of the mass-Lambda data file. The first column in the data file
        should contain mass values, and the second column Lambda values.
    distance : float, optional
        The distance (in Mpc) of the source. Used to redshift the mass. Needed
        if ``redshift_mass`` is True and no distance parameter exists If
        None, then a distance must be provided to the transform.
    redshift_mass : bool, optional
        Redshift the mass parameters when computing the lambdas. Default is
        False.
    file_columns : list of str, optional
        The names and order of columns in the ``mass_lambda_file``. Must
        contain at least 'mass' and 'lambda'. If not provided, will assume the
        order is ('mass', 'lambda').


Uses multiple equation of states.

    Parameters
    ----------
    mass_param : str
        The name of the mass parameter to transform.
    lambda_param : str
        The name of the tidal deformability parameter that mass_param is to
        be converted to interpolating from the data in the mass-Lambda file.
    mass_lambda_file : str
        Path of the mass-Lambda data file. The first column in the data file
        should contain mass values, and the second column Lambda values.
    distance : float, optional
        The distance (in Mpc) of the source. Used to redshift the mass. If
        None, then a distance must be provided to the transform.
    file_columns : list of str, optional
        The names and order of columns in the ``mass_lambda_file``. Must
        contain at least 'mass' and 'lambda'. If not provided, will assume the
        order is ('radius', 'mass', 'lambda').


Converts arrival time, sky localization, and polarization angle in the
    geocentric frame to the corresponding values in the SSB frame.


Converts arrival time, sky localization, and polarization angle in the
    LISA frame to the corresponding values in the SSB frame.


Converts arrival time, sky localization, and polarization angle in the
    LISA frame to the corresponding values in the geocentric frame.


Applies a log transform from an `inputvar` parameter to an `outputvar`
    parameter. This is the inverse of the exponent transform.

    Parameters
    ----------
    inputvar : str
        The name of the parameter to transform.
    outputvar : str
        The name of the transformed parameter.


Applies a logit transform from an `inputvar` parameter to an `outputvar`
    parameter. This is the inverse of the logistic transform.

    Typically, the input of the logit function is assumed to have domain
    :math:`\in (0, 1)`. However, the `domain` argument can be used to expand
    this to any finite real interval.

    Parameters
    ----------
    inputvar : str
        The name of the parameter to transform.
    outputvar : str
        The name of the transformed parameter.
    domain : tuple or distributions.bounds.Bounds, optional
        The domain of the input parameter. Can be any finite
        interval. Default is (0., 1.).


The inverse of MchirpQToMass1Mass2.


The inverse of MchirpEtaToMass1Mass2.


The inverse of ChirpDistanceToDistance.


The inverse of SphericalSpin1ToCartesianSpin1.

    **Deprecation Warning:** This will be removed in a future update. Use
    :py:class:`CartesianToSpherical` with spin-parameter names passed in
    instead.


The inverse of SphericalSpin2ToCartesianSpin2.

    **Deprecation Warning:** This will be removed in a future update. Use
    :py:class:`CartesianToSpherical` with spin-parameter names passed in
    instead.


The inverse of AlignedMassSpinToCartesianSpin.


The inverse of PrecessionMassSpinToCartesianSpin.


The inverse of `CartesianSpinToChiP`.


The inverse of GEOToSSB.


The inverse of LISAToSSB.


The inverse of LISAToGEO.


Applies an exponent transform to an `inputvar` parameter.

    This is the inverse of the log transform.

    Parameters
    ----------
    inputvar : str
        The name of the parameter to transform.
    outputvar : str
        The name of the transformed parameter.


Applies a logistic transform from an `input` parameter to an `output`
    parameter. This is the inverse of the logit transform.

    Typically, the output of the logistic function has range :math:`\in [0,1)`.
    However, the `codomain` argument can be used to expand this to any
    finite real interval.

    Parameters
    ----------
    inputvar : str
        The name of the parameter to transform.
    outputvar : str
        The name of the transformed parameter.
    frange : tuple or distributions.bounds.Bounds, optional
        The range of the output parameter. Can be any finite
        interval. Default is (0., 1.).


Adds methods to float for boundary comparisons.


Sets larger and smaller functions to be `>` and `<`, respectively.


Sets larger and smaller functions to be `>=` and `<=`, respectively.


Inherits from `ClosedBound`, adding reflection functions.


Creates and stores bounds using the given values.

    The type of boundaries used can be set using the `btype_(min|max)`
    parameters. These arguments set what kind of boundary is used at the
    minimum and maximum bounds. Specifically, if `btype_min` (`btype_max`) is
    set to:

     * "open": the minimum (maximum) boundary will be an instance of
       `OpenBound`. This means that a value must be `>` (`<`) the bound
       for it to be considered within the bounds.
     * "closed": the minimum (maximum) boundary will be an instance of
       `ClosedBound`. This means that a value must be `>=` (`<=`) the bound
       for it to be considered within the bounds.
     * "reflected": the minimum (maximum) boundary will be an isntance of
       `ReflectedBound`. This means that a value will be reflected to the
       right (left) if `apply_conditions` is used on the value. For more
       details see `apply_conditions`.

    If the `cyclic` keyword is set to True, then `apply_conditions` will cause
    values to be wrapped around to the minimum (maximum) bound if the value
    is > (<=) the maximum (minimum) bound. For more details see
    `apply_conditions`.

    Values can be checked whether or not they occur within the bounds using
    `in`; e.g., `6 in bounds`. This is done without applying any boundary
    conditions. To apply conditions, then check whether the value is in
    bounds, use the `contains_conditioned` method.

    The default is for the minimum bound to be "closed" and the maximum bound
    to be "open", i.e., a right-open interval.

    Parameters
    ----------
    min_bound : {-numpy.inf, float}
        The value of the lower bound. Default is `-inf`.
    max_bound : {numpy.inf, float}
        The value of the upper bound. Default is `inf`.
    btype_min : {'closed', string}
        The type of the lower bound; options are "closed", "open", or
        "reflected". Default is "closed".
    btype_min : {'open', string}
        The type of the lower bound; options are "closed", "open", or
        "reflected". Default is "open".
    cyclic : {False, bool}
        Whether or not to make the bounds cyclic; default is False. If True,
        both the minimum and maximum bounds must be finite.

    Examples
    --------
    Create a right-open interval between -1 and 1 and test whether various
    values are within them:
    >>> bounds = Bounds(-1., 1.)
    >>> -1 in bounds
    True
    >>> 0 in bounds
    True
    >>> 1 in bounds
    False

    Create an open interval between -1 and 1 and test the same values:
    >>> bounds = Bounds(-1, 1, btype_min="open")
    >>> -1 in bounds
    False
    >>> 0 in bounds
    True
    >>> 1 in bounds
    False

    Create cyclic bounds between -1 and 1 and plot the effect of conditioning
    on points between -10 and 10:
    >>> bounds = Bounds(-1, 1, cyclic=True)
    >>> x = numpy.linspace(-10, 10, num=1000)
    >>> conditioned_x = bounds.apply_conditions(x)
    >>> fig = pyplot.figure()
    >>> ax = fig.add_subplot(111)
    >>> ax.plot(x, x, c='b', lw=2, label='input')
    >>> ax.plot(conditioned_x, x, c='r', lw=1)
    >>> ax.vlines([-1., 1.], x.min(), x.max(), color='k', linestyle='--')
    >>> ax.set_title('cyclic bounds between x=-1,1')
    >>> fig.show()

    Create a reflected bound at -1 and plot the effect of conditioning:
    >>> bounds = Bounds(-1, 1, btype_min='reflected')
    >>> x = numpy.linspace(-10, 10, num=1000)
    >>> conditioned_x = bounds.apply_conditions(x)
    >>> fig = pyplot.figure()
    >>> ax = fig.add_subplot(111)
    >>> ax.plot(x, x, c='b', lw=2, label='input')
    >>> ax.plot(conditioned_x, x, c='r', lw=1)
    >>> ax.vlines([-1., 1.], x.min(), x.max(), color='k', linestyle='--')
    >>> ax.set_title('reflected right at x=-1')
    >>> fig.show()

    Create a reflected bound at 1 and plot the effect of conditioning:
    >>> bounds = Bounds(-1, 1, btype_max='reflected')
    >>> x = numpy.linspace(-10, 10, num=1000)
    >>> conditioned_x = bounds.apply_conditions(x)
    >>> fig = pyplot.figure()
    >>> ax = fig.add_subplot(111)
    >>> ax.plot(x, x, c='b', lw=2, label='input')
    >>> ax.plot(conditioned_x, x, c='r', lw=1)
    >>> ax.vlines([-1., 1.], x.min(), x.max(), color='k', linestyle='--')
    >>> ax.set_title('reflected left at x=1')
    >>> fig.show()

    Create reflected bounds at -1 and 1 and plot the effect of conditioning:
    >>> bounds = Bounds(-1, 1, btype_min='reflected', btype_max='reflected')
    >>> x = numpy.linspace(-10, 10, num=1000)
    >>> conditioned_x = bounds.apply_conditions(x)
    >>> fig = pyplot.figure()
    >>> ax = fig.add_subplot(111)
    >>> ax.plot(x, x, c='b', lw=2, label='input')
    >>> ax.plot(conditioned_x, x, c='r', lw=1)
    >>> ax.vlines([-1., 1.], x.min(), x.max(), color='k', linestyle='--')
    >>> ax.set_title('reflected betewen x=-1,1')
    >>> fig.show()


Multiprocessing pool with a broadcast method


Fixed sized dict for FIFO caching


Context that sets PyCBC objects to use CPU processing.


Context that sets PyCBC objects to use a CUDA processing scheme.


Scheme for using CUPY.

    Supports using CUPY with MPI. If MPI is enabled, will use all available
    devices. The environment variable `CUDA_VISIBLE_DEVICES` can be used to
    restrict the devices used.

    Parameters
    ----------
    device_num : int, optional
        The device number to use. If not provided, will use the default, 0.
        Should not be provided when using MPI to parallelize across devices.


 This class represents a dictionary whose purpose is to chose objects
    based on their processing scheme. The keys are intended to be processing
    schemes.


Subclass of argparse._StoreAction that prints version information for
    PyCBC, and for LAL and LALSimulation depending on an integer variable.
    Can be supplied without the option


r"""Interpolates luminosity distance as a function of redshift to allow for
    fast conversion.

    The :mod:`astropy.cosmology` module provides methods for converting any
    cosmological parameter (like luminosity distance) to redshift. This can be
    very slow when operating on a large array, as it involves numerically
    inverting :math:`z(D)` (where :math:`D` is the luminosity distance). This
    class speeds that up by pre-interpolating :math:`D(z)`. It works by setting
    up a dense grid of redshifts, then using linear interpolation to find the
    inverse function.  The interpolation uses a grid linear in z for z < 1, and
    log in z for ``default_maxz`` > z > 1. This interpolater is setup the first
    time `get_redshift` is called.  If a distance is requested that results in
    a z > ``default_maxz``, the class falls back to calling astropy directly.

    Instances of this class can be called like a function on luminosity
    distances, which will return the corresponding redshifts.

    Parameters
    ----------
    default_maxz : float, optional
        The maximum z to interpolate up to before falling back to calling
        astropy directly. Default is 1000.
    numpoints : int, optional
        The number of points to use in the linear interpolation between 0 to 1
        and 1 to ``default_maxz``. Default is 10000.
    \**kwargs :
        All other keyword args are passed to :py:func:`get_cosmology` to
        select a cosmology. If none provided, will use
        :py:attr:`DEFAULT_COSMOLOGY`.


r"""Interpolates comoving volume to distance or redshift.

    The :mod:`astropy.cosmology` module provides methods for converting any
    cosmological parameter (like luminosity distance) to redshift. This can be
    very slow when operating on a large array, as it involves numerically
    inverting :math:`z(D)` (where :math:`D` is the luminosity distance). This
    class speeds that up by pre-interpolating :math:`D(z)`. It works by setting
    up a dense grid of redshifts, then using linear interpolation to find the
    inverse function.  The interpolation uses a grid linear in z for z < 1, and
    log in z for ``default_maxz`` > z > 1. This interpolater is setup the first
    time `get_redshift` is called.  If a distance is requested that results in
    a z > ``default_maxz``, the class falls back to calling astropy directly.

    Instances of this class can be called like a function on luminosity
    distances, which will return the corresponding redshifts.

    Parameters
    ----------
    parameter : {'luminosity_distance', 'redshift'}
        What parameter to interpolate.
    default_maxz : float, optional
        The maximum z to interpolate up to before falling back to calling
        astropy directly. Default is 10.
    numpoints : int, optional
    The number of points to use in the linear interpolation between 0 to 1
        and 1 to ``default_maxz``. Default is 1000.
    vol_func: function, optional
        Optionally set how the volume is calculated by providing a function
    \**kwargs :
        All other keyword args are passed to :py:func:`get_cosmology` to
        select a cosmology. If none provided, will use
        :py:attr:`DEFAULT_COSMOLOGY`.


    Parent class for 1-dimensional binnings.

    Not intended to be used directly, but to be subclassed for use in real
    bins classes.


    Bins with arbitrary, irregular spacing.  We only require strict
    monotonicity of the bin boundaries.  N boundaries define N-1 bins.

    Example:

    >>> x = IrregularBins([0.0, 11.0, 15.0, numpy.inf])
    >>> len(x)
    3
    >>> x[1]
    0
    >>> x[1.5]
    0
    >>> x[13]
    1
    >>> x[25]
    2
    >>> x[4:17]
    slice(0, 3, None)
    >>> IrregularBins([0.0, 15.0, 11.0])
    Traceback (most recent call last):
        ...
    ValueError: non-monotonic boundaries provided
    >>> y = IrregularBins([0.0, 11.0, 15.0, numpy.inf])
    >>> x == y
    True


    Linearly-spaced bins.  There are n bins of equal size, the first
    bin starts on the lower bound and the last bin ends on the upper
    bound inclusively.

    Example:

    >>> x = LinearBins(1.0, 25.0, 3)
    >>> x.lower()
    array([  1.,   9.,  17.])
    >>> x.upper()
    array([  9.,  17.,  25.])
    >>> x.centres()
    array([  5.,  13.,  21.])
    >>> x[1]
    0
    >>> x[1.5]
    0
    >>> x[10]
    1
    >>> x[25]
    2
    >>> x[0:27]
    Traceback (most recent call last):
        ...
    IndexError: 0
    >>> x[1:25]
    slice(0, 3, None)
    >>> x[:25]
    slice(0, 3, None)
    >>> x[10:16.9]
    slice(1, 2, None)
    >>> x[10:17]
    slice(1, 3, None)
    >>> x[10:]
    slice(1, 3, None)


    Linearly-spaced bins with overflow at the edges.

    There are n-2 bins of equal size.  The bin 1 starts on the lower bound and
    bin n-2 ends on the upper bound.  Bins 0 and n-1 are overflow going from
    -infinity to the lower bound and from the upper bound to +infinity
    respectively.  Must have n >= 3.

    Example:

    >>> x = LinearPlusOverflowBins(1.0, 25.0, 5)
    >>> x.centres()
    array([-inf,   5.,  13.,  21.,  inf])
    >>> x.lower()
    array([-inf,   1.,   9.,  17.,  25.])
    >>> x.upper()
    array([  1.,   9.,  17.,  25.,  inf])
    >>> x[float("-inf")]
    0
    >>> x[0]
    0
    >>> x[1]
    1
    >>> x[10]
    2
    >>> x[24.99999999]
    3
    >>> x[25]
    4
    >>> x[100]
    4
    >>> x[float("+inf")]
    4
    >>> x[float("-inf"):9]
    slice(0, 3, None)
    >>> x[9:float("+inf")]
    slice(2, 5, None)


    Logarithmically-spaced bins.

    There are n bins, each of whose upper and lower bounds differ by the same
    factor.  The first bin starts on the lower bound, and the last bin ends on
    the upper bound inclusively.

    Example:

    >>> x = LogarithmicBins(1.0, 25.0, 3)
    >>> x[1]
    0
    >>> x[5]
    1
    >>> x[25]
    2


    Logarithmically-spaced bins plus one bin at each end that goes to
    zero and positive infinity respectively.  There are n-2 bins each
    of whose upper and lower bounds differ by the same factor.  Bin 1
    starts on the lower bound, and bin n-2 ends on the upper bound
    inclusively.  Bins 0 and n-1 are overflow bins extending from 0 to
    the lower bound and from the upper bound to +infinity respectively.
    Must have n >= 3.

    Example:

    >>> x = LogarithmicPlusOverflowBins(1.0, 25.0, 5)
    >>> x[0]
    0
    >>> x[1]
    1
    >>> x[5]
    2
    >>> x[24.999]
    3
    >>> x[25]
    4
    >>> x[100]
    4
    >>> x.lower()
    array([ 0.   ,  1.        ,  2.92401774,  8.54987973, 25.      ])
    >>> x.upper()
    array([ 1.   ,  2.92401774,  8.54987973, 25.        ,       inf])
    >>> x.centres()
    array([ 0.   ,  1.70997595,  5.        , 14.62008869,       inf])


    Multi-dimensional co-ordinate binning.  An instance of this object
    is used to convert a tuple of co-ordinates into a tuple of bin
    indices.  This can be used to allow the contents of an array object
    to be accessed with real-valued coordinates.

    NDBins is a subclass of the tuple builtin, and is initialized with
    an iterable of instances of subclasses of Bins.  Each Bins subclass
    instance describes the binning to apply in the corresponding
    co-ordinate direction, and the number of them sets the dimensions
    of the binning.

    Example:

    >>> x = NDBins((LinearBins(1, 25, 3), LogarithmicBins(1, 25, 3)))
    >>> x[1, 1]
    (0, 0)
    >>> x[1.5, 1]
    (0, 0)
    >>> x[10, 1]
    (1, 0)
    >>> x[1, 5]
    (0, 1)
    >>> x[1, 1:5]
    (0, slice(0, 2, None))
    >>> x.centres()
    (array([ 5., 13., 21.]), array([ 1.70997595,  5.        , 14.62008869]))

    Note that the co-ordinates to be converted must be a tuple, even if
    it is only a 1-dimensional co-ordinate.


    A convenience wrapper, using the NDBins class to provide access to
    the elements of an array object.  Technical reasons preclude
    providing a subclass of the array object, so the array data is made
    available as the "array" attribute of this class.

    Examples:

    Note that even for 1 dimensional arrays the index must be a tuple.

    >>> x = BinnedArray(NDBins((LinearBins(0, 10, 5),)))
    >>> x.array
    array([ 0.,  0.,  0.,  0.,  0.])
    >>> x[0,] += 1
    >>> x[0.5,] += 1
    >>> x.array
    array([ 2.,  0.,  0.,  0.,  0.])
    >>> x.argmax()
    (1.0,)

    Note the relationship between the binning limits, the bin centres,
    and the co-ordinates of the BinnedArray

    >>> x = BinnedArray(NDBins((LinearBins(-0.5, 1.5, 2), \
    LinearBins(-0.5, 1.5, 2))))
    >>> x.bins.centres()
    (array([ 0.,  1.]), array([ 0.,  1.]))
    >>> x[0, 0] = 0
    >>> x[0, 1] = 1
    >>> x[1, 0] = 2
    >>> x[1, 1] = 4
    >>> x.array
    array([[ 0.,  1.],
           [ 2.,  4.]])
    >>> x[0, 0]
    0.0
    >>> x[0, 1]
    1.0
    >>> x[1, 0]
    2.0
    >>> x[1, 1]
    4.0
    >>> x.argmin()
    (0.0, 0.0)
    >>> x.argmax()
    (1.0, 1.0)


    Like BinnedArray, but provides a numerator array and a denominator
    array.  The incnumerator() method increments a bin in the numerator
    by the given weight, and the incdenominator() method increments a
    bin in the denominator by the given weight.  There are no methods
    provided for setting or decrementing either, but the they are
    accessible as the numerator and denominator attributes, which are
    both BinnedArray objects.


Class for holding parameters for using injection/template pre-filtering.

    This class is responsible for identifying where a matched-filter operation
    between templates and data is unncessary because the injections contained
    in the data will not match well with the given template.


Manages sets of injections: reads injections from LIGOLW XML files
    and injects them into time series.

    Parameters
    ----------
    sim_file : string
        Path to a LIGOLW XML file containing a SimInspiralTable
        with injection definitions.

    Attributes
    ----------
    indoc
    table


Manages sets of injections: reads injections from hdf files
    and injects them into time series.

    Parameters
    ----------
    sim_file : string
        Path to an hdf file containing injections.
    \**kwds :
        The rest of the keyword arguments are passed to the waveform generation
        function when generating injections.

    Attributes
    ----------
    table
    static_args
    extra_args
    required_params : tuple
        Parameter names that must exist in the injection HDF file in order to
        create an injection of that type.


Manages CBC injections.


Manages a ringdown injection: reads injection from hdf file
    and injects it into time series.


Manages injecting an arbitrary time series loaded from a file.

    The injections must have the following attributes set:

    * ``filename``: (str) the name of the file to load containing the time
      series. The file type and format can be a frame file or anything
      understood by :py:func:`pycbc.types.timeseries.load_timeseries`. If a
      frame file (ends in ``.gwf``) is specified, a ``channel`` attribute must
      also be set.

    * ``DETECTOR_gps_time``: (float) The GPS time at which the time series
      should be added to the ``DETECTOR`` data, where ``DETECTOR`` is the name
      of the instrument to inject into (e.g., ``h1_gps_time``). **The time
      series will only be injected into a detector if a GPS time is given for
      that detector.** Set to -inf, nan, or do not provide a GPS time for a
      particular detector if you do not want to inject into that detector.

    * ``ref_point``: (str or float) What to use as the reference time of the
      injected time series. The time series will be injected into the detector
      such that the ``ref_point`` in the time series occurs at the specifed
      ``DETECTOR_gps_time``. Options are: ``'start'``, ``'end'``, ``'center'``,
      ``'absmax'``, or a float giving the number of seconds into the time
      series.

    In addition, the following attributes may optionally be provided:

    * ``channel``: (str): If the filename points to a frame file, the channel
      to load in that file. Must be provided for frame files.

    * ``DETECTOR_phase_shift``: (float) Apply a phase shift to the time series
      before adding it to detector ``DETECTOR``.

    * ``DETECTOR_amp_scale``: (float) Scale the amplitude by the given amount
      before adding it to detector ``DETECTOR``.

    * ``slice_start``: (float) Slice the time series starting at
      ``ref_point + slice_start`` before injecting into the data. Measured in
      seconds.

    * ``slice_end``: (float) Slice the time series ending at
      ``ref_point + slice_end`` before injecting into the data. Measured in
      seconds.

    * ``left_taper_width``: (float) Taper the start of the time series (after
      slicing) using half a kaiser window over the given number of seconds.
      See `:py:func:waveform.utils.td_taper` for more details.

    * ``right_taper_width``: (float) Taper the end of the time series (after
      slicing) using half a kaiser window over the given number of seconds.
      See `:py:func:waveform.utils.td_taper` for more details.

    The signal will be resampled to the same sample rate as the data it is
    being injected into.

    In order to use with ``pycbc_create_injections``, set the ``approximant``
    name to ``'incoherent_from_file'``.


Manages sets of injections and injects them into time series.

    Injections are read from either LIGOLW XML files or HDF files.

    Parameters
    ----------
    sim_file : string
        Path to an hdf file or a LIGOLW XML file that contains a
        SimInspiralTable.
    \**kwds :
        The rest of the keyword arguments are passed to the waveform generation
        function when generating injections.

    Attributes
    ----------
    table


Manages sets of sine-Gaussian burst injections: reads injections
    from LIGOLW XML files and injects them into time series.

    Parameters
    ----------
    sim_file : string
        Path to a LIGOLW XML file containing a SimBurstTable
        with injection definitions.

    Attributes
    ----------
    indoc
    table


    This class manages a pycbc workflow. It provides convenience
    functions for finding input files using time and keywords. It can also
    generate cache files from the inputs.


    This class holds the details of an individual output file
    This file(s) may be pre-supplied, generated from within the workflow
    command line script, or generated within the workflow. The important stuff
    is:

    * The ifo that the File is valid for
    * The time span that the OutFile is valid for
    * A short description of what the file is
    * The extension that the file should have
    * The url where the file should be located

    An example of initiating this class:

    >> c = File("H1", "INSPIRAL_S6LOWMASS", segments.segment(815901601, 815902001), file_url="file://localhost/home/spxiwh/H1-INSPIRAL_S6LOWMASS-815901601-400.xml.gz" )

    another where the file url is generated from the inputs:

    >> c = File("H1", "INSPIRAL_S6LOWMASS", segments.segment(815901601, 815902001), directory="/home/spxiwh", extension="xml.gz" )


    This class holds a list of File objects. It inherits from the
    built-in list class, but also allows a number of features. ONLY
    pycbc.workflow.File instances should be within a FileList instance.


    This class inherits from the File class, and is designed to store
    workflow output files containing a segment dict. This is identical in
    usage to File except for an additional kwarg for holding the
    segment dictionary, if it is known at workflow run time.


    This exception is raised when subprocess.call returns a non-zero exit code
    and checking has been requested. This should not be accessed by the user
    it is used only within make_external_call.


Converts xml tmpltbank to hdf format


Converts xml triggers to hdf format, grouped by template hash


Calculates values that describe the background distribution template by template


Smooths the background distribution parameters over a continuous parameter


Find coinc triggers using a folded interval method


Calculate single-detector ranking statistic for triggers


Calculate FAP, IFAR, etc for coincs


Calculate FAP, IFAR, etc for singles


Calculate FAP, IFAR, etc for coincs for injections


Calculate FAP, IFAR, etc for singles for injections


Find injections in the hdf files output


Distribute coinc files among different background bins


Combine coincs over different bins and apply trials factor


Combine statmap files and add FARs over different coinc types


 Remove times of zerolag coincidences of all types from exclusive
        background


Compute optimal SNR for injections


Merge HDF injection files executable class


    This is a sub-class of InterpolatingConfigParser, which lets
    us add a few additional helper features that are useful in workflows.


 Container of common methods for setting pegasus profile information
    on Executables and nodes. This class expects to be inherited from
    and for a add_profile method to be implemented.


The workflow representation of an Executable


Workflow job representation of a SubWorkflow.

    This follows the Pegasus nomenclature where there are Workflows, Jobs and
    SubWorkflows. Be careful though! A SubWorkflow is actually a Job, not a
    Workflow. If creating a sub-workflow you would create a Workflow as normal
    and write out the necessary dax files. Then you would create a SubWorkflow
    object, which acts as the Job in the top-level workflow. Most of the
    special linkages that are needed for sub-workflows are then handled at that
    stage. We do add a little bit of functionality here.


 The workflow representation of a physical file

    An object that represents a file from the perspective of setting up a
    workflow. The file may or may not exist at the time of workflow generation.
    If it does, this is represented by containing a physical file name (PFN).
    A storage path is also available to indicate the desired final
    destination of this file.


 This class is used when running sngl_ifo_job_setup to determine what times
    should be analysed be each job and what data is needed.


The class used to create jobs for pycbc_inspiral Executable.


    The class responsible for setting up jobs for the
    pycbc_multi_inspiral executable.


 The class used to create jobs for pycbc_geom_nonspin_bank Executable and
    any other Executables using the same command line option groups.


The class used to create nodes for the ligolw_add Executable.


The class responsible for running the pycbc_split_inspinj executable


The class used to create jobs for the lalapps_inspinj Executable.


The class responsible for creating jobs for pycbc_hdf5_splitbank.


The class responsible for creating jobs for pycbc_condition_strain.


 The class responsible for creating jobs
    for ``pycbc_create_injections``.


The class responsible for creating jobs for ``pycbc_inference``.


The class responsible for creating jobs for ``pycbc_hdf_splitinj``.


 The class responsible for creating jobs
    for ''pycbc_grb_trig_combiner''.


 The class responsible for creating jobs
    for ''pycbc_grb_trig_cluster''.


The class responsible for creating jobs for ``pycbc_grb_inj_finder``


Class to be used for to create workflow.Executable instances for the
    pycbc_single_template executable. Basically inherits directly from
    PlotExecutable.


Class to be used for to create workflow.Executable instances for the
    pycbc_plot_singles_timefreq executable. Basically inherits directly from
    PlotExecutable.


Class to be used for to create workflow.Executable instances for the
    pycbc_plot_qscan executable. Basically inherits directly from
    PlotExecutable.


Executable for getting version information


    This class in an extension of the MultiDetOptionAction class to handle
    cases where the : is already a special character. For example the channel
    name is something like H1:CHANNEL_NAME. Here the channel name *must*
    be provided uniquely for each ifo. The dictionary key is set to H1 and the
    value to H1:CHANNEL_NAME for this example.


A special case of `MultiDetOptionAction` which allows one to use
    arguments containing colons, such as `V1:FOOBAR:1`. The first colon is
    assumed to be the separator between the detector and the argument.
    All subsequent colons are kept as part of the argument. Unlike
    `MultiDetOptionAction`, all arguments must be prefixed by the
    corresponding detector.


A special case of `DictOptionAction` which allows one to use
    argument containing the detector (channel) name, such as
    `DETECTOR:PARAM:VALUE`. The first colon is the name of detector,
    the second colon is the name of parameter, the third colon is the value.
    Or similar to `DictOptionAction`, all arguments don't contain the name of
    detector, such as `PARAM:VALUE`, this will assume each detector has same
    values of those parameters.


Models a time series consisting of uniformly sampled scalar values.

    Parameters
    ----------
    initial_array : array-like
        Array containing sampled data.
    delta_t : float
        Time between consecutive samples in seconds.
    epoch : {None, lal.LIGOTimeGPS}, optional
        Time of the first sample in seconds.
    dtype : {None, data-type}, optional
        Sample data type.
    copy : boolean, optional
        If True, samples are copied to a new array.


Array used to do numeric calculations on a various compute
    devices. It is a convience wrapper around numpy, and
    pycuda.


Models a frequency series consisting of uniformly sampled scalar values.

    Parameters
    ----------
    initial_array : array-like
        Array containing sampled data.
    delta_f : float
        Frequency between consecutive samples in Hertz.
    epoch : {None, lal.LIGOTimeGPS}, optional
        Start time of the associated time domain data in seconds.
    dtype : {None, data-type}, optional
        Sample data type.
    copy : boolean, optional
        If True, samples are copied to a new array.


    The standard SafeConfigParser no longer supports deepcopy() as of python
    2.7 (see http://bugs.python.org/issue16058). This subclass restores that
    functionality.


    This is a sub-class of DeepCopyableConfigParser, which lets
    us add a few additional helper features that are useful in workflows.


 Class for managing manipulation of strain data for the purpose of
        matched filtering. This includes methods for segmenting and
        conditioning.


Base class for modifying calibration


Cubic spline recalibration

    see https://dcc.ligo.org/LIGO-T1400682/public

    This assumes the spline points follow
    np.logspace(np.log(minimum_frequency), np.log(maximum_frequency),
    n_points)

    Parameters
    ----------
    minimum_frequency: float
    minimum frequency of spline points
    maximum_frequency: float
    maximum frequency of spline points
    n_points: int
    number of spline points


 Class for adjusting time-varying calibration parameters of given
    strain data.

    Parameters
    ----------
    strain : FrequencySeries
        The strain to be adjusted.
    freq : array
        The frequencies corresponding to the values of c0, d0, a0 in Hertz.
    fc0 : float
        Coupled-cavity (CC) pole at time t0, when c0=c(t0) and a0=a(t0) are
        measured.
    c0 : array
        Initial sensing function at t0 for the frequencies.
    d0 : array
        Digital filter for the frequencies.
    a_tst0 : array
        Initial actuation function for the test mass at t0 for the
        frequencies.
    a_pu0 : array
        Initial actuation function for the penultimate mass at t0 for the
        frequencies.
    fs0 : float
        Initial spring frequency at t0 for the signal recycling cavity.
    qinv0 : float
        Initial inverse quality factor at t0 for the signal recycling
        cavity.


A gravitational wave detector


    Abstract base class to set structure for space detector classes.

    Parameters
    ----------
    detector_name : str
        The name of the detector. Accepts any output from
        `get_available_space_detectors`.

    reference_time : float (optional)
        The reference time in seconds of the signal in the SSB frame. This is
        defined such that the detector mission start time corresponds to 0.
        Default None.


    LISA detector modeled using LDC software. Constellation orbits are
    generated using LISA Orbits (https://pypi.org/project/lisaorbits/).
    Link projections are generated using LISA GW Response
    (10.5281/zenodo.6423435). TDI channels are generated using pyTDI
    (10.5281/zenodo.6351736).

    Parameters
    ----------
    detector_name : str
        The name of the detector. Accepts any output from
        `get_available_space_detectors`.

    reference_time : float (optional)
        The reference time in seconds of the signal in the SSB frame. This is
        defined such that the detector mission start time corresponds to 0.
        Default None.

    apply_offset : bool (optional)
        Flag whether to shift the times of the input waveforms by
        a given value. Some backends require this such that the
        detector is oriented correctly at t = 0. Default False.

    offset : float (optional)
        The time in seconds by which to offset the input waveform if
        apply_offset is True. Default 7365189.431698299.

    orbits : str (optional)
        The constellation orbital data used for generating projections
        and TDI. See self.orbits_init for accepted inputs. Default
        'EqualArmlength'.


    LISA detector modeled using FastLISAResponse. Constellation orbits are
    generated using LISA Analysis Tools (10.5281/zenodo.10930979). Link
    projections and TDI channels are generated using FastLISAResponse
    (https://arxiv.org/abs/2204.06633).

    Parameters
    ----------
    detector_name : str
        The name of the detector. Accepts any output from
        `get_available_space_detectors`.

    reference_time : float (optional)
        The reference time in seconds of the signal in the SSB frame. This is
        defined such that the detector mission start time corresponds to 0.
        Default None.

    apply_offset : bool (optional)
        Flag whether to shift the times of the input waveforms by
        a given value. Some backends require this such that the
        detector is oriented correctly at t = 0. Default False.

    offset : float (optional)
        The time in seconds by which to offset the input waveform if
        apply_offset is True. Default 7365189.431698299.

    use_gpu : bool (optional)
        Specify whether to run class on GPU support via CuPy. Default False.

    orbits : str (optional)
        The constellation orbital data used for generating projections
        and TDI. See self.orbits_init for accepted inputs. Default
        'EqualArmlength'.


    Space-based detector.

    Parameters
    ----------
    detector_name : str
        The name of the detector. Accepts any output from
        `get_available_space_detectors`.

    reference_time : float (optional)
        The reference time in seconds of the signal in the SSB frame. This is
        defined such that the detector mission start time corresponds to 0.
        Default None.

    backend : str (optional)
        The backend architecture to use for generating TDI. Accepts 'LDC'
        or 'FLR'. Default 'LDC'.


Base class for burn in tests.


Burn-in tests for collections of independent MCMC chains.

    This differs from EnsembleMCMCBurnInTests in that chains are treated as
    being independent of each other. The ``is_burned_in`` attribute will be
    True if `any` chain passes the burn in tests (whereas in MCMCBurnInTests,
    all chains must pass the burn in tests). In other words, independent
    samples can be collected even if all of the chains are not burned in.


Adds support for multiple temperatures to
    :py:class:`MCMCBurnInTests`.


Provides methods for estimating burn-in of an ensemble MCMC.


Adds support for multiple temperatures to
    :py:class:`EnsembleMCMCBurnInTests`.


Argparse action that will parse arguments that can accept labels.

    This assumes that the values set on the command line for its assigned
    argument are strings formatted like ``PARAM[:LABEL]``. When the arguments
    are parsed, the ``LABEL`` bit is stripped off and added to a dictionary
    mapping ``PARAM -> LABEL``. This dictionary is stored to the parsed
    namespace called ``{dest}_labels``, where ``{dest}`` is the argument's
    ``dest`` setting (by default, this is the same as the option string).
    Likewise, the argument's ``dest`` in the parsed namespace is updated so
    that it is just ``PARAM``.

    If no ``LABEL`` is provided, then ``PARAM`` will be used for ``LABEL``.

    This action can work on arguments that have ``nargs != 0`` and ``type`` set
    to ``str``.


Argparse action that will parse parameters and labels from an opton.

    Does the same as ``ParseLabelArg``, with the additional functionality that
    if ``LABEL`` is a known parameter in ``pycbc.waveform.parameters``, then
    the label attribute there will be used in the labels dictionary.
    Otherwise, ``LABEL`` will be used.

    Examples
    --------
    Create a parser and add two arguments that use this action (note that the
    first argument accepts multiple inputs while the second only accepts a
    single input):

    >>> import argparse
    >>> parser = argparse.ArgumentParser()
    >>> parser.add_argument('--parameters', type=str, nargs="+",
                            action=ParseParametersArg)
    >>> parser.add_argument('--z-arg', type=str, action=ParseParametersArg)

    Parse a command line that uses these options:

    >>> import shlex
    >>> cli = "--parameters 'mass1+mass2:mtotal' ra ni --z-arg foo:bar"
    >>> opts = parser.parse_args(shlex.split(cli))
    >>> opts.parameters
    ['mass1+mass2', 'ra', 'ni']
    >>> opts.parameters_labels
    {'mass1+mass2': '$M~(\\mathrm{M}_\\odot)$', 'ni': 'ni', 'ra': '$\\alpha$'}
    >>> opts.z_arg
    'foo'
    >>> opts.z_arg_labels
    {'foo': 'bar'}

    In the above, the first argument to ``--parameters`` was ``mtotal``. Since
    this is a recognized parameter in ``pycbc.waveform.parameters``, the label
    dictionary contains the latex string associated with the ``mtotal``
    parameter. A label was not provided for the second argument, and so ``ra``
    was used. Since ``ra`` is also a recognized parameter, its associated latex
    string was used in the labels dictionary. Since ``ni`` and ``bar`` (the
    label for ``z-arg``) are not recognized parameters, they were just used
    as-is in the labels dictionaries.


Direct importance sampling using a preconstructed parameter space
    mapping file.

    Parameters
    ----------
    model : Model
        An instance of a model from ``pycbc.inference.models``.
    mapfile : str
        Path to the pre-generated file containing the pre-mapped prior volume
    loglr_region: int
        Only use regions from the prior volume tiling that are within
        this loglr difference of the maximum tile.
    target_likelihood_calls: int
        Try to use this many likelihood calls in each round of the analysis.
    rounds: int
        The number of iterations to use before terminated.


This class is used to construct an CPNest sampler from the cpnest
    package by John Veitch.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    nlive : int
        Number of live points to use in sampler.
    pool : function with map, Optional
        A provider of a map function that allows a function call to be run
        over multiple sets of arguments and possibly maps them to
        cores/nodes/etc.


    Class for making PyCBC Inference 'model class'
    compatible with CPNest 'model class'

    Parameters
    ----------
    model : inference.BaseModel instance
             A model instance from pycbc.


Abstract base class that provides methods common to MCMCs.

    This is not a sampler class itself. Sampler classes can inherit from this
    along with ``BaseSampler``.

    This class provides ``set_initial_conditions``, ``run``, and ``checkpoint``
    methods, which are some of the abstract methods required by
    ``BaseSampler``.

    This class introduces the following abstract properties and methods:

    * base_shape
        [`property`] Should give the shape of the samples arrays used by the
        sampler, excluding the iteraitons dimension. Needed for writing
        results.
    * run_mcmc(niterations)
        Should run the sampler for the given number of iterations. Called by
        ``run``.
    * clear_samples()
        Should clear samples from memory. Called by ``run``.
    * set_state_from_file(filename)
        Should set the random state of the sampler using the given filename.
        Called by ``set_initial_conditions``.
    * write_results(filename)
        Writes results to the given filename. Called by ``checkpoint``.
    * compute_acf(filename, \**kwargs)
        [`classmethod`] Should compute the autocorrelation function using
        the given filename. Also allows for other keyword arguments.
    * compute_acl(filename, \**kwargs)
        [`classmethod`] Should compute the autocorrelation length using
        the given filename. Also allows for other keyword arguments.


Adds support for ensemble MCMC samplers.


This class is used to construct a nested sampler from
    the Multinest package.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    nlivepoints : int
        Number of live points to use in sampler.


This class is used to construct a parallel-tempered MCMC sampler from
    the emcee package's PTSampler.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    ntemps : int
        Number of temeratures to use in the sampler.
    nwalkers : int
        Number of walkers to use in sampler.
    betas : array
        An array of inverse temperature values to be used in emcee_pt's
        temperature ladder. If not provided, ``emcee_pt`` will use the number
        of temperatures and the number of dimensions of the parameter space to
        construct the ladder with geometrically spaced temperatures.
    loglikelihood_function : str, optional
        Set the function to call from the model for the ``loglikelihood``.
        Default is ``loglikelihood``.
    nprocesses : int, optional
        The number of parallel processes to use. Default is 1
        (no paralleliztion).
    use_mpi : bool, optional
        Use MPI for parallelization. Default (False) will use python's
        multiprocessing.


Provides methods for supporting multi-tempered samplers.


Dummy sampler for not doing sampling

    Parameters
    ----------
    model : Model
        An instance of a model from ``pycbc.inference.models``.


Abstract base class for all inference samplers.

    All sampler classes must inherit from this class and implement its abstract
    methods.

    Parameters
    ----------
    model : Model
        An instance of a model from ``pycbc.inference.models``.


 Class for making PyCBC Inference 'model class'

    Parameters
    ----------
    model : inference.BaseModel instance
             A model instance from pycbc.


Constructs an MCMC sampler using epsie's parallel-tempered sampler.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    nchains : int
        Number of chains to use in the sampler.
    ntemps : int, optional
        Number of temperatures to use in the sampler. A geometrically-spaced
        temperature ladder with the gievn number of levels will be constructed
        based on the number of parameters. If not provided, must provide
        ``betas``.
    betas : array, optional
        An array of inverse temperature values to be used in for the
        temperature ladder. If not provided, must provide ``ntemps``.
    proposals : list, optional
        List of proposals to use. Any parameters that do not have a proposal
        provided will use the ``default_propsal``. **Note:** proposals should
        be specified for the sampling parameters, not the
        variable parameters.
    default_proposal : an epsie.Proposal class, optional
        The default proposal to use for parameters not in ``proposals``.
        Default is :py:class:`epsie.proposals.Normal`.
    default_proposal_args : dict, optional
        Dictionary of arguments to pass to the default proposal.
    swap_interval : int, optional
        The number of iterations between temperature swaps. Default is 1.
    seed : int, optional
        Seed for epsie's random number generator. If None provided, will create
        one.
    checkpoint_interval : int, optional
        Specify the number of iterations to do between checkpoints. If not
        provided, no checkpointin will be done.
    checkpoint_signal : str, optional
        Set the signal to use when checkpointing. For example, 'USR2'.
    loglikelihood_function : str, optional
        Set the function to call from the model for the ``loglikelihood``.
        Default is ``loglikelihood``.
    nprocesses : int, optional
        The number of parallel processes to use. Default is 1
        (no paralleliztion).
    use_mpi : bool, optional
        Use MPI for parallelization. Default (False) will use python's
        multiprocessing.


Model wrapper for epsie.

    Allows model to be called like a function. Returns the loglikelihood
    function, logprior, and the model's default stats.


Class to construct a FlowSampler from the nessai package.


Wrapper for PyCBC Inference model class for use with nessai.

    Parameters
    ----------
    model : inference.BaseModel instance
        A model instance from PyCBC.
    loglikelihood_function : str
        Name of the log-likelihood method to call.


This class is used to construct the parallel-tempered ptemcee sampler.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    nwalkers : int
        Number of walkers to use in sampler.
    ntemps : int, optional
        Specify the number of temps to use. Either this, ``Tmax``, or ``betas``
        must be specified.
    Tmax : float, optional
        Specify the maximum temperature to use. This may be used with
        ``ntemps``; see :py:func:`ptemcee.make_ladder` for details. Either
        this, ``ntemps``, or ``betas`` must be specified.
    betas : list of float, optional
        Specify the betas to use. Must be provided if ``ntemps`` and ``Tmax``
        are not given. Will override ``ntemps`` and ``Tmax`` if provided.
    adaptive : bool, optional
        Whether or not to use adaptive temperature levels. Default is False.
    adaptation_lag : int, optional
        Only used if ``adaptive`` is True; see :py:mod:`ptemcee.Sampler` for
        details. If not provided, will use ``ptemcee``'s default.
    adaptation_time : int, optional
        Only used if ``adaptive`` is True; see :py:mod:`ptemcee.Sampler` for
        details. If not provided, will use ``ptemcee``'s default.
    scale_factor : float, optional
        Scale factor used for the stretch proposal; see
        :py:mod:`ptemcee.Sampler` for details. If not provided, will use
        ``ptemcee``'s default.
    loglikelihood_function : str, optional
        Set the function to call from the model for the ``loglikelihood``.
        Default is ``loglikelihood``.
    nprocesses : int, optional
        The number of parallel processes to use. Default is 1
        (no paralleliztion).
    use_mpi : bool, optional
        Use MPI for parallelization. Default (False) will use python's
        multiprocessing.


This class is used to construct an MCMC sampler from the emcee
    package's EnsembleSampler.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    nwalkers : int
        Number of walkers to use in sampler.
    pool : function with map, Optional
        A provider of a map function that allows a function call to be run
        over multiple sets of arguments and possibly maps them to
        cores/nodes/etc.


Sampler for kde drawn refinement of existing posterior estimate

    Parameters
    ----------
    model : Model
        An instance of a model from ``pycbc.inference.models``.
    num_samples: int
        The number of samples to draw from the kde at the conclusion
    iterative_kde_samples: int
        The number of samples to add to the kde during each iterations
    min_refinement_steps: int
        The minimum number of iterations to take.
    max_refinement_steps: The maximum number of refinment steps to take.
    entropy: float
        The target entropy between iterative kdes
    dlogz: float
        The target evidence difference between iterative kde updates
    kde: kde
        The inital kde to use.


This class is used to construct an Ultranest sampler from the ultranest
    package.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    log_dir : str
        Folder where files should be stored for resuming (optional).
    stepsampling : bool
        If false, uses rejection sampling. If true, uses
        hit-and-run sampler, which scales better with dimensionality.


This class is used to construct an Dynesty sampler from the dynesty
    package.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``.
    nlive : int
        Number of live points to use in sampler.
    pool : function with map, Optional
        A provider of a map function that allows a function call to be run
        over multiple sets of arguments and possibly maps them to
        cores/nodes/etc.


This class is used to construct an Snowline sampler from the snowline
    package.

    Parameters
    ----------
    model : model
        A model from ``pycbc.inference.models``


r"""The likelihood is analytically marginalized over phase.

    This class can be used with signal models that can be written as:

    .. math::

        \tilde{h}(f; \Theta, \phi) = A(f; \Theta)e^{i\Psi(f; \Theta) + i \phi},

    where :math:`\phi` is an arbitrary phase constant. This phase constant
    can be analytically marginalized over with a uniform prior as follows:
    assuming the noise is stationary and Gaussian (see `GaussianNoise`
    for details), the posterior is:

    .. math::

        p(\Theta,\phi|d)
            &\propto p(\Theta)p(\phi)p(d|\Theta,\phi) \\
            &\propto p(\Theta)\frac{1}{2\pi}\exp\left[
                -\frac{1}{2}\sum_{i}^{N_D} \left<
                    h_i(\Theta,\phi) - d_i, h_i(\Theta,\phi) - d_i
                \right>\right].

    Here, the sum is over the number of detectors :math:`N_D`, :math:`d_i`
    and :math:`h_i` are the data and signal in detector :math:`i`,
    respectively, and we have assumed a uniform prior on :math:`\phi \in [0,
    2\pi)`. With the form of the signal model given above, the inner product
    in the exponent can be written as:

    .. math::

        -\frac{1}{2}\left<h_i - d_i, h_i- d_i\right>
            &= \left<h_i, d_i\right> -
               \frac{1}{2}\left<h_i, h_i\right> -
               \frac{1}{2}\left<d_i, d_i\right> \\
            &= \Re\left\{O(h^0_i, d_i)e^{-i\phi}\right\} -
               \frac{1}{2}\left<h^0_i, h^0_i\right> -
               \frac{1}{2}\left<d_i, d_i\right>,

    where:

    .. math::

        h_i^0 &\equiv \tilde{h}_i(f; \Theta, \phi=0); \\
        O(h^0_i, d_i) &\equiv 4 \int_0^\infty
            \frac{\tilde{h}_i^*(f; \Theta,0)\tilde{d}_i(f)}{S_n(f)}\mathrm{d}f.

    Gathering all of the terms that are not dependent on :math:`\phi` together:

    .. math::

        \alpha(\Theta, d) \equiv \exp\left[-\frac{1}{2}\sum_i
            \left<h^0_i, h^0_i\right> + \left<d_i, d_i\right>\right],

    we can marginalize the posterior over :math:`\phi`:

    .. math::

        p(\Theta|d)
            &\propto p(\Theta)\alpha(\Theta,d)\frac{1}{2\pi}
                     \int_{0}^{2\pi}\exp\left[\Re \left\{
                         e^{-i\phi} \sum_i O(h^0_i, d_i)
                     \right\}\right]\mathrm{d}\phi \\
            &\propto p(\Theta)\alpha(\Theta, d)\frac{1}{2\pi}
                     \int_{0}^{2\pi}\exp\left[
                         x(\Theta,d)\cos(\phi) + y(\Theta, d)\sin(\phi)
                     \right]\mathrm{d}\phi.

    The integral in the last line is equal to :math:`2\pi I_0(\sqrt{x^2+y^2})`,
    where :math:`I_0` is the modified Bessel function of the first kind. Thus
    the marginalized posterior is:

    .. math::

        p(\Theta|d) \propto
            I_0\left(\left|\sum_i O(h^0_i, d_i)\right|\right)
             p(\Theta)\exp\left[\frac{1}{2}\sum_i\left( \left<h^0_i, h^0_i\right> -
                                    \left<d_i, d_i\right> \right)\right]


r""" This likelihood numerically marginalizes over time

    This likelihood is optimized for marginalizing over time, but can also
    handle marginalization over polarization, phase (where appropriate),
    and sky location. The time series is interpolated using a
    quadratic apparoximation for sub-sample times.


r""" This likelihood numerically marginalizes over polarization angle

    This class implements the Gaussian likelihood with an explicit numerical
    marginalization over polarization angle. This is accomplished using
    a fixed set of integration points distribution uniformation between
    0 and 2pi. By default, 1000 integration points are used.
    The 'polarization_samples' argument can be passed to set an alternate
    number of integration points.


r"""Numerically marginalizes waveforms with higher modes over polarization
    `and` phase.

    This class implements the Gaussian likelihood with an explicit numerical
    marginalization over polarization angle and orbital phase. This is
    accomplished using a fixed set of integration points distributed uniformly
    between 0 and 2:math:`\pi` for both the polarization and phase. By default,
    100 integration points are used for each parameter, giving :math:`10^4`
    evaluation points in total. This can be modified using the
    ``polarization_samples`` and ``coa_phase_samples`` arguments.

    This only works with waveforms that return separate spherical harmonic
    modes for each waveform. For a list of currently supported approximants,
    see :py:func:`pycbc.waveform.waveform_modes.fd_waveform_mode_approximants`
    and :py:func:`pycbc.waveform.waveform_modes.td_waveform_mode_approximants`.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    data : dict
        A dictionary of data, in which the keys are the detector names and the
        values are the data (assumed to be unwhitened). All data must have the
        same frequency resolution.
    low_frequency_cutoff : dict
        A dictionary of starting frequencies, in which the keys are the
        detector names and the values are the starting frequencies for the
        respective detectors to be used for computing inner products.
    psds : dict, optional
        A dictionary of FrequencySeries keyed by the detector names. The
        dictionary must have a psd for each detector specified in the data
        dictionary. If provided, the inner products in each detector will be
        weighted by 1/psd of that detector.
    high_frequency_cutoff : dict, optional
        A dictionary of ending frequencies, in which the keys are the
        detector names and the values are the ending frequencies for the
        respective detectors to be used for computing inner products. If not
        provided, the minimum of the largest frequency stored in the data
        and a given waveform will be used.
    normalize : bool, optional
        If True, the normalization factor :math:`alpha` will be included in the
        log likelihood. See :py:class:`GaussianNoise` for details. Default is
        to not include it.
    polarization_samples : int, optional
        How many points to use in polarization. Default is 100.
    coa_phase_samples : int, optional
        How many points to use in phase. Defaults is 100.
    \**kwargs :
        All other keyword arguments are passed to
        :py:class:`BaseGaussianNoise
        <pycbc.inference.models.gaussian_noise.BaseGaussianNoise>`.


Dummy class to just return 0 if no prior is given to a model.


Class to hold model's current stat values.


Provides methods for transforming between sampling parameter space and
    model parameter space.


r"""Base class for all models.

    Given some model :math:`h` with parameters :math:`\Theta`, Bayes Theorem
    states that the probability of observing parameter values :math:`\vartheta`
    is:

    .. math::

        p(\vartheta|h) = \frac{p(h|\vartheta) p(\vartheta)}{p(h)}.

    Here:

     * :math:`p(\vartheta|h)` is the **posterior** probability;

     * :math:`p(h|\vartheta)` is the **likelihood**;

     * :math:`p(\vartheta)` is the **prior**;

     * :math:`p(h)` is the **evidence**.

    This class defines properties and methods for evaluating the log
    likelihood, log prior, and log posteror. A set of parameter values is set
    using the ``update`` method. Calling the class's
    ``log(likelihood|prior|posterior)`` properties will then evaluate the model
    at those parameter values.

    Classes that inherit from this class must implement a ``_loglikelihood``
    function that can be called by ``loglikelihood``.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    static_params : dict, optional
        A dictionary of parameter names -> values to keep fixed.
    prior : callable, optional
        A callable class or function that computes the log of the prior. If
        None provided, will use ``_noprior``, which returns 0 for all parameter
        values.
    sampling_params : list, optional
        Replace one or more of the ``variable_params`` with the given
        parameters for sampling.
    replace_parameters : list, optional
        The ``variable_params`` to replace with sampling parameters. Must be
        the same length as ``sampling_params``.
    sampling_transforms : list, optional
        List of transforms to use to go between the ``variable_params`` and the
        sampling parameters. Required if ``sampling_params`` is not None.
    waveform_transforms : list, optional
        A list of transforms to convert the ``variable_params`` into something
        understood by the likelihood model. This is useful if the prior is
        more easily parameterized in parameters that are different than what
        the likelihood is most easily defined in. Since these are used solely
        for converting parameters, and not for rescaling the parameter space,
        a Jacobian is not required for these transforms.


Help class to add bookkeeping for likelihood marginalization


This should be raised if a continous segment of valid data could not be
    found.


r"""Base model for gated gaussian.

    Provides additional routines for applying a time-domain gate to data.
    See :py:class:`GatedGaussianNoise` for more details.


r"""Model that applies a time domain gate, assuming stationary Gaussian
    noise.

    The gate start and end times are set by providing ``t_gate_start`` and
    ``t_gate_end`` parameters, respectively. This will cause the gated times
    to be excised from the analysis. For more details on the likelihood
    function and its derivation, see
    `arXiv:2105.05238 <https://arxiv.org/abs/2105.05238>`_.

    .. warning::
        The normalization of the likelihood depends on the gate times. However,
        at the moment, the normalization is not calculated, as it depends on
        the determinant of the truncated covariance matrix (see Eq. 4 of
        arXiv:2105.05238). For this reason it is recommended that you only
        use this model for fixed gate times.


r"""Gated gaussian model with numerical marginalization over polarization.

    This implements the GatedGaussian likelihood with an explicit numerical
    marginalization over polarization angle. This is accomplished using
    a fixed set of integration points distribution uniformation between
    0 and 2pi. By default, 1000 integration points are used.
    The 'polarization_samples' argument can be passed to set an alternate
    number of integration points.


r"""Model that assumes we know all the intrinsic parameters.

    This model assumes we know all the intrinsic parameters, and are only
    maximizing over the extrinsic ones. We also assume a dominant mode waveform
    approximant only and non-precessing.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    data : dict
        A dictionary of data, in which the keys are the detector names and the
        values are the data (assumed to be unwhitened). All data must have the
        same frequency resolution.
    low_frequency_cutoff : dict
        A dictionary of starting frequencies, in which the keys are the
        detector names and the values are the starting frequencies for the
        respective detectors to be used for computing inner products.
    sample_rate : int, optional
        The sample rate to use. Default is 32768.
    polarization_samples: int, optional
        Parameter to specify how finely to marginalize over polarization angle.
        If None, then polarization must be a parameter.
    \**kwargs :
        All other keyword arguments are passed to
        :py:class:`BaseGaussianNoise`; see that class for details.


r"""Model for analyzing GW data with assuming a wide-sense stationary
    Gaussian noise model.

    This model will load gravitational wave data and calculate the log noise
    likelihood ``_lognl`` and normalization. It also implements the
    ``_loglikelihood`` function as the sum of the log likelihood ratio and the
    ``lognl``. It does not implement a log likelihood ratio function
    ``_loglr``, however, since that can differ depending on the signal model.
    Models that analyze GW data assuming it is stationary Gaussian should
    therefore inherit from this class and implement their own ``_loglr``
    function.

    For more details on the inner product used, the log likelihood of the
    noise, and the normalization factor, see :py:class:`GaussianNoise`.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    data : dict
        A dictionary of data, in which the keys are the detector names and the
        values are the data (assumed to be unwhitened). All data must have the
        same frequency resolution.
    low_frequency_cutoff : dict
        A dictionary of starting frequencies, in which the keys are the
        detector names and the values are the starting frequencies for the
        respective detectors to be used for computing inner products.
    psds : dict, optional
        A dictionary of FrequencySeries keyed by the detector names. The
        dictionary must have a psd for each detector specified in the data
        dictionary. If provided, the inner products in each detector will be
        weighted by 1/psd of that detector.
    high_frequency_cutoff : dict, optional
        A dictionary of ending frequencies, in which the keys are the
        detector names and the values are the ending frequencies for the
        respective detectors to be used for computing inner products. If not
        provided, the minimum of the largest frequency stored in the data
        and a given waveform will be used.
    normalize : bool, optional
        If True, the normalization factor :math:`alpha` will be included in the
        log likelihood. See :py:class:`GaussianNoise` for details. Default is
        to not include it.
    static_params : dict, optional
        A dictionary of parameter names -> values to keep fixed.
    ignore_failed_waveforms : bool, optional
        If the waveform generator raises an error when it tries to generate,
        treat the point as having zero likelihood. This allows the parameter
        estimation to continue. Otherwise, an error will be raised, stopping
        the run. Default is False.
    \**kwargs :
        All other keyword arguments are passed to ``BaseDataModel``.

    Attributes
    ----------
    ignore_failed_waveforms : bool
        If True, points in parameter space that cause waveform generation to
        fail (i.e., they raise a ``FailedWaveformError``) will be treated as
        points with zero likelihood. Otherwise, such points will cause the
        model to raise a ``FailedWaveformError``.


r"""Model that assumes data is stationary Gaussian noise.

    With Gaussian noise the log likelihood functions for signal
    :math:`\log p(d|\Theta, h)` and for noise :math:`\log p(d|n)` are given by:

    .. math::

        \log p(d|\Theta, h) &=  \log\alpha -\frac{1}{2} \sum_i
            \left< d_i - h_i(\Theta) | d_i - h_i(\Theta) \right> \\
        \log p(d|n) &= \log\alpha -\frac{1}{2} \sum_i \left<d_i | d_i\right>

    where the sum is over the number of detectors, :math:`d_i` is the data in
    each detector, and :math:`h_i(\Theta)` is the model signal in each
    detector. The (discrete) inner product is given by:

    .. math::

        \left<a_i | b_i\right> = 4\Re \Delta f
            \sum_{k=k_{\mathrm{min}}}^{k_{\mathrm{max}}}
            \frac{\tilde{a}_i^{*}[k] \tilde{b}_i[k]}{S^{(i)}_n[k]},

    where :math:`\Delta f` is the frequency resolution (given by 1 / the
    observation time :math:`T`), :math:`k` is an index over the discretely
    sampled frequencies :math:`f = k \Delta_f`, and :math:`S^{(i)}_n[k]` is the
    PSD in the given detector. The upper cutoff on the inner product
    :math:`k_{\max}` is by default the Nyquist frequency
    :math:`k_{\max} = N/2+1`, where :math:`N = \lfloor T/\Delta t \rfloor`
    is the number of samples in the time domain, but this can be set manually
    to a smaller value.

    The normalization factor :math:`\alpha` is:

    .. math::

        \alpha = \prod_{i} \frac{1}{\left(\pi T\right)^{N/2}
            \prod_{k=k_\mathrm{min}}^{k_{\mathrm{max}}} S^{(i)}_n[k]},

    where the product is over the number of detectors. By default, the
    normalization constant is not included in the log likelihood, but it can
    be turned on using the ``normalize`` keyword argument.

    Note that the log likelihood ratio has fewer terms than the log likelihood,
    since the normalization and :math:`\left<d_i|d_i\right>` terms cancel:

    .. math::

        \log \mathcal{L}(\Theta) = \sum_i \left[
            \left<h_i(\Theta)|d_i\right> -
            \frac{1}{2} \left<h_i(\Theta)|h_i(\Theta)\right> \right]

    Upon initialization, the data is whitened using the given PSDs. If no PSDs
    are given the data and waveforms returned by the waveform generator are
    assumed to be whitened.

    For more details on initialization parameters and definition of terms, see
    :py:class:`models.BaseDataModel`.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    data : dict
        A dictionary of data, in which the keys are the detector names and the
        values are the data (assumed to be unwhitened). The list of keys must
        match the waveform generator's detectors keys, and the epoch of every
        data set must be the same as the waveform generator's epoch.
    low_frequency_cutoff : dict
        A dictionary of starting frequencies, in which the keys are the
        detector names and the values are the starting frequencies for the
        respective detectors to be used for computing inner products.
    psds : dict, optional
        A dictionary of FrequencySeries keyed by the detector names. The
        dictionary must have a psd for each detector specified in the data
        dictionary. If provided, the inner products in each detector will be
        weighted by 1/psd of that detector.
    high_frequency_cutoff : dict, optional
        A dictionary of ending frequencies, in which the keys are the
        detector names and the values are the ending frequencies for the
        respective detectors to be used for computing inner products. If not
        provided, the minimum of the largest frequency stored in the data
        and a given waveform will be used.
    normalize : bool, optional
        If True, the normalization factor :math:`alpha` will be included in the
        log likelihood. Default is to not include it.
    static_params : dict, optional
        A dictionary of parameter names -> values to keep fixed.
    det_frame_waveform : bool
        If True, the waveform will be generated directly in the detector frame
        using the
        :py:class:`~pycbc.waveform.generator.FDomainDirectDetFrameGenerator`.
        This requires the approximant be implemented in
        :py:func:`~pycbc.waveform.get_fd_det_waveform`.
        If False, the
        :py:class:`~pycbc.waveform.generator.FDomainDetFrameGenerator` will be
        used instead. Defaults to :code:`False`.
    \**kwargs :
        All other keyword arguments are passed to ``BaseDataModel``.

    Examples
    --------
    Create a signal, and set up the model using that signal:

    >>> from pycbc import psd as pypsd
    >>> from pycbc.inference.models import GaussianNoise
    >>> from pycbc.waveform.generator import (FDomainDetFrameGenerator,
    ...                                       FDomainCBCGenerator)
    >>> seglen = 4
    >>> sample_rate = 2048
    >>> N = seglen*sample_rate/2+1
    >>> fmin = 30.
    >>> static_params = {'approximant': 'IMRPhenomD', 'f_lower': fmin,
    ...                  'mass1': 38.6, 'mass2': 29.3,
    ...                  'spin1z': 0., 'spin2z': 0., 'ra': 1.37, 'dec': -1.26,
    ...                  'polarization': 2.76, 'distance': 3*500.}
    >>> variable_params = ['tc']
    >>> tsig = 3.1
    >>> generator = FDomainDetFrameGenerator(
    ...     FDomainCBCGenerator, 0., detectors=['H1', 'L1'],
    ...     variable_args=variable_params,
    ...     delta_f=1./seglen, **static_params)
    >>> signal = generator.generate(tc=tsig)
    >>> psd = pypsd.aLIGOZeroDetHighPower(N, 1./seglen, 20.)
    >>> psds = {'H1': psd, 'L1': psd}
    >>> low_frequency_cutoff = {'H1': fmin, 'L1': fmin}
    >>> model = GaussianNoise(variable_params, signal, low_frequency_cutoff,
                              psds=psds, static_params=static_params)

    Set the current position to the coalescence time of the signal:

    >>> model.update(tc=tsig)

    Now compute the log likelihood ratio and prior-weighted likelihood ratio;
    since we have not provided a prior, these should be equal to each other:

    >>> print('{:.2f}'.format(model.loglr))
    282.43
    >>> print('{:.2f}'.format(model.logplr))
    282.43

    Print all of the default_stats:

    >>> print(',\n'.join(['{}: {:.2f}'.format(s, v)
    ...                   for (s, v) in sorted(model.current_stats.items())]))
    H1_cplx_loglr: 177.76+0.00j,
    H1_optimal_snrsq: 355.52,
    L1_cplx_loglr: 104.67+0.00j,
    L1_optimal_snrsq: 209.35,
    logjacobian: 0.00,
    loglikelihood: 0.00,
    loglr: 282.43,
    logprior: 0.00

    Compute the SNR; for this system and PSD, this should be approximately 24:

    >>> from pycbc.conversions import snr_from_loglr
    >>> x = snr_from_loglr(model.loglr)
    >>> print('{:.2f}'.format(x))
    23.77

    Since there is no noise, the SNR should be the same as the quadrature sum
    of the optimal SNRs in each detector:

    >>> x = (model.det_optimal_snrsq('H1') +
    ...      model.det_optimal_snrsq('L1'))**0.5
    >>> print('{:.2f}'.format(x))
    23.77

    Toggle on the normalization constant:

    >>> model.normalize = True
    >>> model.loglikelihood
    835397.8757405131

    Using the same model, evaluate the log likelihood ratio at several points
    in time and check that the max is at tsig:

    >>> import numpy
    >>> times = numpy.linspace(tsig-1, tsig+1, num=101)
    >>> loglrs = numpy.zeros(len(times))
    >>> for (ii, t) in enumerate(times):
    ...     model.update(tc=t)
    ...     loglrs[ii] = model.loglr
    >>> print('tsig: {:.2f}, time of max loglr: {:.2f}'.format(
    ...     tsig, times[loglrs.argmax()]))
    tsig: 3.10, time of max loglr: 3.10

    Create a prior and use it (see distributions module for more details):

    >>> from pycbc import distributions
    >>> uniform_prior = distributions.Uniform(tc=(tsig-0.2,tsig+0.2))
    >>> prior = distributions.JointDistribution(variable_params, uniform_prior)
    >>> model = GaussianNoise(variable_params,
    ...     signal, low_frequency_cutoff, psds=psds, prior=prior,
    ...     static_params=static_params)
    >>> model.update(tc=tsig)
    >>> print('{:.2f}'.format(model.logplr))
    283.35
    >>> print(',\n'.join(['{}: {:.2f}'.format(s, v)
    ...                   for (s, v) in sorted(model.current_stats.items())]))
    H1_cplx_loglr: 177.76+0.00j,
    H1_optimal_snrsq: 355.52,
    L1_cplx_loglr: 104.67+0.00j,
    L1_optimal_snrsq: 209.35,
    logjacobian: 0.00,
    loglikelihood: 0.00,
    loglr: 282.43,
    logprior: 0.92


r"""Model that is a combination of other models.

    Sub-models are treated as being independent of each other, although
    they can share parameters. In other words, the hierarchical likelihood is:

    .. math::

        p(\mathbf{D}|\mathbf{\vartheta}, \mathbf{H}) =
            \prod_{I}^{K} p(\mathbf{d}_I|\mathbf{\vartheta}, H_{I})

    Submodels are provided as a dictionary upon initialization with a unique
    label assigned to each model, e.g., ``{'event1' -> model1, 'event2' ->
    model2}``. Variable and static parameters that are specific to each
    submodel should be prepended with ``{label}__``, where ``{label}__`` is the
    label associated with the given submodel. Shared parameters across multiple
    models have no labels prepended. To specify shared models over a subset of
    models, separate models with an underscore.  For example,
    ``event1_event2__foo`` will result in ``foo`` being common between models
    ``event1`` and ``event2``. For more details on parameter naming see
    :py:class:`HierarchicalParam
    <pycbc.inference.models.hierarchical.HierarchicalParam>`.

    All waveform and sampling transforms, as well as prior evaluation, are
    handled by this model, not the sub-models. Parameters created by waveform
    transforms should therefore also have sub-model names prepended to them,
    to indicate which models they should be provided to for likelihood
    evaluation.

    Parameters
    ----------
    variable_params: (tuple of) string(s)
        A tuple of parameter names that will be varied.
    submodels: dict
        Dictionary of model labels -> model instances of all the submodels.
    \**kwargs :
        All other keyword arguments are passed to
        :py:class:`BaseModel <pycbc.inference.models.base.BaseModel>`.


Sub-class of str for hierarchical parameter names.

    This adds attributes that keep track of the model label(s) the parameter
    is associated with, along with the name that is passed to the models.

    The following conventions are used for parsing parameter names:

      * Model labels and parameter names are separated by the ``delim`` class
        attribute, which by default is ``__``, e.g., ``event1__mass``.
      * Multiple model labels can be provided by separating the model labels
        with the ``model_delim`` class attribute, which by default is ``_``,
        e.g., ``event1_event2__mass``. Note that this means that individual
        model labels cannot contain ``_``, else they'll be parsed as separate
        models.
      * Parameters that have no model labels prepended to them (i.e., there
        is no ``__`` in the name) are common to all models.

    These parsing rules are applied by the :py:meth:`HierarchicalParam.parse`
    method.

    Parameters
    ----------
    fullname : str
        Name of the hierarchical parameter. Should have format
        ``{model1}[_{model2}[_{...}]]__{param}``.
    possible_models : set of str
        The possible sub-models a parameter can belong to. Should a set of
        model labels.

    Attributes
    ----------
    fullname : str
        The full name of the parameter, including model labels. For example,
        ``e1_e2__foo``.
    models : set
        The model labels the parameter is associated with. For example,
        ``e1_e2__foo`` yields models ``e1, e2``.
    subname : str
        The name of the parameter without the model labels prepended to it.
        For example, ``e1_e2__foo`` yields ``foo``.


 Model for multiple signals which share data

    Sub models are treated as if the signals overlap in data. This requires
    constituent models to implement a specific method to handle this case.
    All models must be of the same type or the specific model is responsible
    for implement cross-compatibility with another model. Each model h_i is
    responsible for calculating its own loglikelihood ratio for itself, and
    must also implement a method to calculate crossterms of the form
    <h_i | h_j> which arise from the full calculation of <d - h|d - h>.
    This model inherits from the HierarchicalModel so the syntax for
    configuration files is the same. The primary model is used to determine
    the noise terms <d | d>, which by default will be the first model used.


This likelihood model can be used for cases when one of the submodels
    can be marginalized to accelerate the total likelihood. This likelihood
    model also allows for further acceleration of other models during
    marginalization, if some extrinsic parameters can be tightly constrained
    by the primary model. More specifically, such as the EM + GW parameter
    estimation, the sky localization can be well measured. For LISA + 3G
    multiband observation, SOBHB signals' (tc, ra, dec) can be tightly
    constrained by 3G network, so this model is also useful for this case.


r"""The test distribution is an multi-variate normal distribution.

    The number of dimensions is set by the number of ``variable_params`` that
    are passed. For details on the distribution used, see
    ``scipy.stats.multivariate_normal``.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    mean : array-like, optional
        The mean values of the parameters. If None provide, will use 0 for all
        parameters.
    cov : array-like, optional
        The covariance matrix of the parameters. If None provided, will use
        unit variance for all parameters, with cross-terms set to 0.
    **kwargs :
        All other keyword arguments are passed to ``BaseModel``.

    Examples
    --------
    Create a 2D model with zero mean and unit variance:

    >>> m = TestNormal(['x', 'y'])

    Set the current parameters and evaluate the log posterior:

    >>> m.update(x=-0.2, y=0.1)
    >>> m.logposterior
    -1.8628770664093453

    See the current stats that were evaluated:

    >>> m.current_stats
    {'logjacobian': 0.0, 'loglikelihood': -1.8628770664093453, 'logprior': 0.0}


r"""The test distribution is an 'eggbox' function:

    .. math::

        \log \mathcal{L}(\Theta) = \left[
            2+\prod_{i=1}^{n}\cos\left(\frac{\theta_{i}}{2}\right)\right]^{5}

    The number of dimensions is set by the number of ``variable_params`` that
    are passed.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    **kwargs :
        All other keyword arguments are passed to ``BaseModel``.


r"""The test distribution is the Rosenbrock function:

    .. math::

        \log \mathcal{L}(\Theta) = -\sum_{i=1}^{n-1}[
            (1-\theta_{i})^{2}+100(\theta_{i+1} - \theta_{i}^{2})^{2}]

    The number of dimensions is set by the number of ``variable_params`` that
    are passed.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    **kwargs :
        All other keyword arguments are passed to ``BaseModel``.


r"""The test distribution is a two-dimensional 'volcano' function:

    .. math::
        \Theta =
            \sqrt{\theta_{1}^{2} + \theta_{2}^{2}} \log \mathcal{L}(\Theta) =
            25\left(e^{\frac{-\Theta}{35}} +
                    \frac{1}{2\sqrt{2\pi}} e^{-\frac{(\Theta-5)^{2}}{8}}\right)

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied. Must have length 2.
    **kwargs :
        All other keyword arguments are passed to ``BaseModel``.


r"""Uses the prior as the test distribution.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied. Must have length 2.
    **kwargs :
        All other keyword arguments are passed to ``BaseModel``.


r"""Build a test posterior from a set of samples using a kde

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    posterior_file : hdf file
        A compatible pycbc inference output file which posterior samples can
        be read from.
    nsamples : int
        Number of samples to draw from posterior file to build KDE.
    **kwargs :
        All other keyword arguments are passed to ``BaseModel``.


r"""Base class for models that require data and a waveform generator.

    This adds propeties for the log of the likelihood that the data contain
    noise, ``lognl``, and the log likelihood ratio ``loglr``.

    Classes that inherit from this class must define ``_loglr`` and ``_lognl``
    functions, in addition to the ``_loglikelihood`` requirement inherited from
    ``BaseModel``.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    data : dict
        A dictionary of data, in which the keys are the detector names and the
        values are the data.
    recalibration : dict of pycbc.calibration.Recalibrate, optional
        Dictionary of detectors -> recalibration class instances for
        recalibrating data.
    gates : dict of tuples, optional
        Dictionary of detectors -> tuples of specifying gate times. The
        sort of thing returned by `pycbc.gate.gates_from_cli`.
    injection_file : str, optional
        If an injection was added to the data, the name of the injection file
        used. If provided, the injection parameters will be written to
        file when ``write_metadata`` is called.

    \**kwargs :
        All other keyword arguments are passed to ``BaseModel``.

    See ``BaseModel`` for additional attributes and properties.


Wrapper class for calling models from a sampler.

    This class can be called like a function, with the parameter values to
    evaluate provided as a list in the same order as the model's
    ``variable_params``. In that case, the model is updated with the provided
    parameters and then the ``callstat`` retrieved. If ``return_all_stats`` is
    set to ``True``, then all of the stats specified by the model's
    ``default_stats`` will be returned as a tuple, in addition to the stat
    value.

    The model's attributes are promoted to this class's namespace, so that any
    attribute and method of ``model`` may be called directly from this class.

    This class must be initalized prior to the creation of a ``Pool`` object.

    Parameters
    ----------
    model : Model instance
        The model to call.
    callstat : str
        The statistic to call.
    return_all_stats : bool, optional
        Whether or not to return all of the other statistics along with the
        ``callstat`` value.

    Examples
    --------
    Create a wrapper around an instance of the ``TestNormal`` model, with the
    ``callstat`` set to ``logposterior``:

    >>> from pycbc.inference.models import TestNormal, CallModel
    >>> model = TestNormal(['x', 'y'])
    >>> call_model = CallModel(model, 'logposterior')

    Now call on a set of parameter values:

    >>> call_model([0.1, -0.2])
    (-1.8628770664093453, (0.0, 0.0, -1.8628770664093453))

    Note that a tuple of all of the model's ``default_stats`` were returned in
    addition to the ``logposterior`` value. We can shut this off by toggling
    ``return_all_stats``:

    >>> call_model.return_all_stats = False
    >>> call_model([0.1, -0.2])
    -1.8628770664093453

    Attributes of the model can be called from the call model. For example:

    >>> call_model.variable_params
    ('x', 'y')


Sub-classes dictionary to manage the collection of available models.

    The first time this is called, any plugin models that are available will be
    added to the dictionary before returning.


r"""Model that assumes the likelihood in a region around the peak
    is slowly varying such that a linear approximation can be made, and
    likelihoods can be calculated at a coarser frequency resolution. For
    more details on the implementation, see https://arxiv.org/abs/1806.08792.

    This model requires the use of a fiducial waveform whose parameters are
    near the peak of the likelihood. The fiducial waveform and all template
    waveforms used in likelihood calculation are currently generated using
    the SPAtmplt approximant.

    For more details on initialization parameters and definition of terms, see
    :py:class:`BaseGaussianNoise`.

    Parameters
    ----------
    variable_params : (tuple of) string(s)
        A tuple of parameter names that will be varied.
    data : dict
        A dictionary of data, in which the keys are the detector names and the
        values are the data (assumed to be unwhitened). All data must have the
        same frequency resolution.
    low_frequency_cutoff : dict
        A dictionary of starting frequencies, in which the keys are the
        detector names and the values are the starting frequencies for the
        respective detectors to be used for computing inner products.
    figucial_params : dict
        A dictionary of waveform parameters to be used for generating the
        fiducial waveform. Keys must be parameter names in the form
        'PARAM_ref' where PARAM is a recognized extrinsic parameter or
        an intrinsic parameter compatible with the chosen approximant.
    gammas : array of floats, optional
        Frequency powerlaw indices to be used in computing frequency bins.
    epsilon : float, optional
        Tuning parameter used in calculating the frequency bins. Lower values
        will result in higher resolution and more bins.
    earth_rotation: boolean, optional
        Default is False. If True, then vary the fp/fc polarization values
        as a function of frequency bin, using a predetermined PN approximation
        for the time offsets.
    \**kwargs :
        All other keyword arguments are passed to
        :py:class:`BaseGaussianNoise`.


 Heterodyne likelihood optimized for time marginalization. In addition
    it supports phase (dominant-mode), sky location, and polarization
    marginalization.


 Heterodyne likelihood optimized for time marginalization and only
    dominant-mode waveforms. This enables the ability to do inclination
    marginalization in addition to the other forms supportedy by RelativeTime.


Argparse action that will parse temps argument.

    If the provided argument is 'all', sets 'all' in the namespace dest. If a
    a sequence of numbers are provided, converts those numbers to ints before
    saving to the namespace.


Adds support for reading/writing multi-tempered metadata to
    :py:class:`~pycbc.inference.io.base_mcmc.CommonMCMCMetadatIO`.


 A class that has extra functions for handling reading the samples
    from posterior-only TXT files.

    Parameters
    -----------
    path : str
        The path to the TXT file.
    mode : {None, str}
        The mode to open the file. Only accepts "r" or "rb" for reading.
    delimiter : str
        Delimiter to use for TXT file. Default is space-delimited.


Provides functions for reading/writing MCMC metadata to file.

    The functions here are common to both standard MCMC (in which chains
    are independent) and ensemble MCMC (in which chains/walkers share
    information).


Provides functions for reading/writing metadata to file for MCMCs in
    which all chains are independent of each other.

    Overrides the ``BaseInference`` file's ``thin_start`` and ``thin_interval``
    attributes. Instead of integers, these return arrays.


Provides functions for reading/writing metadata to file for ensemble
    MCMCs.


Class to handle file IO for the ``multinest`` sampler.


Class to handle file IO for the nested samplers cpnest and dynesty.


Base HDF class for all samplers.

    This adds abstract methods ``write_resume_point`` and
    ``write_sampler_metadata`` to :py:class:`BaseInferenceFile`.


Class to handle file IO for the ``nessai`` sampler.


Provides functions for reading/writing dynesty metadata to file.


Class to handle file IO for the ``dynesty`` sampler.


Class to handle file IO for the ``emcee`` sampler.


Argparse action that will load input files and print possible parameters
    to screen. Once this is done, the program is forced to exit immediately.

    The behvior is similar to --help, except that the input-file is read.

    .. note::
        The ``input_file`` attribute must be set in the parser namespace before
        this action is called. Otherwise, a ``NoInputFileError`` is raised.