Skip to content

Commit 81ddf81

Browse files
committed
fix(antenna): Fixed gain calculation in Cosine Antenna Element
1 parent cf8f85b commit 81ddf81

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sharc/antenna/antenna_element_cosine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def calculate_gain(self, *args, **kwargs) -> np.array:
3737
"""
3838
theta_rad = np.deg2rad(np.absolute(kwargs["off_axis_angle_vec"]))
3939
theta_rad = np.minimum(theta_rad, np.pi / 2 - 1e-5)
40-
return np.log10(np.cos(theta_rad))
40+
return 10 * np.log10(np.cos(theta_rad))
4141

4242

4343
if __name__ == '__main__':
4444
import matplotlib.pyplot as plt
4545

46-
theta = np.linspace(0.01, 90, num=1000)
46+
theta = np.linspace(0.01, 90.01, num=1000)
4747
antenna = AntennaElementCosine()
4848
gain = antenna.calculate_gain(off_axis_angle_vec=theta)
4949
fig = plt.figure(facecolor='w', edgecolor='k')
@@ -54,5 +54,5 @@ def calculate_gain(self, *args, **kwargs) -> np.array:
5454
ax.set_xlabel(r"Off-axis angle $\theta$ [deg]")
5555
ax.set_ylabel("Antenna Gain [dBi]")
5656
ax.set_xlim((theta[0], theta[-1]))
57-
ax.set_ylim((-80, 10))
57+
ax.set_ylim((-40, 10))
5858
plt.show()

0 commit comments

Comments
 (0)