def test_ebeam_dc_halfring_straight(self): d1 = siepic.ebeam_dc_halfring_straight( gap=30e-9, radius=3e-6, width=520e-9, thickness=210e-9 ) d2 = ebeam.ebeam_dc_halfring_te1550() s1 = d1.s_parameters(f) s2 = np.transpose(d2.s_parameters(f), (0, 2, 1)) assert np.allclose(s1, s2)
assert isinstance( pins, (tuple, set, list)), f"pins {pins} need to be a tuple, set or list" for pin in pins: assert pin in c.pins, f"{pin} not in {c.pins}" for i, pin in enumerate(c.pins): if pin in pins: plt.plot(wavelengths * 1e9, function(s[:, i, 0]), label=label or pin) plt.xlabel("wavelength (nm)") if function == magnitude_square_per_cent: plt.ylabel("S (%)") elif function == logscale: plt.ylabel("S (dB)") if __name__ == "__main__": from simphony.library import siepic wavelengths = np.linspace(1520, 1570, 1024) * 1e-9 coupler = siepic.ebeam_dc_halfring_straight(gap=200e-9, radius=10e-6, width=500e-9, thickness=220e-9, couple_length=0.0) plot_sparameters(coupler, wavelengths) plt.legend() plt.show()