Skip to content

Commit 631031d

Browse files
committed
Update sim_rcs parameter types and docstrings
Changed default value of 'density' to 1.0 and updated docstrings to clarify that angle parameters (inc_phi, inc_theta, obs_phi, obs_theta) can accept scalars or arrays. Also updated return type documentation to indicate the function may return a float or numpy array depending on input.
1 parent 25db734 commit 631031d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/radarsimpy/simulator_rcs.pyx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ cpdef sim_rcs(
5555
obs_phi=None,
5656
obs_theta=None,
5757
obs_pol=None,
58-
density=1
58+
density=1.0
5959
):
6060
"""Calculate the Radar Cross Section (RCS) of targets using the Shooting and Bouncing Rays (SBR) method.
6161
@@ -85,22 +85,26 @@ cpdef sim_rcs(
8585
8686
:param float f:
8787
The center frequency of the incident electromagnetic wave in Hertz (Hz).
88-
:param float inc_phi:
88+
:param float or array_like inc_phi:
8989
The horizontal incidence angle (phi) of the incoming wave in degrees (°).
9090
This angle is measured relative to the target at the transmitter's point of view.
91-
:param float inc_theta:
91+
Can be a single value or an array of values.
92+
:param float or array_like inc_theta:
9293
The vertical incidence angle (theta) of the incoming wave in degrees (°).
9394
This angle is measured relative to the target at the transmitter's point of view.
95+
Can be a single value or an array of values.
9496
:param list[float] inc_pol:
9597
The polarization of the incident wave, specified as a 3D vector [x, y, z].
9698
Default: ``[0, 0, 1]`` (vertical polarization).
97-
:param float obs_phi:
99+
:param float or array_like obs_phi:
98100
The horizontal observation angle (phi) in degrees (°).
99101
This is the angle at which the RCS is observed from the observer's point of view.
102+
Can be a single value or an array of values.
100103
Default: ``None`` (if not specified, it is set to the same value as `inc_phi`).
101-
:param float obs_theta:
104+
:param float or array_like obs_theta:
102105
The vertical observation angle (theta) in degrees (°).
103106
This is the angle at which the RCS is observed from the observer's point of view.
107+
Can be a single value or an array of values.
104108
Default: ``None`` (if not specified, it is set to the same value as `inc_theta`).
105109
:param list[float] obs_pol:
106110
The polarization of the observer, specified as a 3D vector [x, y, z].
@@ -112,9 +116,10 @@ cpdef sim_rcs(
112116
113117
:return:
114118
The Radar Cross Section (RCS) of the target(s) in square meters (m²).
119+
Returns a single float value if input angles are scalars, or a numpy array if input angles are arrays.
115120
To convert the result to decibels relative to one square meter (dBsm), use:
116121
``10 * log10(RCS)``.
117-
:rtype: float
122+
:rtype: float or numpy.ndarray
118123
"""
119124
if IsFreeTier():
120125
if len(targets) > 3:

0 commit comments

Comments
 (0)