コード例 #1
0
ファイル: budget_test.py プロジェクト: spetten/pylink
    def test_tx_inline_losses_db(self, model):
        e = model.enum
        m = model

        radio_chain = [pylink.Element(name='x', gain_db=-1, noise_figure_db=1)]
        inter_chain = [pylink.Element(name='x', gain_db=-1, noise_figure_db=1)]
        ant_chain = [pylink.Element(name='x', gain_db=-1, noise_figure_db=1)]

        m.override(e.transmitter_rf_chain, radio_chain)
        m.override(e.tx_interconnect_rf_chain, inter_chain)
        m.override(e.tx_antenna_rf_chain, ant_chain)

        assert abs(m.tx_inline_losses_db - 3) < 1e-5
コード例 #2
0
ファイル: budget_test.py プロジェクト: spetten/pylink
    def test_rx_rf_chain(self, model):
        e = model.enum
        m = model

        radio_chain = [pylink.Element(name='a', gain_db=-1, noise_figure_db=1)]
        inter_chain = [pylink.Element(name='b', gain_db=-2, noise_figure_db=2)]
        ant_chain = [pylink.Element(name='c', gain_db=-3, noise_figure_db=3)]

        m.override(e.receiver_rf_chain, radio_chain)
        m.override(e.rx_interconnect_rf_chain, inter_chain)
        m.override(e.rx_antenna_rf_chain, ant_chain)

        chain = ant_chain + inter_chain + radio_chain
        assert m.rx_rf_chain == chain
コード例 #3
0
#!/usr/bin/env python

import os
import shutil
import subprocess
import numpy as np
import matplotlib.pyplot as plt

import pylink

sat_pattern = pylink.pattern_generator(3)

sat_rf_chain = [
    pylink.Element(name='Cables', gain_db=-0.75, noise_figure_db=0.75),
    pylink.Element(name='LNA', gain_db=35, noise_figure_db=2.75),
    pylink.Element(name='Filter', gain_db=-3.5, noise_figure_db=3.5),
    pylink.Element(name='Demodulator', gain_db=0, noise_figure_db=15),
]

gs_rf_chain = [
    pylink.Element(name='Cables', gain_db=-0.75, noise_figure_db=0.75),
    pylink.Element(name='LNA', gain_db=35, noise_figure_db=2.75),
    pylink.Element(name='Filter', gain_db=-3.5, noise_figure_db=3.5),
    pylink.Element(name='Demodulator', gain_db=0, noise_figure_db=15),
]

geometry = pylink.Geometry(apoapsis_altitude_km=550,
                           periapsis_altitude_km=500,
                           min_elevation_deg=20)

