コード例 #1
0
ファイル: DEV_radar_scan_lib.py プロジェクト: zzwei1/SORTSpp
def sph_random_plot():
    scan = rslib.sph_rng_model(lat=69.,
                               lon=19.,
                               alt=150.,
                               min_el=30,
                               dwell_time=0.1)
    plot_radar_scan(scan, earth=True)
    plt.show()
コード例 #2
0
ファイル: DEV_radar_scan_lib.py プロジェクト: zzwei1/SORTSpp
def flat_grid_plot():
    scan = rslib.flat_grid_model(lat=69.,
                                 lon=19.,
                                 alt=150.,
                                 n_side=5,
                                 height=300e3,
                                 side_len=200e3,
                                 dwell_time=0.1)
    plot_radar_scan(scan, earth=True)
    plt.show()
コード例 #3
0
ファイル: DEV_radar_scan_lib.py プロジェクト: zzwei1/SORTSpp
def n_beampark_plot():
    az_points = np.arange(0., 360., 60.).tolist()
    el_points = np.linspace(80., 90., num=len(az_points)).tolist()
    scan = rslib.n_const_pointing_model(az=az_points,
                                        el=el_points,
                                        lat=69.,
                                        lon=19.,
                                        alt=150.,
                                        dwell_time=0.1)

    plot_radar_scan(scan, earth=True)
    plt.show()
コード例 #4
0
def plot_detections(radar, space_o, t_end=24.0 * 3600.0):

    t = np.linspace(0, t_end, num=10000)

    detections = simulate_scan.get_detections(space_o, radar, 0.0, t_end)
    simulate_scan.pp_det(detections)

    detections = detections[0]

    passes = np.unique(np.array(detections['t0']))

    print('{} detections of object'.format(len(detections['tm'])))
    print('detection on {} passes'.format(len(passes)))

    ecefs1 = space_o.get_state(t)

    fig = plt.figure(figsize=(15, 15))
    ax = fig.add_subplot(111, projection='3d')
    plothelp.draw_earth_grid(ax)

    radar_scans.plot_radar_scan(radar._tx[0].scan, earth=True, ax=ax)

    ax.plot(ecefs1[0, :],
            ecefs1[1, :],
            ecefs1[2, :],
            "-",
            color="green",
            alpha=0.5)

    for det in detections['tm']:
        ecefs2 = space_o.get_state([det])
        ax.plot(ecefs2[0, :],
                ecefs2[1, :],
                ecefs2[2, :],
                ".",
                color="red",
                alpha=0.5)
        ax.plot(
            [radar._tx[0].ecef[0], ecefs2[0, 0]],
            [radar._tx[0].ecef[1], ecefs2[1, 0]],
            [radar._tx[0].ecef[2], ecefs2[2, 0]],
            "-",
            color="red",
            alpha=0.1,
        )

    box = 1000e3

    ax.set_xlim([radar._tx[0].ecef[0] - box, radar._tx[0].ecef[0] + box])
    ax.set_ylim([radar._tx[0].ecef[1] - box, radar._tx[0].ecef[1] + box])
    ax.set_zlim([radar._tx[0].ecef[2] - box, radar._tx[0].ecef[2] + box])
コード例 #5
0
ファイル: DEV_radar_scan_lib.py プロジェクト: zzwei1/SORTSpp
def leak_proof():

    beam_width = 1.26  #deg
    max_sat_speed = 8e3  #m/s
    leak_proof_at = 350e3  #altitude

    els = [
        '90.0', '88.73987398739877', '87.4357183693167', '86.1720061939742',
        '84.90239189256025', '83.628529014365', '82.35204237515919',
        '81.07452478944677', '79.77710211752762', '78.47281161299796',
        '77.16391480976668', '75.83375939658995', '74.49527977424731',
        '73.13358804398229', '71.753175185289', '70.3584796645483',
        '68.93771910430019', '67.48130276816576', '65.99689473774336',
        '64.48487395668005', '62.93289943117691', '61.33878768753357',
        '59.69647098103616', '57.99766296011879', '56.23923388331565',
        '54.40755219009088', '52.44010673902446', '50.4247836215483',
        '48.29222295539205', '46.01278403125778', '43.55617730018973',
        '40.8717857555977', '37.886094818016815', '34.478961143266076', '30.0'
    ]

    els = els[:5]
    print('MIN_EL = {:.4f}'.format(float(els[-1])))
    els = [float(el) for el in els]
    azs = [-180.0] * (len(els) - 1) + [0.0] * len(els)
    els = els[1:][::-1] + els

    dwell_time = []
    for el in els:

        beam_arc_len = np.radians(beam_width) * leak_proof_at / np.sin(
            np.radians(el))
        sat_traverse_time = beam_arc_len / max_sat_speed  #also max scan time
        #print('sat_traverse_time: {:.4f} s'.format(sat_traverse_time))
        dwell_time.append(sat_traverse_time / float(len(azs)))

    print(dwell_time)

    scan = rslib.n_dyn_dwell_pointing_model(
        az=azs,
        el=els,
        dwells=dwell_time,
        lat=69.,
        lon=19.,
        alt=150.,
    )
    plot_radar_scan(scan, earth=True)
    plt.show()
コード例 #6
0
ファイル: radar_config.py プロジェクト: zzwei1/SORTSpp
def plot_radar(radar, save_folder=None):
    '''Plots aspects of the radar system.

    **Current plots:**

       * Geographical locations.
       * Antenna patterns.
       * Scan patterns.
    '''

    for tx in radar._tx:
        fig, ax = rs.plot_radar_scan(tx.scan, earth=True)
        if save_folder is not None:
            fig.savefig(save_folder + '/' + tx.name.replace(' ', '_') +
                        '_scan.png',
                        bbox_inches='tight')
            plt.close(fig)

    for tx in radar._tx:
        fig, ax = antenna.plot_gain_heatmap(tx.beam,
                                            res=200,
                                            min_el=75.0,
                                            title=tx.name)
        if save_folder is not None:
            fig.savefig(save_folder + '/' + tx.name.replace(' ', '_') + '_' +
                        tx.beam.beam_name.replace(' ', '_') + '.png',
                        bbox_inches='tight')
            plt.close(fig)

    for rx in radar._rx:
        fig, ax = antenna.plot_gain_heatmap(rx.beam,
                                            res=200,
                                            min_el=75.0,
                                            title=rx.name)
        if save_folder is not None:
            fig.savefig(save_folder + '/' + rx.name.replace(' ', '_') + '_' +
                        rx.beam.beam_name.replace(' ', '_') + '.png',
                        bbox_inches='tight')
            plt.close(fig)

    fig, ax = plot_radar_geo(radar)
    if save_folder is not None:
        fig.savefig(save_folder + '/' + radar.name.replace(' ', '_') + '.png',
                    bbox_inches='tight')
        plt.close(fig)

    if save_folder is None:
        plt.show()
コード例 #7
0
ファイル: DEV_radar_scan_lib.py プロジェクト: zzwei1/SORTSpp
def ns_fence_plot():
    scan = rslib.ns_fence_model(lat=69., lon=19., alt=150.)
    plot_radar_scan(scan, earth=True)
    plt.show()
コード例 #8
0
ファイル: DEV_radar_scan_lib.py プロジェクト: zzwei1/SORTSpp
def beampark_plot():
    scan = rslib.beampark_model(az=0., el=45.0, lat=69., lon=19., alt=150.)
    plot_radar_scan(scan, earth=True)
    plt.show()