added pulse_envelope convenience function
This commit is contained in:
11
tests/test_pulse.py
Normal file
11
tests/test_pulse.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user