sat_rx_antenna = pylink.Antenna(gain=3,
コード例 #4
0
    def satellite_init(self):

        # build the receive RF chain
        self.sat_rf_chain = [
            pylink.Element(name='Cables',
                           gain_db=self.sampler(self.satellite_configuration,
                                                ['rx', 'cable', 'gain']),
                           noise_figure_db=self.sampler(
                               self.satellite_configuration,
                               ['rx', 'cable', 'noise_figure'])),
            pylink.Element(name='LNA',
                           gain_db=self.sampler(self.satellite_configuration,
                                                ['rx', 'lna', 'gain']),
                           noise_figure_db=self.sampler(
                               self.satellite_configuration,
                               ['rx', 'lna', 'noise_figure'])),
            pylink.Element(name='Filter',
                           gain_db=self.sampler(self.satellite_configuration,
                                                ['rx', 'filter', 'gain']),
                           noise_figure_db=self.sampler(
                               self.satellite_configuration,
                               ['rx', 'filter', 'noise_figure'])),
            pylink.Element(name='Demodulator',
                           gain_db=self.sampler(self.satellite_configuration,
                                                ['rx', 'demodulator', 'gain']),
                           noise_figure_db=self.sampler(
                               self.satellite_configuration,
                               ['rx', 'demodulator', 'noise_figure'])),
        ]

        # if no gain given, calculate from the antenna aperture
        if 'gain' in self.satellite_configuration['nominal']['rx']['antenna']:
            sat_rx_antenna_gain = self.sampler(self.satellite_configuration,
                                               ['rx', 'antenna', 'gain'])

            if 'aperture' in self.satellite_configuration['nominal']['rx'][
                    'antenna'] and self.warn:
                print(
                    "Satellite Rx Antenna: Both gain and aperature provided, will use gain"
                )

        else:
            sat_rx_antenna_gain = 10 * np.log10(
                self.sampler(self.satellite_configuration,
                             ['rx', 'antenna', 'aperture_efficiency']) *
                self.sampler(self.satellite_configuration,
                             ['rx', 'antenna', 'aperture']) * 4 * np.pi *
                (1e6 * self.sampler(self.channel_configuration,
                                    ['uplink', 'center_freq']))**2 /
                scipy.constants.c**2)

        # specify the receive antenna
        self.sat_rx_antenna = pylink.Antenna(
            gain=sat_rx_antenna_gain,
            polarization=self.satellite_configuration['nominal']['rx']
            ['antenna']['polarization'],
            pattern=self.sampler(self.satellite_configuration,
                                 ['rx', 'antenna', 'pattern']),
            is_rx=True,
            tracking=self.satellite_configuration['nominal']['rx']['antenna']
            ['tracking'],
            pointing_loss_db=self.sampler(self.satellite_configuration,
                                          ['rx', 'antenna', 'pointing_loss']),
            rx_noise_temp_k=self.sampler(self.satellite_configuration,
                                         ['rx', 'antenna', 'noise_temp']))

        # if no gain given, calculate from the antenna aperture
        if 'gain' in self.satellite_configuration['nominal']['tx']['antenna']:
            sat_tx_antenna_gain = self.sampler(self.satellite_configuration,
                                               ['tx', 'antenna', 'gain'])

            if 'aperture' in self.satellite_configuration['nominal']['tx'][
                    'antenna'] and self.warn:
                print(
                    "Satellite Tx Antenna: Both gain and aperature provided, will use gain"
                )

        else:
            sat_tx_antenna_gain = 10 * np.log10(
                self.sampler(self.satellite_configuration,
                             ['tx', 'antenna', 'aperture_efficiency']) *
                self.sampler(self.satellite_configuration,
                             ['tx', 'antenna', 'aperture']) * 4 * np.pi *
                (1e6 * self.sampler(self.channel_configuration,
                                    ['downlink', 'center_freq']))**2 /
                scipy.constants.c**2)

        self.sat_tx_antenna = pylink.Antenna(
            gain=sat_tx_antenna_gain,
            polarization=self.satellite_configuration['nominal']['tx']
            ['antenna']['polarization'],
            pattern=self.sampler(self.satellite_configuration,
                                 ['tx', 'antenna', 'pattern']),
            is_rx=False,
            tracking=self.satellite_configuration['nominal']['tx']['antenna']
            ['tracking'],
            pointing_loss_db=self.sampler(self.satellite_configuration,
                                          ['rx', 'antenna', 'pointing_loss']))

        self.sat_receiver = pylink.Receiver(
            rf_chain=self.sat_rf_chain,
            implementation_loss_db=self.sampler(
                self.satellite_configuration,
                ['rx', 'receiver', 'implementation_loss']),
            name='Satellite ' +
            self.channel_configuration['nominal']['uplink']['name'] +
            ' Receiver')

        self.sat_transmitter = pylink.Transmitter(
            tx_power_at_pa_dbw=self.sampler(self.satellite_configuration,
                                            ['tx', 'pa', 'power']),
            name='Satellite ' +
            self.channel_configuration['nominal']['downlink']['name'] +
            ' Transmitter')
コード例 #5
0
def example_rf_chain():
    return [
        pylink.Element(gain_db=-0.1,
                       noise_figure_db=0.1,
                       name='attenuator')
        ]
コード例 #6
0
def amplifier_10db():
    return pylink.Element(gain_db=10,
                          noise_figure_db=3,
                          name='amplifier')
コード例 #7
0
def attenuator_1db():
    return pylink.Element(gain_db=-1,
                          noise_figure_db=1,
                          name='attenuator')