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 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']))
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, polarization='RHCP', pattern=sat_pattern, rx_noise_temp_k=1000, is_rx=True, tracking=False) sat_tx_antenna = pylink.Antenna(gain=3, polarization='RHCP', pattern=sat_pattern, is_rx=False, tracking=False)
#!/usr/bin/python import pylink """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
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=426452, periapsis_altitude_km=356873, min_elevation_deg=20) sat_rx_antenna = pylink.Antenna(gain=54.7, polarization='RHCP', pattern=sat_pattern, rx_noise_temp_k=288.84, is_rx=True, tracking=False) sat_tx_antenna = pylink.Antenna(gain=53.11, polarization='RHCP', pattern=sat_pattern, is_rx=False, tracking=False)
def __do_it_do_it_now(self): return self.whimsy_coefficient ex = { 'whimsy_coefficient': TA(42, datasheet="hitchhiker's guide to the galaxy", author="Douglas Adams"), 'wacky_computation': __do_it_do_it_now } 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)