Exemple #1
0
    def test_ecef2local_inverse(self):
        dec = 3

        lat, lon, alt = 0.0, 0.0, 0.0
        x = n.array([0.0, 0.0, 0.0])
        g = coord.enu2ecef(lat, lon, alt, x[0], x[1], x[2])
        x_ref = coord.ecef2local(lat, lon, alt, g[0], g[1], g[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        lat, lon = 0.0, 0.0
        x = n.array([0.0, 0.0, -100.0])
        g = coord.enu2ecef(lat, lon, alt, x[0], x[1], x[2])
        x_ref = coord.ecef2local(lat, lon, alt, g[0], g[1], g[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        x = n.array([0.0, 0.0, 100.0])
        g = coord.enu2ecef(lat, lon, alt, x[0], x[1], x[2])
        x_ref = coord.ecef2local(lat, lon, alt, g[0], g[1], g[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        lat, lon = 90.0, 0.0
        x = n.array([0.0, 0.0, 100.0])
        g = coord.enu2ecef(lat, lon, alt, x[0], x[1], x[2])
        x_ref = coord.ecef2local(lat, lon, alt, g[0], g[1], g[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        lat, lon = 45.0, 0.0
        x = n.array([0.0, 0.0, -n.sqrt(2.0)])
        g = coord.enu2ecef(lat, lon, alt, x[0], x[1], x[2])
        x_ref = coord.ecef2local(lat, lon, alt, g[0], g[1], g[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)
Exemple #2
0
 def point_ecef(self, point):
     '''Point antenna beam in location of ECEF coordinate. Returns local pointing direction.
     '''
     k_obj = coord.ecef2local(
         lat=self.lat,
         lon=self.lon,
         alt=self.alt,
         x=point[0],
         y=point[1],
         z=point[2],
     )
     self.beam.point_k0(k_obj)
     return k_obj / n.linalg.norm(k_obj)
Exemple #3
0
    def test_ecef2local(self):
        dec = 3

        lat, lon, alt = 0.0, 0.0, 0.0
        x_ref = n.array([0.0, 0.0, 100.0])  #enu
        ecef = n.array([100.0, 0.0, 0.0])
        x = coord.ecef2local(lat, lon, alt, ecef[0], ecef[1], ecef[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        x_ref = n.array([0.0, 100.0, 0.0])
        ecef = n.array([0.0, 0.0, 100.0])
        x = coord.ecef2local(lat, lon, alt, ecef[0], ecef[1], ecef[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        x_ref = n.array([100.0, 0.0, 0.0])
        ecef = n.array([0.0, 100.0, 0.0])
        x = coord.ecef2local(lat, lon, alt, ecef[0], ecef[1], ecef[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        lat, lon = 0.0, 180.0
        x_ref = n.array([0.0, 0.0, 100.0])
        ecef = n.array([-100.0, 0.0, 0.0])
        x = coord.ecef2local(lat, lon, alt, ecef[0], ecef[1], ecef[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        lat, lon = 90.0, 0.0
        x_ref = n.array([0.0, 0.0, 100.0])
        ecef = n.array([0.0, 0.0, 100.0])
        x = coord.ecef2local(lat, lon, alt, ecef[0], ecef[1], ecef[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)

        lat, lon = 45.0, 0.0
        x_ref = n.array([0.0, 0.0, n.sqrt(200.0)])
        ecef = n.array([10.0, 0.0, 10.0])
        x = coord.ecef2local(lat, lon, alt, ecef[0], ecef[1], ecef[2])
        nt.assert_array_almost_equal(x_ref, x, decimal=dec)
Exemple #4
0
def get_detections(obj,
                   radar,
                   t0,
                   t1,
                   max_dpos=10.0e3,
                   logger=None,
                   pass_dt=None):
    '''Find all detections of a object by input radar between two times relative the object Epoch.

    :param SpaceObject obj: Space object to find detections of.
    :param RadarSystem radar: Radar system that scans for the object.
    :param float t0: Start time for scan relative space object epoch.
    :param float t1: End time for scan relative space object epoch.
    :param float max_dpos: Maximum separation between evaluation points in meters for finding the pass interval.
    :param Logger logger: Logger object for logging the execution of the function.
    :param float pass_dt: The time step used when evaluating pass. Default is the scan-minimum dwell time but can be forces to a setting by this variable.
    :return: Detections data structure in form of a list of dictionaries, see description below.
    :rtype: list
    
    **Return data:**
    
        List of same length as radar system TX antennas. Each entry in the list is a dictionary with the following items:

        * t0: List of pass start times. Length is equal the number of detection but unique times are equal to the number of passes..
        * t1: List of pass end times, i.e. when the space object passes below the FOV. Same list configuration as "t0"
        * snr: List of lists of SNR's for each TX-RX pair for each detection. I.e. the top list length is equal the number of detections and the elements are lists of length equal to the number of TX-RX pairs.
        * tm: List of times corresponding to each detection, same length as "snr" item.
        * range: Same structure as the "snr" item but with ranges between the TX and the RX antenna trough the object, i.e. two way range. Unit is meters.
        * range_rate: Same structure as the "range" item but with range-rates, i.e. rate of change of two way range. Unit is meters per second.
        * tx_gain: List of gains from the TX antenna for the detection, length of list is equal the number of detections.
        * rx_gain: List of lists in the same structure as the "snr" item but with receiver gains instead of signal to noise ratios.
        * on_axis_angle: List of angles between the space object and the pointing direction for each detection, length of list is equal to the number of detections.
    
    '''

    # list of transmitters
    txs = radar._tx
    # list of receivers
    rxs = radar._rx

    zenith = n.array([0, 0, 1], dtype=n.float)

    # list of detections for each transmitter-receiver pair
    # return detections, and also r, rr, tx gain, and rx gain
    detections = []
    for tx in txs:
        detections.append({
            "t0": [],
            "t1": [],
            "snr": [],
            'tm': [],
            "range": [],
            "range_rate": [],
            "tx_gain": [],
            "rx_gain": [],
            "on_axis_angle": []
        })

    num_t = simulate_tracking.find_linspace_num(t0,
                                                t1,
                                                obj.a * 1e3,
                                                obj.e,
                                                max_dpos=max_dpos)

    if logger is not None:
        logger.debug("n_points {} at {} m resolution".format(num_t, max_dpos))

    # time vector
    t = n.linspace(t0, t1, num=num_t, dtype=n.float)

    passes, passes_id, _, _, _ = simulate_tracking.find_pass_interval(
        t, obj, radar)
    for txi, pas in enumerate(passes):
        if pas is None:
            passes[txi] = []
    for txi, pas in enumerate(passes_id):
        if pas is None:
            passes_id[txi] = []

    #format: passes
    # [tx num][pass num][0 = above, 1 = below]

    if logger is not None:
        for txi in range(len(txs)):
            logger.debug('passes cnt: {}'.format(len(passes[txi])))

    for txi, tx in enumerate(txs):

        for pas in passes[txi]:

            if pass_dt is None:
                num_pass = int((pas[1] - pas[0]) / tx.scan.min_dwell_time)
            else:
                num_pass = int((pas[1] - pas[0]) / pass_dt)

            t_pass = n.linspace(pas[0], pas[1], num=num_pass, dtype=n.float)

            if logger is not None:
                logger.debug('tx{} - pass{} - num_pass: {}'.format(
                    txi, len(detections[txi]["t0"]), num_pass))

            states = obj.get_state(t_pass)

            ecef = states[:3, :]
            vels = states[3:, :]

            pos_rel_tx = (ecef.T - tx.ecef).T

            snrs = n.empty((num_pass, len(rxs)), dtype=n.float)
            angles = n.empty((num_pass, ), dtype=n.float)
            ks_obj = n.empty((3, num_pass), dtype=n.float)
            ksr_obj = n.empty((3, num_pass, len(rxs)), dtype=n.float)
            k0s = n.empty((3, num_pass), dtype=n.float)
            range_tx = n.empty((num_pass, ), dtype=n.float)
            vel_tx = n.empty((num_pass, ), dtype=n.float)
            gain_tx = n.empty((num_pass, ), dtype=n.float)
            gain_rx = n.empty((num_pass, len(rxs)), dtype=n.float)
            r_rad = n.empty((num_pass, len(rxs)), dtype=n.float)
            v_rad = n.empty((num_pass, len(rxs)), dtype=n.float)
            snrs_mask = n.full(snrs.shape, False, dtype=n.bool)
            zenith_mask = n.full(snrs.shape, False, dtype=n.bool)

            inds_mask = n.full((num_pass, ), True, dtype=n.bool)
            inds = n.arange(num_pass, dtype=n.int)

            for I in range(num_pass):
                k0 = tx.get_scan(t_pass[I]).local_pointing(t_pass[I])
                k0s[:, I] = k0

                ks_obj[:, I] = coord.ecef2local(
                    lat=tx.lat,
                    lon=tx.lon,
                    alt=tx.alt,
                    x=pos_rel_tx[0, I],
                    y=pos_rel_tx[1, I],
                    z=pos_rel_tx[2, I],
                )

                angles[I] = coord.angle_deg(k0s[:, I], ks_obj[:, I])
                if angles[I] > radar.max_on_axis:
                    inds_mask[I] = False

            inds_tmp = inds[inds_mask]

            if logger is not None:
                logger.debug('f1 inds left {}/{}'.format(
                    inds_mask.shape, inds.shape))

            for rxi, rx in enumerate(rxs):
                pos_rel_rx = (ecef.T - rx.ecef).T

                for I in inds_tmp:
                    k_obj_rx = coord.ecef2local(
                        lat=rx.lat,
                        lon=rx.lon,
                        alt=rx.alt,
                        x=pos_rel_rx[0, I],
                        y=pos_rel_rx[1, I],
                        z=pos_rel_rx[2, I],
                    )

                    ksr_obj[:, I, rxi] = k_obj_rx

                    elevation_angle_rx = 90.0 - coord.angle_deg(
                        zenith, k_obj_rx)
                    if elevation_angle_rx < rx.el_thresh:
                        continue

                    zenith_mask[I, rxi] = True

                    rx_dist = n.linalg.norm(pos_rel_rx[:, I])
                    rx_vel = n.dot(vels[:, I], pos_rel_rx[:, I] / rx_dist)

                    r_rad[I, rxi] = rx_dist
                    v_rad[I, rxi] = rx_vel

            for I in inds:
                if n.any(zenith_mask[I, :]):
                    tx.beam.point_k0(k0s[:, I])
                    range_tx[I] = n.linalg.norm(pos_rel_tx[:, I])
                    vel_tx[I] = n.dot(vels[:, I],
                                      pos_rel_tx[:, I] / range_tx[I])
                    gain_tx[I] = tx.beam.gain(ks_obj[:, I])

            for rxi, rx in enumerate(rxs):
                if logger is not None:
                    logger.debug('f2_rx{} inds left {}/{}'.format(
                        rxi, inds.shape, inds[zenith_mask[:, rxi]].shape))

                for I in inds[zenith_mask[:, rxi]]:

                    # TODO: We need to change this
                    # Probably we need to define additional parameters in the RadarSystem class that defines the constraints on each receiver transmitter, and defines if any of them are at the same location.
                    # what we need to do is give the RX a scan also that describes the pointing for detections when there is no after the fact beam-steering to do grid searches
                    #
                    if rx.phased:
                        # point receiver towards object (post event beam forming)
                        rx.beam.point_k0(ksr_obj[:, I, rxi])
                    else:
                        #point according to receive pointing
                        k0 = rx.get_scan(t_pass[I]).local_pointing(t_pass[I])
                        rx.beam.point_k0(k0)

                    gain_rx[I, rxi] = rx.beam.gain(ksr_obj[:, I, rxi])

                    snr = debris.hard_target_enr(
                        gain_tx[I],
                        gain_rx[I, rxi],
                        rx.wavelength,
                        tx.tx_power,
                        range_tx[I],
                        r_rad[I, rxi],
                        diameter_m=obj.d,
                        bandwidth=tx.coh_int_bandwidth,
                        rx_noise_temp=rx.rx_noise,
                    )

                    #if logger is not None:
                    #    logger.debug('angles[{}] {} deg, gain_tx[{}] = {}, gain_rx[{}, {}] = {}'.format(
                    #        I, angles[I],
                    #        I, gain_tx[I],
                    #        I, rxi, gain_rx[I, rxi],
                    #    ))

                    snrs[I, rxi] = snr

                    if snr < tx.enr_thresh:
                        continue

                    snrs_mask[I, rxi] = True

            for I in inds:
                if n.any(snrs_mask[I, :]):
                    inst_snrs = snrs[I, snrs_mask[I, :]]
                    if 10.0 * n.log10(n.max(inst_snrs)) > radar.min_SNRdb:
                        if logger is not None:
                            logger.debug(
                                'adding detection at {} sec with {} SNR'.
                                format(t_pass[I], snrs[I, :]))

                        detections[txi]["t0"].append(pas[0])
                        detections[txi]["t1"].append(pas[1])
                        detections[txi]["snr"].append(snrs[I, :])
                        detections[txi]["range"].append(r_rad[I, :] +
                                                        range_tx[I])
                        detections[txi]["range_rate"].append(v_rad[I, :] +
                                                             vel_tx[I])
                        detections[txi]["tx_gain"].append(gain_tx[I])
                        detections[txi]["rx_gain"].append(gain_rx[I, :])
                        detections[txi]["tm"].append(t_pass[I])
                        detections[txi]["on_axis_angle"].append(angles[I])

    return detections
Exemple #5
0
def get_passes(o,
               radar,
               t0,
               t1,
               max_dpos=1e3,
               logger=None,
               plot=False,
               t_samp=None):
    '''Follow object and determine possible maintenance track window. I.e. get all passes of the object inside the radar system FOV.
    
    :param SpaceObject o: Space object to find passes for.
    :param RadarSystem radar: Radar system that defines the FOV.
    :param float t0: Start time for passes search in seconds relative space object epoch.
    :param float t1: Stop time for passes search in seconds relative space object epoch.
    :param float max_dpos: Maximum separation in km between orbital evaluation points.
    :param Logger logger: Logger object for logging the execution of the function.
    :param float t_samp: If not None, overrides the "max_dpos" variable and fixes a time-sampling.
    :return: Dictionary containing information about all passes of the space object inside the radar system FOV.
    :rtype: dict

    **Output dictionary:**

      * t: Three layers of lists where first layer is a list corresponding to every RX antenna of the radar system. Second layer is the a entry in the list for every pass. Last layer of lists is a list of two elements where the first is the time in seconds when object enters the FOV and second is the time in seconds when the object leaves the FOV. I.e. :code:`pass_start_time = passes["t"][tx_index][pass_index][0]` and :code:`pass_end_time = passes["t"][tx_index][pass_index][1]`.
      * snr: This structure has the same format as the "t" item but with an extra layer of lists of receivers before the bottom. Then instead of the bottom layer of lists being start and stop times it records the peak SNR at the first item and the time of that peak SNR in the second item. I.e. :code:`pass_peak_snr = passes["snr"][tx_index][pass_index][rx_index][0]` and :code:`pass_peak_snr_time = passes["snr"][tx_index][pass_index][rx_index][1]`.
    '''
    pass_struct = {"t": [], "snr": []}

    if t_samp is None:
        num_t = find_linspace_num(t0, t1, o.a * 1e3, o.e, max_dpos=max_dpos)
        t = n.linspace(t0, t1, num=num_t, dtype=n.float64)
    else:
        t = n.arange(t0, t1, t_samp, dtype=n.float64)
        num_t = len(t)

    if logger is not None:
        logger.debug("n_points %d %1.2f" % (num_t, max_dpos))

    # time vector

    if logger is not None:
        date0_y, date0_m, date0_d = dpt.jd_to_date(dpt.mjd_to_jd(o.mjd0))
        logger.debug(
            '--> Getting {} orbit location between: {:.5f} h and {:.5f} h relative {}-{}-{}'
            .format(
                num_t,
                t[0] / (3600),
                t[-1] / (3600),
                date0_y,
                date0_m,
                date0_d,
            ))

    passes, passes_id, idx_v, postx_v, posrx_v = find_pass_interval(
        t, o, radar, logger=logger)

    if logger is not None:
        logger.debug("passes:\n {}".format(passes))

    tx_dets = 0
    for idx in idx_v:
        if len(idx) > 0:
            tx_dets += 1

    if tx_dets == 0:
        if logger is not None:
            logger.debug("no passes visible from any RX station")
        return pass_struct

    if logger is not None:
        logger.debug("--> List of passes constructed")
        logger.debug("{}".format(passes))

    snrs = [None] * len(radar._tx)
    for txi, idx in enumerate(idx_v):
        if len(idx) > 0:
            snrs[txi] = [None] * len(passes[txi])
            tx = radar._tx[txi]
            for pid, pass_ids in enumerate(passes_id[txi]):
                idx_p = idx[pass_ids[0]:pass_ids[1]]

                if logger is not None:
                    logger.debug("{}".format(idx_p))
                    logger.debug("{}".format(pass_ids))

                snrs[txi][pid] = [None] * len(radar._rx)
                rx_dets = 0
                for rxi, rx in enumerate(radar._rx):
                    snr_curve = []
                    for I in idx_p:
                        tx_dist = n.linalg.norm(postx_v[txi][:, I])
                        k0 = coord.ecef2local(
                            lat=tx.lat,
                            lon=tx.lon,
                            alt=tx.alt,
                            x=postx_v[txi][0, I],
                            y=postx_v[txi][1, I],
                            z=postx_v[txi][2, I],
                        )
                        tx.beam.point_k0(k0)
                        gain_tx = tx.beam.gain(k0)

                        rx_dist = n.linalg.norm(posrx_v[rxi][:, I])
                        # point towards object
                        k0 = coord.ecef2local(
                            lat=rx.lat,
                            lon=rx.lon,
                            alt=rx.alt,
                            x=posrx_v[txi][0, I],
                            y=posrx_v[txi][1, I],
                            z=posrx_v[txi][2, I],
                        )
                        rx.beam.point_k0(k0)
                        gain_rx = rx.beam.gain(k0)

                        snr = debris.hard_target_enr(
                            gain_tx,
                            gain_rx,
                            rx.wavelength,
                            tx.tx_power,
                            tx_dist,
                            rx_dist,
                            diameter_m=o.d,
                            bandwidth=tx.coh_int_bandwidth,
                            rx_noise_temp=rx.rx_noise)

                        if logger is not None:
                            logger.debug(
                                '\n--> TX-d: %.2f km | TX-g: %.2f dB' %
                                (tx_dist * 1e-3, 10.0 * n.log10(gain_tx)))
                            logger.debug(
                                '--> RX-d: %.2f km | RX-g: %.2f dB' %
                                (rx_dist * 1e-3, 10.0 * n.log10(gain_rx)))
                            logger.debug('--> SNR: %.2f dB ' %
                                         (10.0 * n.log10(snr)))
                        snr_curve.append(snr)

                    snr_curve = n.array(snr_curve)

                    if plot:
                        snr_curve_dB = 10.0 * n.log10(snr_curve)
                        snr_curve_dB[snr_curve_dB < 0] = 0
                        plt.plot(t[idx_p], snr_curve_dB)
                        plt.plot(t[idx_p[n.argmax(snr_curve)]],
                                 n.max(snr_curve_dB), 'or')
                        plt.title("tx %i, pass %i, rx %i" % (txi, pid, rxi))
                        plt.show()
                        print('SNR max: %.2f @ %.2f h' %
                              (n.max(snr_curve_dB),
                               t[idx_p[n.argmax(snr_curve)]] / 3600.0))
                    if len(snr_curve) > 0:
                        snr_max = n.max(snr_curve)
                    else:
                        snr_max = 0.0
                    if snr_max >= tx.enr_thresh:
                        rx_dets += 1
                        snrs[txi][pid][rxi] = [
                            snr_max, t[idx_p[n.argmax(snr_curve)]]
                        ]
                    else:
                        snrs[txi][pid][rxi] = [0, 0]

                if rx_dets == 0:
                    snrs[txi][pid] = None

                if plot:
                    fig = plt.figure(figsize=(15, 15))
                    ax = fig.add_subplot(111, projection='3d')
                    plothelp.draw_earth_grid(ax)
                    ax.plot(ecef[0, :],
                            ecef[1, :],
                            ecef[2, :],
                            alpha=1,
                            color="black")
                    for I in idx_p:
                        ax.plot([tx.ecef[0], tx.ecef[0] + postx_v[txi][0, I]],
                                [tx.ecef[1], tx.ecef[1] + postx_v[txi][1, I]],
                                [tx.ecef[2], tx.ecef[2] + postx_v[txi][2, I]],
                                alpha=0.5,
                                color="red")
                        for rxi, rx in enumerate(radar._rx):
                            ax.plot(
                                [rx.ecef[0], rx.ecef[0] + posrx_v[rxi][0, I]],
                                [rx.ecef[1], rx.ecef[1] + posrx_v[rxi][1, I]],
                                [rx.ecef[2], rx.ecef[2] + posrx_v[rxi][2, I]],
                                alpha=0.5,
                                color="red")
                    delta = 1000e3
                    ax.set_xlim([tx.ecef[0] - delta, tx.ecef[0] + delta])
                    ax.set_ylim([tx.ecef[1] - delta, tx.ecef[1] + delta])
                    ax.set_zlim([tx.ecef[2] - delta, tx.ecef[2] + delta])
                    plt.show()
            passes[txi] = [
                x for ix, x in enumerate(passes[txi])
                if snrs[txi][ix] is not None
            ]  #remove tracks that were not above detection tresholds at any pair
            snrs[txi] = [
                x for x in snrs[txi] if x is not None
            ]  #remove tracks that were not above detection tresholds at any pair

    for txi, tx_snr in enumerate(snrs):
        if tx_snr is None:
            snrs[txi] = []
    for txi, tx_pass in enumerate(passes):
        if tx_pass is None:
            passes[txi] = []

    pass_struct['snr'] = snrs
    pass_struct['t'] = passes

    return pass_struct
Exemple #6
0
def get_track_snr(t, o, radar):
    '''Takes a series of times, a space object and a radar system and calculates the SNR for that space object measured by that radar over the given times.

    :param numpy.ndarray t: Times in seconds relative space object epoch over witch SNR should be evaluated.
    :param SpaceObject o: Space object to be measured.
    :param RadarSystem radar: Radar system that performs the measurement.
    :return: List of lists of numpy.ndarray's corresponding to TX antenna index, RX antenna index and SNR-array in that order of list depth.
    '''

    ecef = o.get_orbit(t)

    tx_ecef = []
    rx_ecef = []
    for tx in radar._tx:
        tx_ecef.append(tx.ecef)
    for rx in radar._rx:
        rx_ecef.append(rx.ecef)

    postx_v = []
    posrx_v = []
    for rxp0 in rx_ecef:
        pos_vecs = (ecef.T - rxp0).T
        posrx_v.append(pos_vecs)

    for txi, txp0 in enumerate(tx_ecef):
        pos_vecs = (ecef.T - txp0).T
        postx_v.append(pos_vecs)

    snrs = [None] * len(radar._tx)
    for txi, tx in enumerate(radar._tx):
        snrs[txi] = [None] * len(radar._rx)
        for rxi, rx in enumerate(radar._rx):
            snr_curve = []
            for I in range(len(t)):

                tx_dist = n.linalg.norm(postx_v[txi][:, I])
                k0 = coord.ecef2local(
                    lat=tx.lat,
                    lon=tx.lon,
                    alt=tx.alt,
                    x=postx_v[txi][0, I],
                    y=postx_v[txi][1, I],
                    z=postx_v[txi][2, I],
                )
                tx.beam.point_k0(k0)
                gain_tx = tx.beam.gain(k0)

                rx_dist = n.linalg.norm(posrx_v[rxi][:, I])
                # point towards object
                k0 = coord.ecef2local(
                    lat=rx.lat,
                    lon=rx.lon,
                    alt=rx.alt,
                    x=posrx_v[txi][0, I],
                    y=posrx_v[txi][1, I],
                    z=posrx_v[txi][2, I],
                )
                rx.beam.point_k0(k0)
                gain_rx = rx.beam.gain(k0)

                snr = debris.hard_target_enr(gain_tx,
                                             gain_rx,
                                             rx.wavelength,
                                             tx.tx_power,
                                             tx_dist,
                                             rx_dist,
                                             diameter_m=o.d,
                                             bandwidth=tx.coh_int_bandwidth,
                                             rx_noise_temp=rx.rx_noise)

                snr_curve.append(snr)

            snr_curve = n.array(snr_curve)
            snrs[txi][rxi] = snr_curve
    return snrs