Esempio n. 1
0
def test_planar4():
    bp = alib.planar_beam(0.0,
                          45.0,
                          60,
                          10,
                          az1=0.0,
                          el1=90.0,
                          a0=40.0,
                          I_0=10**4.3,
                          f=230e6)
    for phased_el in n.linspace(3, 90, num=10):
        bp.point(0.0, phased_el)
        gains = []
        els = n.linspace(0.0, 90.0, num=1000)
        for ei, e in enumerate(els):
            k = coord.azel_ecef(60.0, 10.0, 0.0, 0.0, e)
            g = bp.gain(k)
            gains.append(g)
        gains = n.array(gains)
        plt.plot(els, 10.0 * n.log10(gains), label="el=%1.2f" % (phased_el))

        plt.ylim([0, 50])
        plt.axvline(phased_el, color="black")
    plt.legend()
    plt.xlabel("Elevation angle (deg)")
    plt.ylabel("Gain (dB)")
    plt.title("Planar array gain as a function of pointing direction")
    plt.show()
Esempio n. 2
0
def test_planar2():
    el_phase = 30.0
    az_phase = 40.0
    B = n.zeros([500, 500])
    els = n.linspace(0, 90, num=500)
    azs = n.linspace(0, 360, num=500)
    bp = alib.planar_beam(az_phase,
                          el_phase,
                          60,
                          19,
                          az1=0.0,
                          el1=90.0,
                          a0=16.0,
                          I_0=10**4.3,
                          f=230e6)
    for ei, e in enumerate(els):
        for ai, a in enumerate(azs):
            k = coord.azel_ecef(60.0, 19.0, 0.0, a, e)
            B[ei, ai] = bp.gain(k)
    dB = 10.0 * n.log10(B)
    m = n.max(dB)
    plt.pcolormesh(azs, els, 10.0 * n.log10(B), vmin=m - 20.0, vmax=m)
    plt.axhline(el_phase)
    plt.axvline(az_phase)
    plt.colorbar()
    plt.show()
Esempio n. 3
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)
Esempio n. 4
0
def plot_beams():
    min_el = 80.0
    bp = alib.airy_beam(90.0, 90, 60, 19, f=930e6, I_0=10**4.3, a=16.0)
    gains = []
    els = n.linspace(min_el, 90.0, num=1000)
    for a in els:
        k = coord.azel_ecef(60.0, 19.0, 0.0, 90, a)
        gains.append(bp.gain(k))
    gains = n.array(gains)
    plt.plot(els, 10.0 * n.log10(gains), label="airy")

    bp = alib.cassegrain_beam(90.0,
                              90,
                              60,
                              19,
                              f=930e6,
                              I_0=10**4.3,
                              a0=16.0,
                              a1=4.58)
    gains = []
    for a in els:
        k = coord.azel_ecef(60.0, 19.0, 0.0, 90, a)
        gains.append(bp.gain(k))
    gains = n.array(gains)
    plt.plot(els, 10.0 * n.log10(gains), label="cassegrain")

    bp = alib.planar_beam(0,
                          90.0,
                          60,
                          19,
                          I_0=10**4.3,
                          f=233e6,
                          a0=40.0,
                          az1=0,
                          el1=90.0)
    gains = []
    for a in els:
        k = coord.azel_ecef(60.0, 19.0, 0.0, 90, a)
        gains.append(bp.gain(k))
    gains = n.array(gains)

    plt.plot(els, 10.0 * n.log10(gains), label="planar")
    plt.ylim([0, 50])

    plt.legend()
    plt.show()
Esempio n. 5
0
def test_planar3():
    S = n.zeros([100, 200])
    el_phase = 90.0
    bp = alib.planar_beam(0,
                          el_phase,
                          60,
                          19.0,
                          az1=0.0,
                          el1=el_phase,
                          a0=16.0,
                          I_0=10**4.3,
                          f=230e6)
    els = n.linspace(0, 90, num=100)
    azs = n.linspace(0, 360, num=200)

    for ei, e in enumerate(n.linspace(0, 90, num=100)):
        for ai, a in enumerate(n.linspace(0, 360, num=200)):
            k = coord.azel_ecef(60.0, 19.0, 0.0, a, e)
            S[ei, ai] = bp.gain(k)
    plt.pcolormesh(azs, els, 10.0 * n.log10(S), vmin=0, vmax=100)
    plt.axvline(el_phase)
    plt.colorbar()
    plt.show()
Esempio n. 6
0
#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/mov_test_v2'

#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.planar_beam(az0 = 0.0,el0 = 90.0,lat = 60,lon = 19,f=233e6,I_0=10**4.2,a0=40.0,az1=0,el1=90.0) )
e3d.set_beam('RX', alib.planar_beam(az0 = 0.0,el0 = 90.0,lat = 60,lon = 19,f=233e6,I_0=10**4.5,a0=40.0,az1=0,el1=90.0) )

