def channel_init(self): self.rx_interconnect = pylink.Interconnect(is_rx=True) self.tx_interconnect = pylink.Interconnect(is_rx=False) altitude = self.sampler(self.channel_configuration, ['geometry', 'altitude']) self.geometry = pylink.Geometry(apoapsis_altitude_km=altitude, periapsis_altitude_km=altitude, min_elevation_deg=self.elevation) self.downlink_channel = pylink.Channel( bitrate_hz=self.sampler(self.channel_configuration, ['downlink', 'bitrate']), allocation_hz=self.sampler(self.channel_configuration, ['downlink', 'allocation']), center_freq_mhz=self.sampler(self.channel_configuration, ['downlink', 'center_freq']), atmospheric_loss_db=self.sampler(self.channel_configuration, ['downlink', 'atmospheric_loss']), ionospheric_loss_db=self.sampler(self.channel_configuration, ['downlink', 'ionospheric_loss']), rain_loss_db=self.sampler(self.channel_configuration, ['downlink', 'rain_loss']), multipath_fading_db=self.sampler(self.channel_configuration, ['downlink', 'multipath_fading']), polarization_mismatch_loss_db=self.sampler( self.channel_configuration, ['downlink', 'polarization_mismatch_loss'])) self.uplink_channel = pylink.Channel( bitrate_hz=self.sampler(self.channel_configuration, ['uplink', 'bitrate']), allocation_hz=self.sampler(self.channel_configuration, ['uplink', 'allocation']), center_freq_mhz=self.sampler(self.channel_configuration, ['uplink', 'center_freq']), atmospheric_loss_db=self.sampler(self.channel_configuration, ['uplink', 'atmospheric_loss']), ionospheric_loss_db=self.sampler(self.channel_configuration, ['uplink', 'ionospheric_loss']), rain_loss_db=self.sampler(self.channel_configuration, ['uplink', 'rain_loss']), multipath_fading_db=self.sampler(self.channel_configuration, ['uplink', 'multipath_fading']), polarization_mismatch_loss_db=self.sampler( self.channel_configuration, ['uplink', 'polarization_mismatch_loss']))
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()])
name='Ground SBand Receiver') gs_transmitter = pylink.Transmitter(tx_power_at_pa_dbw=23, name='Ground SBand Transmitter') sat_transmitter = pylink.Transmitter(tx_power_at_pa_dbw=1.5, name='Satellite XBand Transmitter') rx_interconnect = pylink.Interconnect(is_rx=True) tx_interconnect = pylink.Interconnect(is_rx=False) x_channel = pylink.Channel(bitrate_hz=1e6, allocation_hz=500e4, 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()
"""Illustrations of the precedence order for node definitions. 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(),
gs_transmitter = pylink.Transmitter(tx_power_at_pa_dbw=25, name='Ground Ka-Band Transmitter') sat_transmitter = pylink.Transmitter(tx_power_at_pa_dbw=50, name='Satellite Ka-Band Transmitter') rx_interconnect = pylink.Interconnect(is_rx=True) tx_interconnect = pylink.Interconnect(is_rx=False) ka_channel = pylink.Channel(bitrate_hz=.072, allocation_hz=500e6, center_freq_mhz=32550, 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,