def __init__(self, satellite_configuration, groundstation_configuration, channel_configuration, monte_carlo=False, warn=True): # store the parameters internally self.satellite_configuration = satellite_configuration self.groundstation_configuration = groundstation_configuration self.channel_configuration = channel_configuration self.monte_carlo = monte_carlo self.warn = warn # if we're doing Monte-Carlo we need to choose an elevation to use if self.monte_carlo: distribution = channel_configuration['statistical']['geometry'][ 'elevation'] assert distribution[0] == 'Uniform' minimum_elevation = float(distribution[1][0]) maximum_elevation = float(distribution[1][1]) self.elevation = (maximum_elevation - minimum_elevation ) * random.random() + minimum_elevation else: self.elevation = channel_configuration['nominal']['geometry'][ 'elevation'] # set the components self.satellite_init() self.groundstation_init() self.channel_init() # defaults to DVB-S2X self.modulation = pylink.Modulation() # form the downlink signal chain self.downlink = pylink.DAGModel([ self.geometry, self.gs_rx_antenna, self.sat_transmitter, self.sat_tx_antenna, self.gs_receiver, self.downlink_channel, self.rx_interconnect, self.tx_interconnect, self.modulation, pylink.LinkBudget(name='Downlink', is_downlink=True) ]) # form the downlink signal chain self.uplink = pylink.DAGModel([ self.geometry, self.sat_rx_antenna, self.sat_receiver, self.gs_transmitter, self.gs_tx_antenna, self.uplink_channel, pylink.LinkBudget(name='Uplink', is_downlink=False) ])
def model(): return pylink.DAGModel([pylink.Geometry(), pylink.Antenna(is_rx=True), pylink.Interconnect(is_rx=True), pylink.Receiver(), pylink.Transmitter(), pylink.Interconnect(is_rx=False), pylink.Antenna(is_rx=False), pylink.Channel(), pylink.Modulation(name='QPSK', perf=perf), pylink.LinkBudget()])
def update_gs_rx_antenna_gain(self, gain): # create new antenna self.gs_rx_antenna = pylink.Antenna( gain=gain, pattern=self.sampler(self.groundstation_configuration, ['rx', 'antenna', 'pattern']), polarization=self.groundstation_configuration['nominal']['rx'] ['antenna']['polarization'], is_rx=True, tracking=self.groundstation_configuration['nominal']['rx'] ['antenna']['tracking'], pointing_loss_db=self.sampler(self.groundstation_configuration, ['rx', 'antenna', 'pointing_loss']), rx_noise_temp_k=self.sampler(self.groundstation_configuration, ['rx', 'antenna', 'noise_temp'])) # form the downlink signal chain self.downlink = pylink.DAGModel([ self.geometry, self.gs_rx_antenna, self.sat_transmitter, self.sat_tx_antenna, self.gs_receiver, self.downlink_channel, self.rx_interconnect, self.tx_interconnect, self.modulation, pylink.LinkBudget(name='Downlink', is_downlink=True) ])
center_freq_mhz=8200, atmospheric_loss_db=1, ionospheric_loss_db=1, rain_loss_db=2, multipath_fading_db=0, polarization_mismatch_loss_db=3) s_channel = pylink.Channel(bitrate_hz=500e3, allocation_hz=5e6, center_freq_mhz=2022.5, atmospheric_loss_db=.5, ionospheric_loss_db=.5, rain_loss_db=1, multipath_fading_db=0, polarization_mismatch_loss_db=3) # defaults to DVB-S2X modulation = pylink.Modulation() DOWNLINK = pylink.DAGModel([ geometry, gs_rx_antenna, sat_transmitter, sat_tx_antenna, gs_receiver, x_channel, rx_interconnect, tx_interconnect, modulation, pylink.LinkBudget(name='Example XBand Downlink', is_downlink=True) ]) UPLINK = pylink.DAGModel([ geometry, sat_rx_antenna, sat_receiver, gs_transmitter, gs_tx_antenna, s_channel, pylink.LinkBudget(name='Example SBand Uplink', is_downlink=False) ])
Nodes are added to the DAG in the order in which they are received. So you can, if you wish, override a standard definition. """ # Vanilla link budget m = pylink.DAGModel([ pylink.Geometry(), pylink.Transmitter(tx_power_at_pa_dbw=2), pylink.Interconnect(is_rx=False), pylink.Antenna(is_rx=False), pylink.Receiver(), pylink.Antenna(is_rx=True), pylink.Interconnect(is_rx=True), pylink.Channel(), pylink.Modulation('DVB-S2X'), pylink.LinkBudget() ]) e = m.enum print 'Link margin in vanilla example: %s' % m.link_margin_db # let's override the link_margin_db node in the kwargs def _evil_margin_db(model): return -3.0 m = pylink.DAGModel([ pylink.Geometry(), pylink.Transmitter(tx_power_at_pa_dbw=2), pylink.Interconnect(is_rx=False),
atmospheric_loss_db=1, ionospheric_loss_db=1, rain_loss_db=2, multipath_fading_db=0, polarization_mismatch_loss_db=3) modulation = pylink.Modulation() DOWNLINK = pylink.DAGModel([geometry, gs_rx_antenna, sat_transmitter, sat_tx_antenna, gs_receiver, ka_channel, rx_interconnect, tx_interconnect, modulation, pylink.LinkBudget(name='Ka Downlink', is_downlink=True)]) UPLINK = pylink.DAGModel([geometry, sat_rx_antenna, sat_receiver, gs_transmitter, gs_tx_antenna, ka_channel, modulation, pylink.LinkBudget(name='Ka Uplink', is_downlink=False)])
} tx_power = TA(2, part_number='234x', test_report='http://reports.co/234x') m = pylink.DAGModel([pylink.Geometry(), pylink.Transmitter(tx_power_at_pa_dbw=tx_power), pylink.Interconnect(is_rx=False), pylink.Antenna(is_rx=False), pylink.Receiver(), pylink.Antenna(is_rx=True), pylink.Interconnect(is_rx=True), pylink.Channel(), pylink.Modulation('DVB-S2X'), pylink.LinkBudget()], **ex) e = m.enum print('slant range (km): %3g' % m.slant_range_km) print('antenna angle (deg): %3g' % m.satellite_antenna_angle_deg) print('total rx noise temp (K): %3g' % m.rx_noise_temp_k) print('receiver noise temp (K): %3g' % m.rx_system_noise_temp_k) print('noise factor: %3g' % m.rx_system_noise_factor) print('noise figure (dB): %3g' % m.rx_system_noise_figure) print('transmit power (dBW): %3g' % m.tx_power_at_antenna_dbw) print('transmit eirp (dBW): %3g' % m.tx_eirp_dbw) print('UGPL (dB): %3g' % m.unity_gain_propagation_loss_db) print('Total Channel Loss (dB): %3g' % m.total_channel_loss_db) print('Link Margin (dB): %3g' % m.link_margin_db) print('Noise BW Loss (dB): %-3g' % m.excess_noise_bandwidth_loss_db)