(sat, lnb, setup)
return {'dl': sat['dl_freq'], 'lo': lo_freq, 'l_band': if_freq}
Print summary of frequencies

    Inform the downlink RF frequency, the LNB LO frequency and the L-band
    frequency to be configured in the receiver.

    Args:
        sat   : user's satellite info
        lnb   : user's LNB info
Print summary of frequencies
Print summary of frequencies
def _cfg_frequencies(sat, lnb, setup):
    """Print summary of frequencies

    Inform the downlink RF frequency, the LNB LO frequency and the L-band
    frequency to be configured in the receiver.

    Args:
        sat   : user's satellite info
        lnb   : user's LNB info

    """
    getcontext().prec = 8

    if (sat['band'].lower() == "ku"):
        if (lnb['universal']):
            assert(isinstance(lnb['lo_freq'], list)), \
                "A Universal LNB must have a list with two LO frequencies"
            assert(len(lnb['lo_freq']) == 2), \
                "A Universal LNB must have two LO frequencies"

            if (sat['dl_freq'] > defs.ku_band_thresh):
                lo_freq = lnb['lo_freq'][1]
            else:
                lo_freq = lnb['lo_freq'][0]
        else:
            lo_freq = lnb['lo_freq']

        if_freq = float(Decimal(sat['dl_freq']) - Decimal(lo_freq))

    elif (sat['band'].lower() == "c"):
        lo_freq = lnb['lo_freq']
        if_freq = float(Decimal(lo_freq) - Decimal(sat['dl_freq']))
    else:
        raise ValueError("Unknown satellite band")

    if (if_freq < setup['tun_range'][0] or if_freq > setup['tun_range'][1]):
        logging.error("Your LNB yields an L-band frequency that is out of "
                      "the tuning range of the {} receiver.".format(
                          _get_rx_marketing_name(setup)))
        sys.exit(1)

    return {'dl': sat['dl_freq'], 'lo': lo_freq, 'l_band': if_freq}
def _cfg_frequencies ( sat , lnb , setup ) : getcontext ( ) . prec = 8 if ( sat [ 'band' ] . lower ( ) == "ku" ) : if ( lnb [ 'universal' ] ) : assert ( isinstance ( lnb [ 'lo_freq' ] , list ) ) , "A Universal LNB must have a list with two LO frequencies" assert ( len ( lnb [ 'lo_freq' ] ) == 2 ) , "A Universal LNB must have two LO frequencies" if ( sat [ 'dl_freq' ] > defs . ku_band_thresh ) : lo_freq = lnb [ 'lo_freq' ] [ 1 ] else : lo_freq = lnb [ 'lo_freq' ] [ 0 ] else : lo_freq = lnb [ 'lo_freq' ] if_freq = float ( Decimal ( sat [ 'dl_freq' ] ) - Decimal ( lo_freq ) ) elif ( sat [ 'band' ] . lower ( ) == "c" ) : lo_freq = lnb [ 'lo_freq' ] if_freq = float ( Decimal ( lo_freq ) - Decimal ( sat [ 'dl_freq' ] ) ) else : raise ValueError ( "Unknown satellite band" ) if ( if_freq < setup [ 'tun_range' ] [ 0 ] or if_freq > setup [ 'tun_range' ] [ 1 ] ) : logging . error ( "Your LNB yields an L-band frequency that is out of " "the tuning range of the {} receiver." . format ( _get_rx_marketing_name ( setup ) ) ) sys . exit ( 1 ) return { 'dl' : sat [ 'dl_freq' ] , 'lo' : lo_freq , 'l_band' : if_freq }