#initialize the observing mode
e3d_scan = rslib.ns_fence_rng_model(min_el = 30.0, angle_step = 2.0, dwell_time = 0.1)

e3d_scan.set_radar_location(e3d)
e3d.set_scan(e3d_scan)

#load the input population
pop = p.filtered_master_catalog_factor(e3d,treshhold=1e-2,seed=12345,filter_name='e3d_planar_beam')
pop._objs = pop._objs[:2000,:]

sim = s.simulation( \
    radar = e3d,\
    population = pop,\
Esempio n. 7
0
sim_root = '/home/danielk/IRF/E3D_PA/SORTSpp_sim/sim_dev_sched_2scan'

#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=2.0, min_pair_SNRdb=1.0)
e3d.set_TX_bandwith(bw=1.0e6)
e3d.set_beam(
    'TX',
    alib.planar_beam(az0=0.0,
                     el0=90.0,
                     lat=60,
                     lon=19,
                     f=233e6,
                     I_0=10**4.2,
                     a0=40.0,
                     az1=0,
                     el1=90.0))
e3d.set_beam(
    'RX',
    alib.planar_beam(az0=0.0,
                     el0=90.0,
                     lat=60,
                     lon=19,
                     f=233e6,
                     I_0=10**4.5,
                     a0=40.0,
                     az1=0,
                     el1=90.0))
Esempio n. 8
0
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()
Esempio n. 9
0
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]),
    ))
Esempio n. 10
0
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
Esempio n. 11
0
def mock_radar():

    lat = 90.0
    lon = 0.0
    alt = 0.0

    rx_beam = alib.planar_beam(
        az0=0,
        el0=90,
        I_0=10**4.5,
        f=233e6,
        a0=40,
        az1=0.0,
        el1=90.0,
    )
    tx_beam = alib.planar_beam(
        az0=0,
        el0=90,
        I_0=10**4.5,
        f=233e6,
        a0=40,
        az1=0.0,
        el1=90.0,
    )

    rx = antenna.AntennaRX(
        name="Top",
        lat=lat,
        lon=lon,
        alt=alt,
        el_thresh=30,
        freq=233e6,
        rx_noise=120,
        beam=rx_beam,
    )

    scan = rslib.beampark_model(
        az=0.0,
        el=90.0,
        lat=lat,
        lon=lon,
        alt=alt,
    )

    tx = antenna.AntennaTX(
        name="Top TX",
        lat=lat,
        lon=lon,
        alt=alt,
        el_thresh=30,
        freq=233e6,
        rx_noise=120,
        beam=tx_beam,
        scan=scan,
        tx_power=5.0e6,
        tx_bandwidth=1e6,  # 1 MHz
        duty_cycle=0.25,
        pulse_length=30.0 * 64.0 * 1e-6,
        ipp=20e-3,
        n_ipp=10.0,
    )

    tx = [tx]
    rx = [rx]

    Mock = RadarSystem(tx, rx, 'Mock radar')
    Mock.set_FOV(max_on_axis=90.0, horizon_elevation=0.0)
    return Mock
Esempio n. 12
0
def mock_radar_mult():

    lat = [85.0, 89.0, 90.0, 89.0, 85.0]
    lon = [0, 90.0, 0, 270.0, 180]
    alt = 0.0
    tx_l = []
    rx_l = []

    for ind in range(5):
        rx_beam = alib.planar_beam(
            az0=0,
            el0=90,
            I_0=10**4.5,
            f=233e6,
            a0=40,
            az1=0.0,
            el1=90.0,
        )
        rx = antenna.AntennaRX(
            name="Top",
            lat=lat[ind],
            lon=lon[ind],
            alt=alt,
            el_thresh=30,
            freq=233e6,
            rx_noise=120,
            beam=rx_beam,
        )
        rx_l.append(rx)

    lat = [90.0, 87.0]
    lon = [0, 0.0]

    for ind in range(2):
        tx_beam = alib.planar_beam(
            az0=0,
            el0=90,
            I_0=10**4.5,
            f=233e6,
            a0=40,
            az1=0.0,
            el1=90.0,
        )

        scan = rslib.beampark_model(
            az=0.0,
            el=90.0,
            lat=lat[ind],
            lon=lon[ind],
            alt=alt,
        )

        tx = antenna.AntennaTX(
            name="Top TX",
            lat=lat[ind],
            lon=lon[ind],
            alt=alt,
            el_thresh=30,
            freq=233e6,
            rx_noise=120,
            beam=tx_beam,
            scan=scan,
            tx_power=5.0e6,
            tx_bandwidth=1e6,  # 1 MHz
            duty_cycle=0.25,
            pulse_length=30.0 * 64.0 * 1e-6,
            ipp=20e-3,
            n_ipp=10.0,
        )
        tx_l.append(tx)

    Mock = RadarSystem(tx_l, rx_l, 'bIG Mock radar')
    Mock.set_FOV(max_on_axis=90.0, horizon_elevation=0.0)
    return Mock