In [1]:
import radarsimpy
radarsimpy.__version__
Out[1]:
'10.0.0'

RCS of a corner reflector¶



This is example shows how to use RadarSimPy to simulate the RCS of an object based on its 3D model.


The corner reflector model is with .stl. It can be imported by using meshio module.

In [2]:
import meshio

import plotly.graph_objs as go
from IPython.display import SVG, display

mesh_data = meshio.read('../models/cr.stl')

fig = go.Figure()

fig.add_trace(go.Mesh3d(x=mesh_data.points[:, 0],
                        y=mesh_data.points[:, 1],
                        z=mesh_data.points[:, 2],
                        i=mesh_data.cells[0].data[:, 0],
                        j=mesh_data.cells[0].data[:, 1],
                        k=mesh_data.cells[0].data[:, 2],
                        intensity=mesh_data.points[:, 2],
                        colorscale='Viridis'
                        ))

# fig.show()
display(SVG(fig.to_image(format='svg', scale=1)))
−0.04−0.0200.020.040.060.08

RCS vs frequency¶

Define the basic parameters required in ray tracing.

  • Observation angle phi (Degree)
  • Observation angle theta (Degree)
  • Frequency freq (Hz)
  • Polarization pol
  • Ray density density (number of rays per wavelength)
In [3]:
import time
import numpy as np

from radarsimpy.rt import rcs_sbr

phi = 0
theta = 90
freq = np.arange(1, 79, 1)*1e9
pol = [0, 1, 0]
density = 10

rcs = np.zeros_like(freq)

tic = time.time()
for f_idx, f in enumerate(freq):
    rcs[f_idx] = 10*np.log10(
        rcs_sbr('../models/cr.stl',
                f,
                phi,
                theta,
                pol=pol,
                density=density))
toc = time.time()

print('Exec time :'+str(toc-tic) + 's')
Exec time :13.936949491500854s
In [4]:
fig = go.Figure()

fig.add_trace(go.Scatter(x=freq/1e9, y=rcs))

fig.update_layout(
    # title='RCS vs Frequency',
    template="seaborn",
    yaxis=dict(title='RCS (dBsm)'),
    xaxis=dict(title='Frequency (GHz)', dtick=10),
)

# fig.show()
display(SVG(fig.to_image(format='svg', height=400, width=600)))
# fig.write_image('rcs_vs_freq.svg', height=400, width=600)
10203040506070−20−10010Frequency (GHz)RCS (dBsm)

RCS vs observation angle¶

In [5]:
phi = np.arange(-90, 90, 0.5)
theta = 90
freq = 77e9
pol = [0, 0, 1]
density = 1

rcs = np.zeros_like(phi)

tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
    rcs[phi_idx] = 10 * np.log10(
        rcs_sbr('../models/cr.stl',
                freq,
                phi_ang,
                theta,
                pol=pol,
                density=density))
toc = time.time()

print('Exec time :'+str(toc-tic) + 's')
Exec time :36.52792453765869s
In [6]:
fig = go.Figure()

fig.add_trace(go.Scatter(x=phi, y=rcs))

fig.update_layout(
    # title='RCS vs Observation Angle',
    template="seaborn",
    yaxis=dict(title='RCS (dBsm)'),
    xaxis=dict(title='Observation angle (Degree)', dtick=20),
)

# fig.show()
display(SVG(fig.to_image(format='svg', scale=1, height=400, width=600)))
# fig.write_image('rcs_vs_angle.svg', height=400, width=600)
−80−60−40−20020406080−60−40−200Observation angle (Degree)RCS (dBsm)
In [ ]: