12 lines
307 B
Python
12 lines
307 B
Python
import numpy as np
|
|
import pytest
|
|
|
|
import scgenerator as sc
|
|
|
|
|
|
def test_pulse_envelope():
|
|
t = np.linspace(-100, 100, 2049)
|
|
|
|
assert np.trapz(sc.pulse.pulse_envelope(t, 10, energy=3) ** 2, x=t) == pytest.approx(3)
|
|
assert (sc.pulse.pulse_envelope(t, 10, peak_power=3) ** 2).max() == pytest.approx(3)
|