peng/wave_functions.py
def subwave(wave, dep_name=None, indep_min=None, indep_max=None, indep_step=None):
    r"""
    Return a waveform that is a sub-set of a waveform, potentially re-sampled.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param  dep_name: Independent variable name
    :type   dep_name: `NonNullString <https://pexdoc.readthedocs.io/en/stable/
                        ptypes.html#nonnullstring>`_

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :param indep_step: Independent vector step
    :type  indep_step: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.subwave

    :raises:
     * RuntimeError (Argument \`dep_name\` is not valid)

     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`indep_step\` is greater than independent
       vector range)

     * RuntimeError (Argument \`indep_step\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]
    """
    ret = copy.copy(wave)
    if dep_name is not None:
        ret.dep_name = dep_name
    _bound_waveform(ret, indep_min, indep_max)
    pexdoc.addai("indep_step", bool((indep_step is not None) and (indep_step <= 0)))
    exmsg = "Argument `indep_step` is greater than independent vector range"
    cond = bool(
        (indep_step is not None)
        and (indep_step > ret._indep_vector[-1] - ret._indep_vector[0])
    )
    pexdoc.addex(RuntimeError, exmsg, cond)
    if indep_step:
        indep_vector = _barange(indep_min, indep_max, indep_step)
        dep_vector = _interp_dep_vector(ret, indep_vector)
        ret._set_indep_vector(indep_vector, check=False)
        ret._set_dep_vector(dep_vector, check=False)
    return ret
def subwave(wave, dep_name=None, indep_min=None, indep_max=None, indep_step=None):
    r"""
    Return a waveform that is a sub-set of a waveform, potentially re-sampled.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param  dep_name: Independent variable name
    :type   dep_name: `NonNullString <https://pexdoc.readthedocs.io/en/stable/
                        ptypes.html#nonnullstring>`_

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :param indep_step: Independent vector step
    :type  indep_step: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.subwave

    :raises:
     * RuntimeError (Argument \`dep_name\` is not valid)

     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`indep_step\` is greater than independent
       vector range)

     * RuntimeError (Argument \`indep_step\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]
    """
    ret = copy.copy(wave)
    if dep_name is not None:
        ret.dep_name = dep_name
    _bound_waveform(ret, indep_min, indep_max)
    pexdoc.addai("indep_step", bool((indep_step is not None) and (indep_step <= 0)))
    exmsg = "Argument `indep_step` is greater than independent vector range"
    cond = bool(
        (indep_step is not None)
        and (indep_step > ret._indep_vector[-1] - ret._indep_vector[0])
    )
    pexdoc.addex(RuntimeError, exmsg, cond)
    if indep_step:
        indep_vector = _barange(indep_min, indep_max, indep_step)
        dep_vector = _interp_dep_vector(ret, indep_vector)
        ret._set_indep_vector(indep_vector, check=False)
        ret._set_dep_vector(dep_vector, check=False)
    return ret
def subwave ( wave , dep_name = None , indep_min = None , indep_max = None , indep_step = None ) : ret = copy . copy ( wave ) if dep_name is not None : ret . dep_name = dep_name _bound_waveform ( ret , indep_min , indep_max ) pexdoc . addai ( "indep_step" , bool ( ( indep_step is not None ) and ( indep_step <= 0 ) ) ) exmsg = "Argument `indep_step` is greater than independent vector range" cond = bool ( ( indep_step is not None ) and ( indep_step > ret . _indep_vector [ - 1 ] - ret . _indep_vector [ 0 ] ) ) pexdoc . addex ( RuntimeError , exmsg , cond ) if indep_step : indep_vector = _barange ( indep_min , indep_max , indep_step ) dep_vector = _interp_dep_vector ( ret , indep_vector ) ret . _set_indep_vector ( indep_vector , check = False ) ret . _set_dep_vector ( dep_vector , check = False ) return ret
r"""
    Return a waveform that is a sub-set of a waveform, potentially re-sampled.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param  dep_name: Independent variable name
    :type   dep_name: `NonNullString <https://pexdoc.readthedocs.io/en/stable/
                        ptypes.html#nonnullstring>`_

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :param indep_step: Independent vector step
    :type  indep_step: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.subwave

    :raises:
     * RuntimeError (Argument \`dep_name\` is not valid)

     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`indep_step\` is greater than independent
       vector range)

     * RuntimeError (Argument \`indep_step\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]
r Return a waveform that is a sub - set of a waveform potentially re - sampled .