Note
Click here to download the full example code
Radar controller return copyΒΆ
Out:
Passing a copy to "Tracker" ensures the tracker has its own copy of the radar
eiscat3d.tx.pointing : [2.24951054e-01 1.37742794e-17 9.74370065e-01]
tcontroller.radar.tx.pointing: [0.000000e+00 6.123234e-17 1.000000e+00]
using "return_copy" ensures that the returned radar from the controller is always its own object
tcontroller.radar.tx.pointing: [0.000000e+00 6.123234e-17 1.000000e+00]
radar.tx.pointing : [ 0.3280197 -0.17268885 0.92875273]
edit tcontroller.radar
eiscat3d.tx.pointing : [ 0.62296654 -0.3596699 0.69465837]
tcontroller.radar.tx.pointing: [ 0.62296654 -0.3596699 0.69465837]
radar.tx.pointing : [ 0.3280197 -0.17268885 0.92875273]
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pyorb
import sorts
eiscat3d = sorts.radars.eiscat3d
from sorts.controller import Tracker
from sorts.propagator import SGP4
prop = SGP4(
settings = dict(
out_frame='ITRF',
),
)
orb = pyorb.Orbit(M0 = pyorb.M_earth, direct_update=True, auto_update=True, degrees = True, a=6700e3, e=0, i=75, omega=0, Omega=80, anom=72)
t = np.linspace(0,120,num=10)
mjd0 = 53005
states = prop.propagate(t, orb.cartesian[:,0], mjd0, A=1.0, C_R = 1.0, C_D = 1.0)
tcontroller = Tracker(radar=eiscat3d.copy(), t=t, ecefs=states[:3,:], return_copy=True)
eiscat3d.tx[0].beam.sph_point(azimuth=90, elevation=77)
print('Passing a copy to "Tracker" ensures the tracker has its own copy of the radar')
print(f'eiscat3d.tx.pointing : {eiscat3d.tx[0].beam.pointing}')
print(f'tcontroller.radar.tx.pointing: {tcontroller.radar.tx[0].beam.pointing} \n\n')
print('using "return_copy" ensures that the returned radar from the controller is always its own object')
for radar, meta in tcontroller([t[3]]):
print(f'tcontroller.radar.tx.pointing: {tcontroller.radar.tx[0].beam.pointing}')
print(f'radar.tx.pointing : {radar.tx[0].beam.pointing}')
print('\n edit tcontroller.radar\n')
tcontroller.radar.tx[0].beam.sph_point(azimuth=120, elevation=44)
eiscat3d.tx[0].beam.sph_point(azimuth=120, elevation=44)
print(f'eiscat3d.tx.pointing : {eiscat3d.tx[0].beam.pointing}')
print(f'tcontroller.radar.tx.pointing: {tcontroller.radar.tx[0].beam.pointing}')
print(f'radar.tx.pointing : {radar.tx[0].beam.pointing}')
Total running time of the script: ( 0 minutes 0.071 seconds)