def plot_e3d_beam_stering(): e3dv = [] e3dv.append(alib.e3d_array_beam(az0=0.0, el0=90.0)) e3dv.append(alib.e3d_array_beam(az0=0.0, el0=60.0)) e3dv.append(alib.e3d_array_beam(az0=0.0, el0=30.0)) antenna.plot_gains(e3dv, min_el=0)
def plot_compare_library_beams(): min_el = 80 e3d = alib.e3d_array_beam(az0=0.0, el0=90.0, I_0=10**4.3) bp1 = alib.airy_beam(az0=0.0, el0=90.0, lat=60, lon=19, f=233e6, I_0=10**4.3, a=40.0) bp2 = alib.cassegrain_beam(az0=0.0, el0=90.0, lat=60, lon=19, f=233e6, I_0=10**4.3, a0=80.0, a1=80.0 / 16.0 * 2.29) bp3 = alib.planar_beam(az0=0.0, el0=90.0, lat=60, lon=19, f=233e6, I_0=10**4.3, a0=40.0, az1=0, el1=90.0) antenna.plot_gains([bp1, bp2, bp3, e3d], min_el=min_el)
#SORTS Libraries import radar_library as rl import radar_scan_library as rslib import scheduler_library as sch import antenna_library as alib sim_root = '/home/danielk/IRF/E3D_PA/SORTSpp_sim/piggyback_test' #initialize the radar setup e3d = rl.eiscat_3d() e3d.set_FOV(max_on_axis=25.0,horizon_elevation=30.0) e3d.set_SNR_limits(min_total_SNRdb=10.0,min_pair_SNRdb=0.0) e3d.set_TX_bandwith(bw = 1.0e6) e3d.set_beam('TX', alib.e3d_array_beam_stage1(opt='dense') ) e3d.set_beam('RX', alib.e3d_array_beam() ) #initialize the observing mode e3d_scan = rslib.ns_fence_rng_model(min_el = 30.0, angle_step = 2.0, dwell_time = 0.2) #3 by 3 grid at 300km az_points = n.arange(0,360,45).tolist() + [0.0]; el_points = [90.0-n.arctan(50.0/300.0)*180.0/n.pi, 90.0-n.arctan(n.sqrt(2)*50.0/300.0)*180.0/n.pi]*4+[90.0]; e3d_ionosphere = rslib.n_const_pointing_model(az_points,el_points,len(az_points), dwell_time = 7.5) e3d_scan.set_radar_location(e3d) e3d.set_scan(SST=e3d_scan,secondary_list=[e3d_ionosphere]) #load the input population pop = p.filtered_master_catalog_factor(e3d,treshhold=1e-2,seed=12345,filter_name='e3d_full_beam') pop._objs = pop._objs[:2000,:]
plt.show() exit() beams = [ alib.e3d_array_beam_interp(az0=0, el0=el, I_0=10**4.5) for el in np.linspace(90.0, 30.0, num=4) ] antenna.plot_gains(beams,res=1000,min_el = 0.0) plt.show() exit() beams = [ alib.planar_beam(az0=0., el0=90., I_0=4.5**10, f=366e6, a0=40., az1=0., el1=90.), alib.cassegrain_beam(az0=0., el0=90., I_0=4.5**10, f=940e6, a0=40., a1=20.), alib.uhf_beam(az0=0., el0=90., I_0=4.5**10, f=266e6), alib.e3d_array_beam_stage1(az0=0, el0=90.0, I_0=10**4.2), alib.e3d_array_beam_stage1(az0=0, el0=90.0, I_0=10**4.2, opt='sparse'), alib.e3d_array_beam(az0=0, el0=90.0, I_0=10**4.5), ] #test for peak gain on axis is max #test for lambda 3db loss for beam in beams: plot_gain_heatmap(beam, res=100, min_el = 75.) plt.show()
def time_compare_library_beams(): e3d = alib.e3d_array_beam(az0=0.0, el0=90.0, I_0=10**4.3) bp1 = alib.airy_beam(az0=0.0, el0=90.0, lat=60, lon=19, f=233e6, I_0=10**4.3, a=40.0) bp2 = alib.cassegrain_beam(az0=0.0, el0=90.0, lat=60, lon=19, f=233e6, I_0=10**4.3, a0=80.0, a1=80.0 / 16.0 * 2.29) bp3 = alib.planar_beam(az0=0.0, el0=90.0, lat=60, lon=19, f=233e6, I_0=10**4.3, a0=40.0, az1=0, el1=90.0) import time k = coord.azel_ecef(e3d.lat, e3d.lon, 0.0, 0, 87.0) test_n = 500 t = n.zeros((test_n, 4)) for i in range(test_n): t0 = time.clock() g = e3d.gain(k) t[i, 0] = time.clock() - t0 t0 = time.clock() g = bp1.gain(k) t[i, 1] = time.clock() - t0 t0 = time.clock() g = bp2.gain(k) t[i, 2] = time.clock() - t0 t0 = time.clock() g = bp3.gain(k) t[i, 3] = time.clock() - t0 print('Exec time %s: mean %.5f s, std %.5f s' % ( e3d.beam_name, n.mean(t[:, 0]), n.std(t[:, 0]), )) print('Exec time %s: mean %.5f s, std %.5f s' % ( bp1.beam_name, n.mean(t[:, 1]), n.std(t[:, 1]), )) print('Exec time %s: mean %.5f s, std %.5f s' % ( bp2.beam_name, n.mean(t[:, 2]), n.std(t[:, 2]), )) print('Exec time %s: mean %.5f s, std %.5f s' % ( bp3.beam_name, n.mean(t[:, 3]), n.std(t[:, 3]), )) print('Exec time %s vs %s: mean %.5f, std %.5f' % ( e3d.beam_name, bp3.beam_name, n.mean(t[:, 0]) / n.mean(t[:, 3]), n.std(t[:, 0]) / n.std(t[:, 3]), ))
def plot_e3d_stages(): e3d1 = alib.e3d_array_beam_stage1(opt='sparse') e3d2 = alib.e3d_array_beam_stage1(opt='dense') e3d3 = alib.e3d_array_beam() antenna.plot_gains([e3d1, e3d2, e3d3], min_el=80.0)
print('Exec time %s vs %s: mean %.5f, std %.5f' % ( e3d.beam_name, bp3.beam_name, n.mean(t[:, 0]) / n.mean(t[:, 3]), n.std(t[:, 0]) / n.std(t[:, 3]), )) if __name__ == "__main__": print('entered') #import DEV_antenna as da # plot_compare_eiscat_beams() plot_compare_esr_beams() exit(0) # plot_beams() #plot_e3d() #test_planar() #test_planar2() #test_planar3() #test_planar4() #plot_e3d_stages() #plot_e3d_beam_stering() #plot_e3d_antennas() #time_compare_library_beams() e3d = alib.e3d_array_beam() antenna.plot_gain3d(e3d, res=100, min_el=85)
def eiscat_3d(beam='interp', stage=1): '''The EISCAT_3D system. For more information see: * `EISCAT <https://eiscat.se/>`_ * `EISCAT 3D <https://www.eiscat.se/eiscat3d/>`_ :param str beam: Decides what initial antenna radiation-model to use. :param int stage: The stage of development of EISCAT 3D. **EISCAT 3D Stages:** * Stage 1: As of writing it is assumed to have all of the antennas in place but only transmitters on half of the antennas in a dense core ,i.e. TX will have 42 dB peak gain while RX still has 45 dB peak gain. 3 Sites will exist, one is a TX and RX, the other 2 RX sites. * Stage 2: Both TX and RX sites will have 45 dB peak gain. * Stage 3: (NOT IMPLEMENTED HERE) 2 additional RX sites will be added. **Beam options:** * gauss: Gaussian tapered beam model :func:`antenna_library.planar_beam`. * interp: Interpolated array pattern. * array: Ideal summation of all antennas in the array :func:`antenna_library.e3d_array_beam_stage1` and :func:`antenna_library.e3d_array_beam`. # TODO: Geographical location measured with? Probably WGS84. ''' e3d_freq = 233e6 if stage == 1: e3d_tx_gain = 10**4.3 a0_tx = 20.0 elif stage == 2: e3d_tx_gain = 10**4.5 a0_tx = 40.0 else: raise Exception('Stage "{}" not recognized.'.format(stage)) e3d_rx_gain = 10**4.5 if beam == 'gauss': tx_beam_ski = alib.planar_beam( az0=0, el0=90, I_0=e3d_tx_gain, f=e3d_freq, a0=a0_tx, az1=0.0, el1=90.0, ) rx_beam_ski = alib.planar_beam( az0=0, el0=90, I_0=e3d_rx_gain, f=e3d_freq, a0=40.0, az1=0.0, el1=90.0, ) rx_beam_kar = alib.planar_beam( az0=0, el0=90, I_0=e3d_rx_gain, f=e3d_freq, a0=40.0, az1=0.0, el1=90.0, ) rx_beam_kai = alib.planar_beam( az0=0, el0=90, I_0=e3d_rx_gain, f=e3d_freq, a0=40.0, az1=0.0, el1=90.0, ) elif beam == 'array': if stage == 1: tx_beam_ski = alib.e3d_array_beam_stage1( az0=0, el0=90, I_0=e3d_tx_gain, opt='dense', ) elif stage == 2: tx_beam_ski = alib.e3d_array_beam( az0=0, el0=90, I_0=e3d_tx_gain, ) rx_beam_ski = alib.e3d_array_beam( az0=0, el0=90, I_0=e3d_rx_gain, ) rx_beam_kar = alib.e3d_array_beam( az0=0, el0=90, I_0=e3d_rx_gain, ) rx_beam_kai = alib.e3d_array_beam( az0=0, el0=90, I_0=e3d_rx_gain, ) elif beam == 'interp': if stage == 1: tx_beam_ski = alib.e3d_array_beam_stage1_dense_interp( az0=0, el0=90, I_0=e3d_tx_gain, ) elif stage == 2: tx_beam_ski = alib.e3d_array_beam_interp( az0=0, el0=90, I_0=e3d_tx_gain, ) rx_beam_ski = alib.e3d_array_beam_interp( az0=0, el0=90, I_0=e3d_rx_gain, ) rx_beam_kar = alib.e3d_array_beam_interp( az0=0, el0=90, I_0=e3d_rx_gain, ) rx_beam_kai = alib.e3d_array_beam_interp( az0=0, el0=90, I_0=e3d_rx_gain, ) else: raise Exception('Beam model "{}" not recognized.'.format(beam)) ski_lat = 69.34023844 ski_lon = 20.313166 ski_alt = 0.0 ski = antenna.AntennaRX( name="Skibotn", lat=ski_lat, lon=ski_lon, alt=ski_alt, el_thresh=30, freq=e3d_freq, rx_noise=150, beam=rx_beam_ski, ) dwell_time = 0.1 scan = rslib.ew_fence_model( lat=ski_lat, lon=ski_lon, alt=ski_alt, min_el=30, angle_step=1.0, dwell_time=dwell_time, ) ski_tx = antenna.AntennaTX( name="Skibotn TX", lat=ski_lat, lon=ski_lon, alt=ski_alt, el_thresh=30, freq=e3d_freq, rx_noise=150, beam=tx_beam_ski, scan=scan, tx_power=5e6, # 5 MW tx_bandwidth=100e3, # 100 kHz tx bandwidth duty_cycle=0.25, # 25% duty-cycle pulse_length=1920e-6, ipp=10e-3, n_ipp=int(dwell_time / 10e-3), ) kar_lat = 68.463862 kar_lon = 22.458859 kar_alt = 0.0 kar = antenna.AntennaRX( name="Karesuvanto", lat=kar_lat, lon=kar_lon, alt=kar_alt, el_thresh=30, freq=e3d_freq, rx_noise=150, beam=rx_beam_kar, ) kai_lat = 68.148205 kai_lon = 19.769894 kai_alt = 0.0 kai = antenna.AntennaRX( name="Kaiseniemi", lat=kai_lat, lon=kai_lon, alt=kai_alt, el_thresh=30, freq=e3d_freq, rx_noise=150, beam=rx_beam_kai, ) # define transmit and receive antennas for a radar network. tx = [ski_tx] rx = [ski, kar, kai] if stage > 1: name = 'EISCAT 3D stage {}'.format(stage) else: name = 'EISCAT 3D' e3d = RadarSystem( tx_lst=tx, rx_lst=rx, name=name, max_on_axis=15.0, min_SNRdb=1.0, ) e3d.set_SNR_limits(10.0, 10.0) return e3d